Skip to content

Instantly share code, notes, and snippets.

@stepankuzmin
Created July 6, 2015 10:47
Show Gist options
  • Save stepankuzmin/633632425be7e2dc5bfb to your computer and use it in GitHub Desktop.
Save stepankuzmin/633632425be7e2dc5bfb to your computer and use it in GitHub Desktop.
Save PostGIS table to geojson file
psql -d pri -c 'select st_asgeojson(st_transform(st_union(geometry), 4326)) as geometry from osm_suburbs' | awk '/coordinates/ {print $1}' > result.geojson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment