Exemplo n.º 1
0
def create_import_seed_task(import_task, app_state):
    cache = create_couchdb_cache(import_task.source, app_state)
    source = create_source(import_task.source, app_state)
    grid = DEFAULT_GRID

    watermark_text = app_state.config.get('watermark', 'text')
    if app_state.config.has_option('user', 'name'):
        watermark_text += ' ' + app_state.config.get('user', 'name')

    tile_filter = watermark_filter(watermark_text, opacity=100, font_size=11,
                                spacing=None, font_color=(200, 200, 200))
    image_opts = image_options(import_task.source)
    tile_mgr = create_tile_manager(format=import_task.source.format,
        image_opts=image_opts, cache=cache, sources=[source],
        grid=grid, tile_filter=tile_filter)
    coverage = coverage_from_geojson(import_task.coverage)

    coverage = coverage_intersection(coverage, source.coverage)

    levels = range(import_task.zoom_level_start,
        import_task.zoom_level_end + 1)

    return create_seed_task(tile_mgr, coverage, levels,
        update_tiles=import_task.update_tiles)
Exemplo n.º 2
0
 def setup(self):
     self.tile = Tile((0, 0, 0))
     self.filter = watermark_filter('Test')
Exemplo n.º 3
0
 def setup(self):
     self.tile = Tile((0, 0, 0))
     self.filter = watermark_filter('Test')