Пример #1
0
 def test_bottom_right_latlon_to_tile_for_each_zoom(self):
     for n in range(0, 24):
         bottom_right = latlon_to_tile(
             zoom=n, lat=WORLD_BOUNDS[1], lng=WORLD_BOUNDS[2], source_crs=4326, scheme="xyz"
         )
         max_tile = (2 ** n) - 1
         self.assertEqual((max_tile, max_tile), bottom_right, "Zoom level {} incorrect".format(n))
Пример #2
0
 def test_latlon_to_tile_manual(self):
     web_mercator_pos = (981106, 5978646)
     tms = latlon_to_tile(zoom=6, lat=web_mercator_pos[1], lng=web_mercator_pos[0], source_crs=3857, scheme="tms")
     xyz = latlon_to_tile(zoom=6, lat=web_mercator_pos[1], lng=web_mercator_pos[0], source_crs=3857, scheme="xyz")
     self.assertEqual((33, 41), tms)
     self.assertEqual((33, 22), xyz)
Пример #3
0
 def test_latlon_to_tile_xyz(self):
     xyz_tile = latlon_to_tile(0, WORLD_BOUNDS[1], WORLD_BOUNDS[0], source_crs=4326, scheme="xyz")
     self.assertEquals(xyz_tile, (0, 0))
Пример #4
0
 def test_latlon_to_tile_tms(self):
     tms_tile = latlon_to_tile(0, WORLD_BOUNDS[1], WORLD_BOUNDS[0], source_crs=4326, scheme="tms")
     self.assertEquals((0, 0), tms_tile)
Пример #5
0
 def test_top_left_latlon_to_tile_for_each_zoom(self):
     for n in range(0, 24):
         top_left = latlon_to_tile(zoom=n, lat=WORLD_BOUNDS[3], lng=WORLD_BOUNDS[0], source_crs=4326, scheme="xyz")
         self.assertEqual((0, 0), top_left, "Zoom level {} incorrect".format(n))