.. _plugins-tscombine: tscombine ========= The *tscombine* plugin allows to load map tiles from mutitple tile stores depending on geografic location and zoom level. The plugin ships with the gempa package "mapprojections". A list of layers can be defined defining map sources for specific regions and zoom levels. *tscombine* will load tiles from the first tile store in the list that matches the request. The layer-specific module configuration parameters :confval:`layers.$name.type` and :confval:`layers.$name.location` define the map sources along with :confval:`layers.$name.levels`. The type parameter and the region definition (:confval:`layers.$name.regions` or :confval:`layers.$name.rects`) are optional. If the region definition is omitted, then the entire world is assumed. If type is omitted, then the default directory store defined in the global parameter :confval:`map.location` is assumed. When using maps from :cite:t:`mbtiles` or :cite:t:`osm` :cite:t:`osm-servers`, the plugin :ref:`plugins-mbtiles` must be made available. :ref:`plugins-mbtiles` is also made available with "mapprojections". Setup ----- #. Add the *mbtiles* and *tscombine* plugins to the list of plugins (global module configuration parameter), e.g., :file:`global.cfg`: .. code-block:: properties plugins = ${plugins}, mbtiles, tscombine #. Configure the map location and type (global module configuration parameters configurable in :program:`scconfig`), e.g., :file:`global.cfg`. Here, location defines a configuration file containing all layer parameters specific to *tscombine*: .. code-block:: properties map.location = @SYSTEMCONFIGDIR@/tilestore-combine.cfg map.type = combine #. Place the layer configurations in the file defined above, e.g., :file:`@SYSTEMCONFIGDIR@/tilestore-combine.cfg`: .. code-block:: properties layers = base, germany layers { base { # From level 0 until 6 levels = 0:6 type = mbtiles location = /home/data/maps/world-6/world-6.mbtiles } germany { # Bounding box of germany regions = +45.967+5.867+55.133+15.033 # From level 7 to level 16 levels = 7:19 type = osm location = https://tile.openstreetmap.org/%l/%c/%r.png } } .. note:: When using *type = osm*, then additional global parameters provided with the :ref:`mbtiles ` plugin should be considered, e.g., :confval:`map.osm.cacheDir` and :confval:`map.osm.cacheDuration`. They can be configured with :program:`scconfig`. Module Configuration -------------------- .. confval:: layers Type: *list:string* Define the layers to be activated. Each layer must be configured separately, see below. .. confval:: layers.$name.levels Type: *integer range* A zoom level range for this layer. The format is ``[min]:[max]`` which defines a range including both ``min`` and ``max``. .. confval:: layers.$name.type Type: *string* The type of the tile store to be used. This is related to :confval:`map.type`. If type is omitted (unset, not just empty), then the default |scname| tile store is being used which searches for files in a directory following a configured pattern. .. confval:: layers.$name.location Type: *string* The location of the tile store. This is related to :confval:`map.location`. .. confval:: layers.$name.regions Type: *list:string* A list of geographical regions this tile store should be used for. Each region is defined as [lat_dim]x[lon_dim]+lat0+lon0 or +lat0+lon0+lat1+lon1. lat_dim and lon_dim are the dimensions in the directions of latitude and longitude in unit of degree, lat1 and lon1 define the region origin. .. confval:: layers.$name.rects Type: *list:string* A list of index rects with respect to the minimum zoom level this tile store should be used for. Each rect is defined as [cols]x[rows]+col0+row0 or +col0+row0+col1+row1. The number of rows and columns of the minimum zoom level can be calculated as :math:`2^level`. The rect is defined with respect to this extent. If :confval:`layers.$name.regions` is defined, then this value is not being read.