本文整理汇总了Python中mapproxy.grid.TileGrid.stretch_factor方法的典型用法代码示例。如果您正苦于以下问题:Python TileGrid.stretch_factor方法的具体用法?Python TileGrid.stretch_factor怎么用?Python TileGrid.stretch_factor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapproxy.grid.TileGrid
的用法示例。
在下文中一共展示了TileGrid.stretch_factor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_above_first_res
# 需要导入模块: from mapproxy.grid import TileGrid [as 别名]
# 或者: from mapproxy.grid.TileGrid import stretch_factor [as 别名]
def test_above_first_res(self):
grid = TileGrid(res=[1000, 500, 250, 100, 50], threshold_res=[1100, 750])
grid.stretch_factor = 1.1
eq_(grid.closest_level(1200), 0)
eq_(grid.closest_level(1100), 0)
eq_(grid.closest_level(1000), 0)
eq_(grid.closest_level(800), 0)
eq_(grid.closest_level(750.1), 0)
eq_(grid.closest_level(750), 1)
示例2: test_upper_bound
# 需要导入模块: from mapproxy.grid import TileGrid [as 别名]
# 或者: from mapproxy.grid.TileGrid import stretch_factor [as 别名]
def test_upper_bound(self):
# thresholds near the next upper res value (within threshold)
grid = TileGrid(res=[1000, 500, 250, 100, 50], threshold_res=[495, 240])
grid.stretch_factor = 1.1
eq_(grid.closest_level(1100), 0)
# regular transition (w/stretchfactor)
eq_(grid.closest_level(950), 0)
eq_(grid.closest_level(800), 1)
eq_(grid.closest_level(500), 1)
# transition at threshold
eq_(grid.closest_level(496), 1)
eq_(grid.closest_level(495), 2)
eq_(grid.closest_level(250), 2)
# transition at threshold (within strechfactor)
eq_(grid.closest_level(241), 2)
eq_(grid.closest_level(240), 3)
eq_(grid.closest_level(100), 3)
# regular transition (w/stretchfactor)
eq_(grid.closest_level(92), 3)
eq_(grid.closest_level(90), 4)
示例3: test_lower_bound
# 需要导入模块: from mapproxy.grid import TileGrid [as 别名]
# 或者: from mapproxy.grid.TileGrid import stretch_factor [as 别名]
def test_lower_bound(self):
# thresholds near the next lower res value
grid = TileGrid(res=[1000, 500, 250, 100, 50], threshold_res=[300, 110])
grid.stretch_factor = 1.1
eq_(grid.closest_level(1100), 0)
# regular transition (w/stretchfactor)
eq_(grid.closest_level(950), 0)
eq_(grid.closest_level(800), 1)
eq_(grid.closest_level(500), 1)
# transition at threshold
eq_(grid.closest_level(301), 1)
eq_(grid.closest_level(300), 2)
eq_(grid.closest_level(250), 2)
# transition at threshold
eq_(grid.closest_level(111), 2)
eq_(grid.closest_level(110), 3)
eq_(grid.closest_level(100), 3)
# regular transition (w/stretchfactor)
eq_(grid.closest_level(92), 3)
eq_(grid.closest_level(90), 4)