How to use the tilecloud.store.url.URLTileStore function in tilecloud

To help you get started, we’ve selected a few tilecloud examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github camptocamp / tilecloud-chain / tilecloud_chain / generate.py View on Github external
def _get_tilestore_for_layer(self, layer):
        if layer['type'] == 'wms':
            params = layer['params'].copy()
            if 'STYLES' not in params:
                params['STYLES'] = ','.join(layer['wmts_style'] for l in layer['layers'].split(','))
            if layer['generate_salt']:
                params['SALT'] = str(random.randint(0, 999999))

            # Get the metatile image from the WMS server
            return URLTileStore(
                tilelayouts=(WMSTileLayout(
                    url=layer['url'],
                    layers=layer['layers'],
                    srs=layer['grid_ref']['srs'],
                    format=layer['mime_type'],
                    border=layer['meta_buffer'] if layer.get('meta', False) else 0,
                    tilegrid=self._gene.get_grid(layer)['obj'],
                    params=params,
                ),),
                headers=layer['headers'],
            )
        elif layer['type'] == 'mapnik':  # pragma: no cover
            try:
                from tilecloud.store.mapnik_ import MapnikTileStore
                from tilecloud_chain.mapnik_ import MapnikDropActionTileStore
            except ImportError:
github camptocamp / tilecloud / tiles / mapquest_com.py View on Github external
from tilecloud.layout.template import TemplateTileLayout
from tilecloud.store.url import URLTileStore


tilestore = URLTileStore(
    (
        TemplateTileLayout("http://otile{0:d}.mqcdn.com/tiles/1.0.0/osm/%(z)d/%(x)d/%(y)d.png".format(i))
        for i in range(1, 5)
    ),
    attribution='Data, imagery and map information provided by MapQuest, <a href="http://www.openstreetmap.org/">Open Street Map</a> and contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>.',
    content_type="image/png",
)
github camptocamp / tilecloud / tiles / openstreetmap_org.py View on Github external
from tilecloud.layout.template import TemplateTileLayout
from tilecloud.store.url import URLTileStore


tilestore = URLTileStore(
    (
        TemplateTileLayout("http://{0!s}.tile.openstreetmap.org/%(z)d/%(x)d/%(y)d.png".format(server))
        for server in "abc"
    ),
    attribution="&copy; OpenStreetMap contributors, CC-BY-SA",
    content_type="image/png",
)
github camptocamp / tilecloud / tiles / stamen_com / toner.py View on Github external
from tilecloud.layout.template import TemplateTileLayout
from tilecloud.store.url import URLTileStore


tilestore = URLTileStore(
    (
        TemplateTileLayout("http://{0!s}.tile.stamen.com/toner/%(z)d/%(x)d/%(y)d.png".format(server))
        for server in "abcd"
    ),
    attribution='Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',
    content_type="image/png",
)
github camptocamp / tilecloud / tiles / stamen_com / watercolor.py View on Github external
from tilecloud.layout.template import TemplateTileLayout
from tilecloud.store.url import URLTileStore


tilestore = URLTileStore(
    (
        TemplateTileLayout("http://{0!s}.tile.stamen.com/watercolor/%(z)d/%(x)d/%(y)d.jpg".format(server))
        for server in "abcd"
    ),
    attribution='Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',
    content_type="image/jpg",
)
github camptocamp / tilecloud / tilecloud / store / wmts.py View on Github external
from tilecloud.store.url import URLTileStore
from tilecloud.layout.wmts import WMTSTileLayout


class WMTSTileStore(URLTileStore):
    def __init__(
        self, url=None, layer=None, style=None, format=None, tile_matrix_set=None, tile_matrix=None, **kwargs
    ):
        layout = WMTSTileLayout(url, layer, style, format, tile_matrix_set, tile_matrix)
        URLTileStore.__init__(self, (layout,), **kwargs)
github camptocamp / tilecloud / tilecloud / store / wmts.py View on Github external
def __init__(
        self, url=None, layer=None, style=None, format=None, tile_matrix_set=None, tile_matrix=None, **kwargs
    ):
        layout = WMTSTileLayout(url, layer, style, format, tile_matrix_set, tile_matrix)
        URLTileStore.__init__(self, (layout,), **kwargs)
github camptocamp / tilecloud / tiles / stamen_com / terrain.py View on Github external
from tilecloud.layout.template import TemplateTileLayout
from tilecloud.store.url import URLTileStore


tilestore = URLTileStore(
    (
        TemplateTileLayout("http://{0!s}.tile.stamen.com/terrain/%(z)d/%(x)d/%(y)d.jpg".format(server))
        for server in "abcd"
    ),
    attribution='Map tiles by <a href="http://stamen.com">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org">OpenStreetMap</a>, under <a href="http://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>.',
    content_type="image/jpg",
)