2

I have a number of spatial tables in my PostgreSQL database which I would like to tile cache to Vector Tiles. Is it possible to combine multiple tables in one go so that effectively each tile has content of many tables/layers?

After researching the ogr2ogr documentation it looks like it is possible for one layer, but I cannot figure out how to set things up for many layers? Are there any examples please how to generate MVT from Postgres using ogr2ogr / how to set the params?

1 Answer 1

2

After a bit of digging this command does what I need:

ogr2ogr -f MVT tilesdir -dsco CONF=config.json -dsco MINZOOM=11 -dsco MAXZOOM=16 -dsco COMPRESS=NO PG:"host=myhost dbname=mydb user=myuser password=mypass" tablea tableb tablec

Above pulls 3 tables: tablea tableb tablec

Then in my config.json the table names become the keys as in the sample provided in the documentation:

https://gdal.org/drivers/vector/mvt.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.