Skip to content

Commit a1fe9d5

Browse files
committed
Added documentation for the MVTPostgresProvider class
1 parent 029316e commit a1fe9d5

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/source/data-publishing/ogcapi-tiles.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pygeoapi core tile providers are listed below, along with supported features.
2222
`MVT-elastic`_,✅,✅,✅,❌,❌,✅
2323
`MVT-proxy`_,❓,❓,❓,❓,❌,✅
2424
`WMTSFacade`_,✅,❌,✅,✅,✅,❌
25+
`MVT-postgres`_,✅,✅,✅,✅,❌,✅
2526

2627
Below are specific connection examples based on supported providers.
2728

@@ -130,6 +131,46 @@ Following code block shows how to configure pygeoapi to read Mapbox vector tiles
130131
name: pbf
131132
mimetype: application/vnd.mapbox-vector-tile
132133
134+
MVT-postgres
135+
^^^^^^^^^^^^
136+
137+
.. note::
138+
Requires Python packages sqlalchemy, geoalchemy2 and psycopg2-binary
139+
140+
Must have PostGIS installed with protobuf-c support.
141+
142+
.. note::
143+
Geometry must be using EPSG:4326
144+
145+
This provider gives support to serving tiles generated using `Postgres <https://www.postgresql.org/>`_ with `PostGIS <https://postgis.net/>`_.
146+
The tiles are rendered on-the-fly using `ST_AsMVT <https://postgis.net/docs/ST_AsMVT.html>`_ and related methods.
147+
148+
This code block shows how to configure pygeoapi to render Mapbox vector tiles from a PostGIS table.
149+
150+
.. code-block:: yaml
151+
152+
providers:
153+
- type: tile
154+
name: MVT-postgres
155+
data:
156+
host: 127.0.0.1
157+
port: 3010 # Default 5432 if not provided
158+
dbname: test
159+
user: postgres
160+
password: postgres
161+
search_path: [osm, public]
162+
id_field: osm_id
163+
table: hotosm_bdi_waterways
164+
geom_field: foo_geom
165+
options:
166+
zoom:
167+
min: 0
168+
max: 10
169+
format:
170+
name: pbf
171+
mimetype: application/vnd.mapbox-vector-tile
172+
173+
PostgreSQL-related connection options can also be added to `options`. Please refer to the :ref:`PostgreSQL OGC Features Provider<PostgreSQL>` documentation for more information.
133174

134175
WMTSFacade
135176
^^^^^^^^^^

0 commit comments

Comments
 (0)