Beispiel #1
0
 public void Test19()
 {
     testXY = Wgs84TileMath.LatLongToPixelXY(testLatitude, testLongitude, 19);
     Assert.True(testXY.X == 84963713 && testXY.Y == 41489802);
     testTile = Wgs84TileMath.LatLong2TileIndex(testLatitude, testLongitude, 19);
     Assert.True(testTile.X == 331889 && testTile.Y == 162069);
 }
Beispiel #2
0
 public void Test18()
 {
     testXY = Wgs84TileMath.LatLongToPixelXY(testLatitude, testLongitude, 18);
     Assert.True(testXY.X == 42481857 && testXY.Y == 20744901);
     testTile = Wgs84TileMath.LatLong2TileIndex(testLatitude, testLongitude, 18);
     Assert.True(testTile.X == 165944 && testTile.Y == 81034);
 }
Beispiel #3
0
 public void Test4()
 {
     testXY = Wgs84TileMath.LatLongToPixelXY(testLatitude, testLongitude, 4);
     Assert.True(testXY.X == 2593 && testXY.Y == 1266);
     testTile = Wgs84TileMath.LatLong2TileIndex(testLatitude, testLongitude, 4);
     Assert.True(testTile.X == 10 && testTile.Y == 4);
 }
Beispiel #4
0
 public void Test3()
 {
     testXY = Wgs84TileMath.LatLongToPixelXY(testLatitude, testLongitude, 3);
     Assert.True(testXY.X == 1296 && testXY.Y == 633);
     testTile = Wgs84TileMath.LatLong2TileIndex(testLatitude, testLongitude, 3);
     Assert.True(testTile.X == 5 && testTile.Y == 2);
 }
Beispiel #5
0
 public void Test2()
 {
     testXY = Wgs84TileMath.LatLongToPixelXY(testLatitude, testLongitude, 2);
     Assert.True(testXY.X == 648 && testXY.Y == 317);
     testTile = Wgs84TileMath.LatLong2TileIndex(testLatitude, testLongitude, 2);
     Assert.True(testTile.X == 2 && testTile.Y == 1);
 }
Beispiel #6
0
 public void Test1()
 {
     testXY = Wgs84TileMath.LatLongToPixelXY(testLatitude, testLongitude, 1);
     Assert.True(testXY.X == 324 && testXY.Y == 158);
     testTile = Wgs84TileMath.LatLong2TileIndex(testLatitude, testLongitude, 1);
     Assert.True(testTile.X == 1 && testTile.Y == 0);
 }
Beispiel #7
0
        public TileReplace TileFromWgs84ToSpherical(int wgs84TileIndexX, int wgs84TileIndexY, int zoom)
        {
            var leftTop = TileMathBase.TileXY2PixelXY(wgs84TileIndexX, wgs84TileIndexY);
            var latlon  = Wgs84TileMath.PixelXYToLatLong(leftTop.X, leftTop.Y, zoom);

            SphericalTileMath.LatLongToPixelXY(latlon.X, latlon.Y, zoom, out int pixelX, out int pixelY);
            return(FindReplace(wgs84TileIndexX, wgs84TileIndexY, zoom, new Point(pixelX, pixelY)));
        }
Beispiel #8
0
        public TileReplace TileFromSphericalToWgs84(int sphericalTileIndexX, int sphericalTileIndexY, int zoom)
        {
            var leftTop = TileMathBase.TileXY2PixelXY(sphericalTileIndexX, sphericalTileIndexY);

            SphericalTileMath.PixelXYToLatLong(leftTop.X, leftTop.Y, zoom, out double latitude, out double longitude);
            var resultXY = Wgs84TileMath.LatLongToPixelXY(latitude, longitude, zoom);

            return(FindReplace(sphericalTileIndexX, sphericalTileIndexY, zoom, resultXY));
        }