Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save francbartoli/964126a08ba0326feda2c5ee14f61bca to your computer and use it in GitHub Desktop.
Save francbartoli/964126a08ba0326feda2c5ee14f61bca to your computer and use it in GitHub Desktop.
MBTiles: Pipe GeoJSON from PostGIS to Tippecanoe

I had a large dataset in postgis and wanted to avoid the hassle of first exporting it to a several GB geojson file before tiling it with Tippecanoe.

ogr2ogr -f GeoJSON /dev/stdout \                                                                            
PG:"host=localhost dbname=postgres user=postgres password=thepassword" \
-sql "select * from a, roi where a.geom && roi.geom" \
| docker run -i -v ${PWD}:/data tippecanoe:latest tippecanoe \
--output=/data/yourtiles.mbtiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment