def test_tile_to_meters_one(self):
     # TODO: this should return -16106127.36
     scal = ScaledWorldMercator()
     z = x = y = 0
     expected = -17179869.18
     mx, my = scal.tile_to_meters(z, x, y)
     mx = ScaledWorldMercator.truncate(mx)
     my = round(my, 2)
     assert float(mx) == expected and float(my) == expected
 def test_tile_to_lat_lon_two(self):
     z = 0
     x = y = 1
     lat, lon = ScaledWorldMercator.tile_to_lat_lon(z, x, y)
     lat_result = Geodetic.truncate(lat)
     assert float(lat_result) == 85.0840590 and \
         lon == 180.0
Exemplo n.º 3
0
 def test_tile_to_lat_lon_one(self):
     z = x = y = 0
     lat, lon = ScaledWorldMercator.tile_to_lat_lon(z, x, y)
     lat_result = Geodetic.truncate(lat)
     assert float(lat_result) == -85.0840590 and \
         lon == -180.0
Exemplo n.º 4
0
 def test_pixel_size(self):
     z = randint(0, 21)
     assert 2**z * ScaledWorldMercator.pixel_size(z) == 125829.12