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


Python TileMerger.merge方法代码示例

本文整理汇总了Python中mapproxy.image.tile.TileMerger.merge方法的典型用法代码示例。如果您正苦于以下问题:Python TileMerger.merge方法的具体用法?Python TileMerger.merge怎么用?Python TileMerger.merge使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mapproxy.image.tile.TileMerger的用法示例。


在下文中一共展示了TileMerger.merge方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_none_merge

# 需要导入模块: from mapproxy.image.tile import TileMerger [as 别名]
# 或者: from mapproxy.image.tile.TileMerger import merge [as 别名]
 def test_none_merge(self):
     tiles = [None]
     m = TileMerger(tile_grid=(1, 1), tile_size=(100, 100))
     img_opts = ImageOptions(mode='RGBA', bgcolor=(200, 100, 30, 40))
     result = m.merge(tiles, img_opts)
     img = result.as_image()
     eq_(img.size, (100, 100))
     eq_(img.getcolors(), [(100*100, (200, 100, 30, 40))])
开发者ID:atrawog,项目名称:mapproxy,代码行数:10,代码来源:test_image.py

示例2: test_full_merge

# 需要导入模块: from mapproxy.image.tile import TileMerger [as 别名]
# 或者: from mapproxy.image.tile.TileMerger import merge [as 别名]
 def test_full_merge(self):
     self.cleanup_tiles = [create_tmp_image_file((100, 100)) for _ in range(9)]
     self.tiles = [ImageSource(tile) for tile in self.cleanup_tiles]
     m = TileMerger(tile_grid=(3, 3), tile_size=(100, 100))
     img_opts = ImageOptions()
     result = m.merge(self.tiles, img_opts)
     img = result.as_image()
     eq_(img.size, (300, 300))
开发者ID:atrawog,项目名称:mapproxy,代码行数:10,代码来源:test_image.py

示例3: test_one

# 需要导入模块: from mapproxy.image.tile import TileMerger [as 别名]
# 或者: from mapproxy.image.tile.TileMerger import merge [as 别名]
 def test_one(self):
     self.cleanup_tiles = [create_tmp_image_file((100, 100))]
     self.tiles = [ImageSource(self.cleanup_tiles[0])]
     m = TileMerger(tile_grid=(1, 1), tile_size=(100, 100))
     img_opts = ImageOptions(transparent=True)
     result = m.merge(self.tiles, img_opts)
     img = result.as_image()
     eq_(img.size, (100, 100))
     eq_(img.mode, 'RGBA')
开发者ID:atrawog,项目名称:mapproxy,代码行数:11,代码来源:test_image.py

示例4: test_missing_tiles

# 需要导入模块: from mapproxy.image.tile import TileMerger [as 别名]
# 或者: from mapproxy.image.tile.TileMerger import merge [as 别名]
 def test_missing_tiles(self):
     self.cleanup_tiles = [create_tmp_image_file((100, 100))]
     self.tiles = [ImageSource(self.cleanup_tiles[0])]
     self.tiles.extend([None]*8)
     m = TileMerger(tile_grid=(3, 3), tile_size=(100, 100))
     img_opts = ImageOptions()
     result = m.merge(self.tiles, img_opts)
     img = result.as_image()
     eq_(img.size, (300, 300))
     eq_(img.getcolors(), [(80000, (255, 255, 255)), (10000, (0, 0, 0)), ])
开发者ID:atrawog,项目名称:mapproxy,代码行数:12,代码来源:test_image.py

示例5: test_invalid_tile

# 需要导入模块: from mapproxy.image.tile import TileMerger [as 别名]
# 或者: from mapproxy.image.tile.TileMerger import merge [as 别名]
 def test_invalid_tile(self):
     self.cleanup_tiles = [create_tmp_image_file((100, 100)) for _ in range(9)]
     self.tiles = [ImageSource(tile) for tile in self.cleanup_tiles]
     invalid_tile = self.tiles[0].source
     with open(invalid_tile, 'w') as tmp:
         tmp.write('invalid')
     m = TileMerger(tile_grid=(3, 3), tile_size=(100, 100))
     img_opts = ImageOptions(bgcolor=(200, 0, 50))
     result = m.merge(self.tiles, img_opts)
     img = result.as_image()
     eq_(img.size, (300, 300))
     eq_(img.getcolors(), [(10000, (200, 0, 50)), (80000, (0, 0, 0))])
     assert not os.path.isfile(invalid_tile)
开发者ID:atrawog,项目名称:mapproxy,代码行数:15,代码来源:test_image.py


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