Features
In this tile provider, the tiles in Mapbox Vector Tiles format are derived from a Feature Provider. Additionally, raster tiles in PNG format can be derived from the vector tiles using xtratiler.
Configuration
Name | Default | Description | Type | Since |
---|---|---|---|---|
id | Unique identifier of the entity, has to match the filename. Allowed characters are (A-Z, a-z), numbers (0-9), underscore and hyphen. | string | v2.0 | |
enabled | true | Option to disable the entity, which means it will not be available to other entities and background tasks will not be running. | boolean | v2.0 |
providerType | Always TILE . | string | v2.0 | |
providerSubType | Always FEATURES . | string | v2.0 | |
auto | false | Option to generate missing definitions automatically from the data source. | boolean | v2.0 |
tilesetDefaults | Defaults for all tilesets , see Tileset Defaults. | object | v3.4 | |
tilesets | {} | Definition of tilesets, see Tileset. | object | v3.4 |
rasterTilesets | {} | Definition of raster tilesets, see Raster Tileset. | object | v4.1 |
caches | [] | List of cache definitions, see Cache. | array | v3.4 |
seeding | {} | Controls how and when tiles are precomputed, see Seeding. | object | v3.4 |
Tileset Defaults
Defaults that are applied to each Tileset.
Name | Default | Description | Type | Since |
---|---|---|---|---|
center | { lon: 0.0, lat: 0.0 } | Longitude and latitude that a map with the tiles should be centered on by default. | object | v3.4 |
featureLimit | 100000 | Maximum number of features contained in a single tile per query. | number | v3.4 |
minimumSizeInPixel | 0.5 | Features with line geometries shorter that the given value are excluded from tiles. Features with surface geometries smaller than the square of the given value are excluded from the tiles. The value 0.5 corresponds to half a "pixel" in the used coordinate reference system. | number | v3.4 |
ignoreInvalidGeometries | false | Ignore features with invalid geometries. Before ignoring a feature, an attempt is made to transform the geometry to a valid geometry. The topology of geometries might be invalid in the data source or in some cases the quantization of coordinates to integers might render it invalid. | boolean | v3.4 |
transformations | {} | Transform the selected features for a certain zoom level. Supported transformations are: selecting a subset of feature properties ( properties ), spatial merging of features that intersect (merge ), with the option to restrict the operations to features with matching attributes (groupBy ). See the example below. For merge , the resulting object will only obtain properties that are identical for all merged features. | object | v3.4 |
featureProvider | null | The id of the feature provider. By default the tile provider id without -tiles is used. | string | v3.4 |
levels | { "WebMercatorQuad" : { "min": 0, "max": 23 } } | Controls the zoom levels available for each active tiling scheme as well as which zoom level to use as default. | object | v3.4 |
Tileset
All options from Tileset Defaults are also available and can be overriden here.
Name | Default | Description | Type | Since |
---|---|---|---|---|
id | The tileset id. | string | v3.4 | |
featureType | null | The name of the feature type. By default the tileset id is used. | string | v3.4 |
combine | [] | Instead of being generated using a featureType , a tileset may be composed of multiple other tilesets. Takes a list of tileset ids. A list with a single entry * combines all tilesets. | array | v3.4 |
filters | {} | Filters to select a subset of feature for certain zoom levels using a CQL filter expression, see example below. | object | v3.4 |
Raster Tileset
To generate raster tiles xtratiler is required. Raster tiles cannot be generated on-demand, so a seeded cache is required. Currently only DYNAMIC
caches are supported.
Name | Default | Description | Type | Since |
---|---|---|---|---|
styles | [] | List of MapLibre styles that raster tiles should be generated for. The entries are relative paths to values of type maplibre-styles in the store. | array | v4.1 |
Cache
There are two different cache types:
IMMUTABLE
An immutable cache can only be created through seeding. It will only be made available once it is complete. If some or all tiles are re-seeded, then again the new version will only be made available once it is complete. In the meantime the old version is still provided to consumers.
Therefore an immutable cache is always consistent and, once the initial seeding has completed, it guarantees uninterrupted operation.DYNAMIC
A dynamic cache can be computed through seeding, but it will also cache matching tiles that are requested by a consumer. Tiles will be made available as soon as they are computed. If some or all tiles are re-seeded, they are deleted first.
Therefore a dynamic cache might be inconsistent and may cause client errors during (re-)seeding.
In general the usage of immutable caches is recommended. For higher zoom levels a complementary non-seeded dynamic cache might make sense to reduce seeding time.
There are two different storage types:
PLAIN
Every tile is stored in a single file. This is recommended for remote storage (coming soon).MBTILES
Tiles are stored in a MBTiles file per tiling scheme. This is recommended for local storage.
Name | Default | Description | Type | Since |
---|---|---|---|---|
type | Either IMMUTABLE or DYNAMIC . | string | v3.4 | |
storage | Either PLAIN or MBTILES . | string | v3.4 | |
seeded | true | Should this cache be included by the Seeding? | boolean | v3.4 |
levels | {} | Tiling schemes and zoom levels that should be stored in the cache. Applies to all tilesets that are not specified in tilesetLevels . | object | v3.4 |
tilesetLevels | {} | Tiling schemes and zoom levels for single tilesets that should be stored in the cache. | object | v3.4 |
Seeding
Controls how and when caches are computed.
Name | Default | Description | Type | Since |
---|---|---|---|---|
runOnStartup | true | If disabled the seeding will not be run when the API starts. | boolean | v2.0 |
runPeriodic | null | A crontab pattern to run the seeding periodically. There will only ever be one seeding in progress, so if the next run is scheduled before the last one finished, it will be skipped. | string | v2.0 |
purge | false | If enabled the tile cache will be purged before the seeding starts. | boolean | v2.0 |
maxThreads | 1 | The maximum number of threads the seeding is allowed to use. The actual number of threads used depends on the number of available background task threads when the seeding is about to start. If you want to allow more than thread, first check if sufficient background task threads are configured. Take into account that the seeding for multiple APIs will compete for the available background task threads. | number | v2.0 |
jobSize | M | The maximum number of tiles in a seeding job (S=256, M=1024, L=16384, XL=65536). The tile seeding is split into multiple jobs to distribute the work across threads and nodes. | string | v2.0 |
Example
id: vineyards-tiles
providerType: TILE
providerSubType: FEATURES
caches:
- type: IMMUTABLE
storage: MBTILES
levels:
WebMercatorQuad:
min: 5
max: 12
- type: DYNAMIC
storage: MBTILES
seeded: false
levels:
WebMercatorQuad:
min: 13
max: 18
tilesetDefaults:
levels:
WebMercatorQuad:
min: 5
max: 18
tilesets:
__all__:
id: __all__
combine: ['*']
vineyards:
id: vineyards