本文整理汇总了Python中mapproxy.grid.TileGrid.get_affected_level_tiles方法的典型用法代码示例。如果您正苦于以下问题:Python TileGrid.get_affected_level_tiles方法的具体用法?Python TileGrid.get_affected_level_tiles怎么用?Python TileGrid.get_affected_level_tiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapproxy.grid.TileGrid
的用法示例。
在下文中一共展示了TileGrid.get_affected_level_tiles方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestWGS84TileGrid
# 需要导入模块: from mapproxy.grid import TileGrid [as 别名]
# 或者: from mapproxy.grid.TileGrid import get_affected_level_tiles [as 别名]
class TestWGS84TileGrid(object):
def setup(self):
self.grid = TileGrid(is_geodetic=True)
def test_resolution(self):
assert_almost_equal(self.grid.resolution(0), 1.40625)
assert_almost_equal(self.grid.resolution(1), 1.40625/2)
def test_bbox(self):
eq_(self.grid.bbox, (-180.0, -90.0, 180.0, 90.0))
def test_grid_size(self):
eq_(self.grid.grid_sizes[0], (1, 1))
eq_(self.grid.grid_sizes[1], (2, 1))
eq_(self.grid.grid_sizes[2], (4, 2))
def test_affected_tiles(self):
bbox, grid, tiles = self.grid.get_affected_tiles((-180,-90,180,90), (512,256))
eq_(bbox, (-180.0, -90.0, 180.0, 90.0))
eq_(grid, (2, 1))
eq_(list(tiles), [(0, 0, 1), (1, 0, 1)])
def test_affected_level_tiles(self):
bbox, grid, tiles = self.grid.get_affected_level_tiles((-180,-90,180,90), 1)
eq_(grid, (2, 1))
eq_(bbox, (-180.0, -90.0, 180.0, 90.0))
eq_(list(tiles), [(0, 0, 1), (1, 0, 1)])
bbox, grid, tiles = self.grid.get_affected_level_tiles((0,0,180,90), 2)
eq_(grid, (2, 1))
eq_(bbox, (0.0, 0.0, 180.0, 90.0))
eq_(list(tiles), [(2, 1, 2), (3, 1, 2)])
示例2: TestWGS83TileGridUL
# 需要导入模块: from mapproxy.grid import TileGrid [as 别名]
# 或者: from mapproxy.grid.TileGrid import get_affected_level_tiles [as 别名]
class TestWGS83TileGridUL(object):
def setup(self):
self.grid = TileGrid(4326, bbox=(-180, -90, 180, 90), origin='ul')
def test_resolution(self):
assert_almost_equal(self.grid.resolution(0), 1.40625)
assert_almost_equal(self.grid.resolution(1), 1.40625/2)
def test_bbox(self):
eq_(self.grid.bbox, (-180.0, -90.0, 180.0, 90.0))
def test_tile_bbox(self):
eq_(self.grid.tile_bbox((0, 0, 0)), (-180.0, -270.0, 180.0, 90.0))
eq_(self.grid.tile_bbox((0, 0, 0), limit=True), (-180.0, -90.0, 180.0, 90.0))
eq_(self.grid.tile_bbox((0, 0, 1)), (-180.0, -90.0, 0.0, 90.0))
def test_tile(self):
eq_(self.grid.tile(-170, -80, 0), (0, 0, 0))
eq_(self.grid.tile(-170, -80, 1), (0, 0, 1))
eq_(self.grid.tile(-170, -80, 2), (0, 1, 2))
def test_grid_size(self):
eq_(self.grid.grid_sizes[0], (1, 1))
eq_(self.grid.grid_sizes[1], (2, 1))
eq_(self.grid.grid_sizes[2], (4, 2))
def test_affected_tiles(self):
bbox, grid, tiles = self.grid.get_affected_tiles((-180,-90,180,90), (512,256))
eq_(bbox, (-180.0, -90.0, 180.0, 90.0))
eq_(grid, (2, 1))
eq_(list(tiles), [(0, 0, 1), (1, 0, 1)])
bbox, grid, tiles = self.grid.get_affected_tiles((-180,-90,0,90), (512, 512))
eq_(bbox, (-180.0, -90.0, 0.0, 90.0))
eq_(grid, (2, 2))
eq_(list(tiles), [(0, 0, 2), (1, 0, 2), (0, 1, 2), (1, 1, 2)])
def test_affected_level_tiles(self):
bbox, grid, tiles = self.grid.get_affected_level_tiles((-180,-90,180,90), 1)
eq_(grid, (2, 1))
eq_(bbox, (-180.0, -90.0, 180.0, 90.0))
eq_(list(tiles), [(0, 0, 1), (1, 0, 1)])
bbox, grid, tiles = self.grid.get_affected_level_tiles((0,0,180,90), 2)
eq_(grid, (2, 1))
eq_(list(tiles), [(2, 0, 2), (3, 0, 2)])
eq_(bbox, (0.0, 0.0, 180.0, 90.0))
bbox, grid, tiles = self.grid.get_affected_level_tiles((0,-90,180,90), 2)
eq_(grid, (2, 2))
eq_(list(tiles), [(2, 0, 2), (3, 0, 2), (2, 1, 2), (3, 1, 2)])
eq_(bbox, (0.0, -90.0, 180.0, 90.0))