From 21a25592d2cd52eda263dc6d268efe2091720774 Mon Sep 17 00:00:00 2001 From: Miko Date: Sun, 13 Oct 2024 22:46:00 +0200 Subject: [PATCH] add documentation for elevation api --- docs/config.rst | 6 ++++++ docs/endpoints.rst | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/config.rst b/docs/config.rst index d556dfa..709a125 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -258,6 +258,10 @@ For example:: "source1": { "url": "mbtiles://source1.mbtiles", "type": "vector" + }, + "terrain": { + "url": "mbtiles://terrain.mbtiles", + "encoding": "mapbox" } } @@ -265,6 +269,8 @@ 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. 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 ------- diff --git a/docs/endpoints.rst b/docs/endpoints.rst index 93230a6..12f1acf 100644 --- a/docs/endpoints.rst +++ b/docs/endpoints.rst @@ -100,6 +100,14 @@ Source data * TileJSON at ``/data/{id}.json`` + * If terrain mbtile data is served and ``encoding`` is configured (see config) the elevation can be queried + + * by ``/data/{id}/elevation/{z}/{x}/{y}`` for the tile + + * or ``/data/{id}/elevation/{z}/{long}/{lat}`` for the coordinate + + * the result will be a json object like ``{"z":7,"x":68,"y":45,"red":134,"green":66,"blue":0,"latitude":11.84069,"longitude":46.04798,"elevation":1602}`` + Static files =========== * Static files are served at ``/files/{filename}``