本文整理汇总了Python中mapproxy.grid.MetaGrid.minimal_meta_tile方法的典型用法代码示例。如果您正苦于以下问题:Python MetaGrid.minimal_meta_tile方法的具体用法?Python MetaGrid.minimal_meta_tile怎么用?Python MetaGrid.minimal_meta_tile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapproxy.grid.MetaGrid
的用法示例。
在下文中一共展示了MetaGrid.minimal_meta_tile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestMinimalMetaTile
# 需要导入模块: from mapproxy.grid import MetaGrid [as 别名]
# 或者: from mapproxy.grid.MetaGrid import minimal_meta_tile [as 别名]
class TestMinimalMetaTile(object):
def setup(self):
self.mgrid = MetaGrid(grid=tile_grid('EPSG:4326'), meta_size=(2, 2), meta_buffer=10)
def test_minimal_tiles(self):
sgrid = self.mgrid.minimal_meta_tile([(0, 0, 2), (1, 0, 2)])
eq_(sgrid.grid_size, (2, 1))
eq_(list(sgrid.tile_patterns),
[
((0, 0, 2), (0, 10)),
((1, 0, 2), (256, 10)),
]
)
eq_(sgrid.bbox, (-180.0, -90.0, 3.515625, 3.515625))
def test_minimal_tiles_fragmented(self):
sgrid = self.mgrid.minimal_meta_tile(
[
(2, 3, 3),
(1, 2, 3),
(2, 1, 3),
])
eq_(sgrid.grid_size, (2, 3))
eq_(list(sgrid.tile_patterns),
[
((1, 3, 3), (10, 0)), ((2, 3, 3), (266, 0)),
((1, 2, 3), (10, 256)), ((2, 2, 3), (266, 256)),
((1, 1, 3), (10, 512)), ((2, 1, 3), (266, 512)),
]
)
eq_(sgrid.bbox, (-136.7578125, -46.7578125, -43.2421875, 90.0))
def test_minimal_tiles_fragmented_ul(self):
self.mgrid = MetaGrid(grid=tile_grid('EPSG:4326', origin='ul'),
meta_size=(2, 2), meta_buffer=10)
sgrid = self.mgrid.minimal_meta_tile(
[
(2, 0, 3),
(1, 1, 3),
(2, 2, 3),
])
eq_(sgrid.grid_size, (2, 3))
eq_(list(sgrid.tile_patterns),
[
((1, 0, 3), (10, 0)), ((2, 0, 3), (266, 0)),
((1, 1, 3), (10, 256)), ((2, 1, 3), (266, 256)),
((1, 2, 3), (10, 512)), ((2, 2, 3), (266, 512)),
]
)
eq_(sgrid.bbox, (-136.7578125, -46.7578125, -43.2421875, 90.0))