update readme for encoding option

This commit is contained in:
Miko 2024-12-25 21:49:48 +01:00
parent 49fa9e17a1
commit 56eb29518e

View file

@ -238,9 +238,26 @@ For example::
} }
} }
The data source does not need to be specified here unless you explicitly want to serve the raw data. The data source does not need to be specified here unless you explicitly want to serve the raw data.
Serving Terrain Tiles
--------------
If you serve terrain tiles, it is possible to configure an ``encoding`` with ``mapbox`` or ``terrarium`` to enable a terrain preview mode and the ``elevation`` api for the ``data`` endpoint.
For example::
"data": {
"terrain1": {
"mbtiles": "terrain1.mbtiles",
"encoding": "mapbox"
},
"terrain2": {
"pmtiles": "terrain2.pmtiles"
"encoding": "terrarium"
}
}
Referencing local files from style JSON Referencing local files from style JSON
======================================= =======================================
@ -258,10 +275,6 @@ For example::
"source1": { "source1": {
"url": "mbtiles://source1.mbtiles", "url": "mbtiles://source1.mbtiles",
"type": "vector" "type": "vector"
},
"terrain": {
"url": "mbtiles://terrain.mbtiles",
"encoding": "mapbox"
} }
} }
@ -269,8 +282,6 @@ Alternatively, you can use ``mbtiles://{source1}`` to reference existing data ob
In this case, the server will look into the ``config.json`` to determine what file to use by data id. In this case, the server will look into the ``config.json`` to determine what file to use by data id.
For the config above, this is equivalent to ``mbtiles://source1.mbtiles``. For the config above, this is equivalent to ``mbtiles://source1.mbtiles``.
If you use terrain tiles, it is possible to configure an ``encoding`` with ``mapbox`` or ``terrarium`` to enable a terrain preview mode and the ``elevation`` api for the ``data`` endpoint.
PMTiles PMTiles
------- -------
@ -289,7 +300,7 @@ For example::
"source3": { "source3": {
"url": "pmtiles://https://foo.lan/source3.pmtiles", "url": "pmtiles://https://foo.lan/source3.pmtiles",
"type": "vector" "type": "vector"
}, }
} }
Alternatively, you can use ``pmtiles://{source2}`` to reference existing data object from the config. Alternatively, you can use ``pmtiles://{source2}`` to reference existing data object from the config.