def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='TestMemcachedTileStorage')

        self.storage = factory('memcache',
                               self.pyramid,
                               self.metadata)
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='TestCascadeTileStorage')
        self.output_dir = os.path.join('output', 'TestCascadeTileStorage')

        self.storage = factory('cascade',
                               self.pyramid,
                               self.metadata,
                               violate=['memcache', {'servers': ['localhost:11211', ]}],
                               presistent=['filesystem', {'root': self.output_dir}],
                               )
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)

        self.metadata = Metadata.make_metadata(tag='TestMBTilesTileStorageBackgroundWriter',)
        filename = './output/TestMBTilesTileStorageBackgroundWriter.db'
        if os.path.exists(filename):
            os.unlink(filename)
        self.storage = factory('mbtilesbw',
                               self.pyramid,
                               self.metadata,
                               database=filename)
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='S3StorageTest')
        self.storage = factory('s3',
                               self.pyramid,
                               self.metadata,
                               access_key=None,
                               secret_key=None,
                               bucket_name='tilestorage',
                               simple=False,
#                               tag_name='foobar'
                               )
 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')")
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='TestMetaTileCache',
                                               version='1.0.0.0.0.0')
        self.output_dir = os.path.join('output', 'TestMetaTileCache')

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

        self.storage = factory('metacache',
                               self.pyramid,
                               self.metadata,
                               root=self.output_dir,
                               )
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)

        self.metadata = Metadata.make_metadata(tag='TestMBTilesTileStorage',
                                               version='1',
                                               attribution='foo')

        filename = './output/TestMBTilesTileStorage.db'
        if os.path.exists(filename):
            os.unlink(filename)
        self.storage = factory('mbtiles',
                               self.pyramid,
                               self.metadata,
                               database=filename)
 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')")
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='TestFileSystemTileStorageDefault',
                                               version='1.0.0.0.0.0')
        self.output_dir = os.path.join('output', 'TestFileSystemTileStorageDefault')

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

        self.storage = factory('filesystem',
                               self.pyramid,
                               self.metadata,
                               root=self.output_dir,
                               compress=False,
                               simple=False,)
    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')")
    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')")
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='S3ClusterStorageTest',
                                               version='2.0')

        self.storage = factory('s3cluster',
                               self.pyramid,
                               self.metadata,
                               stride=2,
                               servers=['localhost:11211'],
                               timeout=0,
                               access_key=None,
                               secret_key=None,
                               bucket_name='tilestorage',
                               compress=True,
                               )
    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')")
 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')")
    def setUp(self):
        self.pyramid = Pyramid(levels=range(21), format=Format.DATA)
        self.metadata = Metadata.make_metadata(tag='TestClusterStorage',
                                               version='1.0.0.0.0.0')
        self.output_dir = os.path.join('output', 'TestClusterStorage')

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

        self.storage = factory('cluster',
                               self.pyramid,
                               self.metadata,
                               stride=2,
                               servers=['localhost:11211'],
                               timeout=0,
                               root=self.output_dir,
                               compress=False,)
Exemple #16
0
    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)