Skip to content

Instantly share code, notes, and snippets.

@nobuf
Last active August 29, 2015 14:02
Show Gist options
  • Save nobuf/6597ca902dab97a9db5b to your computer and use it in GitHub Desktop.
Save nobuf/6597ca902dab97a9db5b to your computer and use it in GitHub Desktop.
Generate US States TopoJSON from the 2013 Census shape file
# Kind of fork from https://github.com/jgoodall/us-maps
#
# Access http://www.census.gov/cgi-bin/geo/shapefiles2013/main
# Choose 'States (and equivalent)' and 'Submit'
mkdir tl_2013_us_state
cd tl_2013_us_state
mkdir topojson geojson
unzip ../tl_2013_us_state.zip
ogr2ogr -f "GeoJSON" geojson/state.json tl_2013_us_state.shp tl_2013_us_state
topojson --id-property STUSPS --out topojson/state.json geojson/state.json
topojson -s 3 --out topojson/state-s3.json topojson/state.json # 70k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment