Skip to content

Instantly share code, notes, and snippets.

@jamiewanderi
Forked from justinlewis/postgis2geojson
Created May 31, 2019 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiewanderi/eba795d4c51bb5cd9ace700594040401 to your computer and use it in GitHub Desktop.
Save jamiewanderi/eba795d4c51bb5cd9ace700594040401 to your computer and use it in GitHub Desktop.
Export a PostGIS table to GeoJSON format with ogr2ogr.
ogr2ogr -f "GeoJSON" /PATH/TO/NEWFILE.json PG:"host=YOUR_HOST dbname=YOUR_DB user=YOUR_USER password=YOUR_PASS port=5432" "YOUR_POSTGIS_TABLE(the_geom)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment