Created
March 6, 2014 00:39
-
-
Save ebrelsford/9379886 to your computer and use it in GitHub Desktop.
Use ogr2ogr to get data from a PostGIS database as GeoJSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ogr2ogr -f GeoJSON data.geojson \ | |
PG:"dbname='dbname' user='dbuser' password='dbpassword' host='dbhost'" \ | |
-sql "SELECT id, geometry from table_name where geometry is not null" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment