当前位置: 首页>>代码示例>>Python>>正文


Python TileGrid.stretch_factor方法代码示例

本文整理汇总了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)
开发者ID:LKajan,项目名称:mapproxy,代码行数:11,代码来源:test_grid.py

示例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)
开发者ID:deleted,项目名称:mapproxy,代码行数:22,代码来源:test_grid.py

示例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)
开发者ID:deleted,项目名称:mapproxy,代码行数:22,代码来源:test_grid.py


注:本文中的mapproxy.grid.TileGrid.stretch_factor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。