Skip to content

1sha1/postgis2geojson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostGIS2GeoJSON

postgis2geojson.py

A simple tool for exporting from a PostGIS table to GeoJSON and TopoJSON. Assumes Python 2.7+, psycopg2, and TopoJSON are already installed and in your PATH.

Adapted from Bryan McBride's excellent PHP implementation.

####Example usage:

To export table "boundaries" from database "gisdata" as user "user" with password "password" to both GeoJSON and TopoJSON:

python postgis2geojson.py -d gisdata -t boundaries -u user -p password --topojson

or, also specify that the geometry column is "the_geom", only fields "oid" and "name" should be returned, and the output file should be called "boundary_data":

python postgis2geojson.py -d gisdata -t boundaries -u user -p password -g the_geom -f oid name -o boundary_data --topojson

A full list of options is available via python postgis2geojson.py --help.

About

Extract PostGIS tables as GeoJSON and TopoJSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors