Created
October 18, 2017 16:11
-
-
Save mvexel/4aee67b81f5ddba1c185e2ec103bb9b6 to your computer and use it in GitHub Desktop.
query on a TIGER states table (Imported from Census SHAPE using shp2pgsql) to generate GeoJSON for each that osmium will understand.
This file contains hidden or 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
COPY ( | |
SELECT name, jsonb_build_object( | |
'type', 'Feature', | |
'id', gid, | |
'geometry', ST_AsGeoJSON(geom)::jsonb, | |
'properties', to_jsonb(row) - 'gid' - 'geom') | |
FROM (SELECT * FROM cb_2016_us_state_500k) row) | |
TO '/Users/martijnv/osm/planet/states.tsv'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment