Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created July 15, 2014 21:00
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 wboykinm/bcb80a9435e32bdc827e to your computer and use it in GitHub Desktop.
Save wboykinm/bcb80a9435e32bdc827e to your computer and use it in GitHub Desktop.
Import Cenus block groups by state and convert to GeoJSON
wget -rc ftp://ftp2.census.gov/geo/tiger/TIGER2013/BG/
mkdir zips
mv ftp2.census.gov/geo/tiger/TIGER2013/BG/*.zip zips
rm -rf ftp2.census.gov
cd zips
for f in $( ls *.zip )
do
echo $f
unzip $f;
done
for f in $( ls *.shp )
do
echo $f
# Convert to GeoJSON
ogr2ogr -t_srs "EPSG:4326" -f "GeoJSON" ${f%.*}.geojson ${f%.*}.shp
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment