Ogr2Ogr exporting PostGis => GeoJson

by Tristan Rhodes   Last Updated March 28, 2018 09:22 AM

I'm exporting from PostGis to GeoJson, but appear to have no control over the table it retrieves. Have tried the following methods:

.\ogr2ogr -f "GeoJSON" "C:\Temp\output.geojson" "PG:host=**** port=**** dbname=**** user=**** password=****" -sql "SELECT * FROM with_id"

  • SELECT from table with_id failed, no such table/featureclass.

.\ogr2ogr -f "GeoJSON" "C:\Temp\output.geojson" "PG:host=**** port=**** dbname=**** user=**** password=****" -sql "SELECT * FROM public.with_id"

  • Unable to open secondary datasource `public' required by JOIN.

.\ogr2ogr -f "GeoJSON" "C:\Temp\output.geojson" "PG:host=**** port=**** dbname=**** user=**** password=****" with_id

  • Couldn't fetch requested layer 'with_id'!

.\ogr2ogr -f "GeoJSON" "C:\Temp\output.geojson" "PG:host=**** port=**** dbname=**** user=**** password=****" public.with_id

  • Couldn't fetch requested layer 'public.with_id'!


Related Questions


ogr2ogr - Clipping postgis and creating geojson

Updated April 08, 2016 09:09 AM




ogr2ogr PostgreSQL to geojson batch export

Updated April 03, 2017 13:22 PM