Skip to content

Instantly share code, notes, and snippets.

@chapmanjacobd
Created March 16, 2019 01:46
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 chapmanjacobd/98b8ce57f1c7c11174c4e45c3bc216c7 to your computer and use it in GitHub Desktop.
Save chapmanjacobd/98b8ce57f1c7c11174c4e45c3bc216c7 to your computer and use it in GitHub Desktop.
removes properties from geojson. import into database SQL
UPDATE wof
SET body = substring(body, '(?<=geometry": ).*$');
@chapmanjacobd
Copy link
Author

use like this

update wof_geojson set geom = st_transform(st_makevalid(st_setsrid(ST_GeomFromGeoJSON(substring(body, '(?<=geometry": ).*$')),4326)),4087)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment