Skip to content

Instantly share code, notes, and snippets.

@NTerpo
Last active February 19, 2016 15:45
Show Gist options
  • Save NTerpo/fec8dbab8e24318d72fa to your computer and use it in GitHub Desktop.
Save NTerpo/fec8dbab8e24318d72fa to your computer and use it in GitHub Desktop.
- DL data as GeoJSON from ODS
- $ ogr2ogr -f "ESRI Shapefile" foo.shp foo.geojson OGRGeoJSON
- $ shp2pgsql foo.shp foo > foo.sql
- $ createdb gp
- $ psql -d gp
- gp=# CREATE EXTENSION postgis;
- $ psql -f foo.sql -d gp
- gp=# create table merged as
select id, ST_Union(geom)
from foo
group by id;
- gp=# \copy (select id, ST_AsGeoJSON(st_union) from merged) TO '~/Downloads/export.csv' CSV HEADER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment