コード例 #1
0
 def testCreateColorReliefRenderNode(self):
     pyramid = Pyramid()
     metadata = Metadata.make_metadata('test-colorrelief')
     cache = create_tilestorage('metacache',
                                pyramid=pyramid,
                                metadata=metadata,
                                root='./output/test_render_node_factory/')
     render_node = create_render_node('node.colorrelief',
                                      'test',
                                      cache=cache,
                                      color_context=''
                                      )
     self.assertEqual(repr(render_node), "ColorReliefRenderNode('test')")
コード例 #2
0
 def testCreateImageMagicRenderNode(self):
     pyramid = Pyramid()
     metadata = Metadata.make_metadata('test-imagemagic')
     cache = create_tilestorage('metacache',
                                pyramid=pyramid,
                                metadata=metadata,
                                root='./output/test_render_node_factory/')
     render_node = create_render_node('node.imagemagick',
                                      'test',
                                      format='PNG',
                                      command='',
                                      cache=cache,
                                      )
     self.assertEqual(repr(render_node), "ImageMagicRenderNode('test')")
コード例 #3
0
    def testCreateRasterRenderNode(self):
        pyramid = Pyramid()
        metadata = Metadata.make_metadata('test-raster')
        cache = create_tilestorage('metacache',
                                   pyramid=pyramid,
                                   metadata=metadata,
                                   root='./output/test_render_node_factory/')

        dataset_cfg = dict(dataset_path='./input/hailey.tif')
        render_node = create_render_node('node.raster',
                                         'test',
                                         cache=cache,
                                         **dataset_cfg
                                         )
        self.assertEqual(repr(render_node), "RasterRenderNode('test')")
コード例 #4
0
    def testCreateMapnikRenderNode(self):
        pyramid = Pyramid()
        metadata = Metadata.make_metadata('test-mapnik')
        cache = create_tilestorage('metacache',
                                   pyramid=pyramid,
                                   metadata=metadata,
                                   root='./output/test_render_node_factory/')

        mapnik_cfg = dict(theme='./input/world.xml', image_type='png')
        render_node = create_render_node('node.mapnik',
                                         'test',
                                         cache=cache,
                                         **mapnik_cfg
                                         )
        self.assertEqual(repr(render_node), "MapnikRenderNode('test')")
コード例 #5
0
    def testCreateStorageRenderNode(self):
        pyramid = Pyramid()
        metadata = Metadata.make_metadata('test-storage')
        cache = create_tilestorage('metacache',
                                   pyramid=pyramid,
                                   metadata=metadata,
                                   root='./output/test_render_node_factory/')

        storage_cfg = dict(prototype='filesystem',
                           root='./output/test_render_node_factory/')
        render_node = create_render_node('node.storage',
                                         'test',
                                         cache=cache,
                                         storage_cfg=storage_cfg
                                         )
        self.assertEqual(repr(render_node), "StorageRenderNode('test')")
コード例 #6
0
 def testCreateHillShadingRenderNode(self):
     pyramid = Pyramid()
     metadata = Metadata.make_metadata('test-hillshading')
     cache = create_tilestorage('metacache',
                                pyramid=pyramid,
                                metadata=metadata,
                                root='./output/test_render_node_factory/')
     render_node = create_render_node('node.hillshading',
                                      'test',
                                      cache=cache,
                                      zfactor=1,
                                      scale=111120,
                                      altitude=45,
                                      azimuth=315
                                      )
     self.assertEqual(repr(render_node), "HillShadingRenderNode('test')")
コード例 #7
0
ファイル: test_renderer_node.py プロジェクト: Kotaimen/mason
    def setUp(self):
        pyramid = Pyramid(levels=range(21), format=Format.DATA)
        metadata = Metadata.make_metadata(
                            tag='StorageRender',
                            version='1.0.0')
        self._output_dir = os.path.join('output',
                                       'StorageRender')

        if os.path.exists(self._output_dir):
            shutil.rmtree(self._output_dir, ignore_errors=True)

        self._storage = create_tilestorage('filesystem',
                               pyramid,
                               metadata,
                               root=self._output_dir,
                               compress=False,
                               simple=False,)

        metatile_index = create_metatile_index(15, 5928, 11962, 2)
        metatile = MetaTile.from_tile_index(metatile_index, b'test')
        self._storage.put(metatile)

        self._context = MetaTileContext(metatile_index)