kartotherian/core

Name: core

Owner: kartotherian

Description: The core components of the Kartotherian maps tile service

Created: 2015-08-04 14:48:01.0

Updated: 2018-05-03 18:05:02.0

Pushed: 2018-05-03 18:05:01.0

Homepage: null

Size: 199

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

@kartotherian/core

The core components of the Kartotherian maps tile service

Sources

Sources is a way to set up data processing pipelines for Kartotherian and Tilerator. Any source based on tilelive.js specification may be used. Source configuration could be located in standalone files, or be embedded in the main configuration file, or a mix of both. The sources value in the config file could be a string (file), an object defining the source, or an array of strings and objects.

uri is the only mandatory field, and it specifies how tilelive.js will locate and initialize the new source. The protocol determines which tile provider will be used.

Since sometimes not everything can be added as query parameters to the URI, there is a set of additional keys to help. Values can either be hardcoded as strings/numbers/booleans, or can be calculated on the fly.

A simple source configuration to set up a tile storage as files in the ./vectors dir:

store:
uri: file://./vectors

The path can also be set via a parameter:

store:
uri: file://
pathname: ./vectors

The value does not have to be given in the source, but instead could be dynamically generated. For example, the env uses an environment variable, and the var generator pulls the value from the variable store. The variables are defined in a separate file(s), similar to sources.

store:
uri: file://
pathname: {env: KARTOTHERIAN_PATH}  # Uses an environment variable
  # or
pathname: {var: tilepath}  # Uses a variable named tilepath

More parameters can be set using params - a set of additional values to be set in URI:


"overzoom:" is a tile source that will attempt to get a tile from another source,
and if tile is missing, attempt to get a portion of the lower-zoom tile.
i: overzoom://
Specify the tile source - this adds a properly escaped query parameter
  ?source=sourceref:///?ref=gen
ram:
source: {ref: gen}
Value substitutions

In general, these value substitutions are available:

XML-based sources

The xml parameter is used to load and alter XML for some sources like tilelive-bridge (SQL?VectorTile or TIFF?RasterTile) and tilelive-vector (Style VectorTile ? PNG). The xml field must evaluate to the xml file path.

                # The name of the source (could be referenced later)
i: bridge://    # Required - the URI used to construct the source
l:              # Init source with this xml instead of the URI's other parameters
# Set xml to the location of the 'data.xml', which is located inside the osm-bright-source npm
npmpath: ["osm-bright-source", "data.xml"]
lSetDataSource: # Before loading, update the datasource section of the standard mapnik config file
if:             # Only update datasources that match all these values (logical AND)
  dbname: gis   # Instead of 'gis', you can use {npmpath:...}, {ref:..}, and {var:...}
  host: ''
  type: postgis
set:            # Replace these keys with the new values
  host: localhost
  user: {var: osmdb-user}  # Instead of hardcoding, use the value from the variables file or conf section
  password: {var: osmdb-pswd}

Instead of an object, xmlSetDataSource can be set to an array of objects to provide multple change sets.

Kartotherian-specific parameters:

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.