本文整理汇总了Python中mapproxy.grid.MetaGrid._meta_bbox方法的典型用法代码示例。如果您正苦于以下问题:Python MetaGrid._meta_bbox方法的具体用法?Python MetaGrid._meta_bbox怎么用?Python MetaGrid._meta_bbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapproxy.grid.MetaGrid
的用法示例。
在下文中一共展示了MetaGrid._meta_bbox方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestMetaGridGeodetic
# 需要导入模块: from mapproxy.grid import MetaGrid [as 别名]
# 或者: from mapproxy.grid.MetaGrid import _meta_bbox [as 别名]
class TestMetaGridGeodetic(object):
def setup(self):
self.mgrid = MetaGrid(grid=tile_grid('EPSG:4326'), meta_size=(2, 2), meta_buffer=10)
def test_meta_bbox_level_0(self):
eq_(self.mgrid._meta_bbox((0, 0, 0)), ((-180, -90, 180, 90), (0, 0, 0, -128)))
eq_(self.mgrid._meta_bbox((0, 0, 0), limit_to_bbox=False),
((-194.0625, -104.0625, 194.0625, 284.0625), (10, 10, 10, 10)))
eq_(self.mgrid.meta_tile((0, 0, 0)).size, (256, 128))
def test_tiles_level_0(self):
meta_tile = self.mgrid.meta_tile((0, 0, 0))
eq_(meta_tile.size, (256, 128))
eq_(meta_tile.grid_size, (1, 1))
eq_(meta_tile.tile_patterns, [((0, 0, 0), (0, -128))])
def test_meta_bbox_level_1(self):
eq_(self.mgrid._meta_bbox((0, 0, 1)), ((-180, -90, 180, 90), (0, 0, 0, 0)))
eq_(self.mgrid._meta_bbox((0, 0, 1), limit_to_bbox=False),
((-187.03125, -97.03125, 187.03125, 97.03125), (10, 10, 10, 10)))
eq_(self.mgrid.meta_tile((0, 0, 1)).size, (512, 256))
def test_tiles_level_1(self):
eq_(list(self.mgrid.meta_tile((0, 0, 1)).tile_patterns),
[
((0, 0, 1), (0, 0)),
((1, 0, 1), (256, 0))
])
def test_tile_list_level_1(self):
eq_(list(self.mgrid.tile_list((0, 0, 1))),
[(0, 0, 1), (1, 0, 1)])
def test_meta_bbox_level_2(self):
eq_(self.mgrid._meta_bbox((0, 0, 2)), ((-180, -90, 3.515625, 90), (0, 0, 10, 0)))
eq_(self.mgrid._meta_bbox((0, 0, 2), limit_to_bbox=False),
((-183.515625, -93.515625, 3.515625, 93.515625), (10, 10, 10, 10)))
eq_(self.mgrid.meta_tile((0, 0, 2)).size, (522, 512))
eq_(self.mgrid._meta_bbox((2, 0, 2)), ((-3.515625, -90, 180, 90), (10, 0, 0, 0)))
meta_tile = self.mgrid.meta_tile((2, 0, 2))
eq_(meta_tile.size, (522, 512))
eq_(meta_tile.grid_size, (2, 2))
def test_tiles_level_2(self):
eq_(list(self.mgrid.meta_tile((0, 0, 2)).tile_patterns),
[
((0, 1, 2), (0, 0)),
((1, 1, 2), (256, 0)),
((0, 0, 2), (0, 256)),
((1, 0, 2), (256, 256)),
])
eq_(list(self.mgrid.meta_tile((2, 0, 2)).tile_patterns),
[
((2, 1, 2), (10, 0)),
((3, 1, 2), (266, 0)),
((2, 0, 2), (10, 256)),
((3, 0, 2), (266, 256)),
])
def test_tile_list_level_2(self):
eq_(list(self.mgrid.tile_list((0, 0, 2))),
[(0, 1, 2), (1, 1, 2), (0, 0, 2), (1, 0, 2)])
eq_(list(self.mgrid.tile_list((1, 1, 2))),
[(0, 1, 2), (1, 1, 2), (0, 0, 2), (1, 0, 2)])
def test_tiles_level_3(self):
eq_(list(self.mgrid.meta_tile((2, 0, 3)).tile_patterns),
[
((2, 1, 3), (10, 10)),
((3, 1, 3), (266, 10)),
((2, 0, 3), (10, 266)),
((3, 0, 3), (266, 266)),
])
eq_(list(self.mgrid.meta_tile((2, 2, 3)).tile_patterns),
[
((2, 3, 3), (10, 0)),
((3, 3, 3), (266, 0)),
((2, 2, 3), (10, 256)),
((3, 2, 3), (266, 256)),
])