Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Last active July 9, 2020 18:40
Show Gist options
  • Save wboykinm/57069bf40ec012cfe39d869fbf5eca25 to your computer and use it in GitHub Desktop.
Save wboykinm/57069bf40ec012cfe39d869fbf5eca25 to your computer and use it in GitHub Desktop.
Quickly compile all of Zillow's neighborhood geodata into a single national file
# Data courtesy of Zillow, attribution required: https://www.zillow.com/howto/api/neighborhood-boundaries.htm
# Requires GDAL/OGR: http://www.gdal.org/
STATES=("AL" "AK" "AZ" "AR" "CA" "CO" "CT" "DC" "DE" "FL" "GA" "HI" "ID" "IL" "IN" "IA" "KS" "KY" "LA" "ME" "MD" "MA" "MI" "MN" "MS" "MO" "MT" "NE" "NV" "NH" "NJ" "NM" "NY" "NC" "ND" "OH" "OK" "OR" "PA" "RI" "SC" "SD" "TN" "TX" "UT" "VT" "VA" "WA" "WV" "WI")
rm -rf zillow_neighborhoods.*
for s in "${STATES[@]}"; do
echo "Processing $s"
wget -c https://www.zillowstatic.com/static/shp/ZillowNeighborhoods-$s.zip -O $s.zip
unzip $s.zip
if [[ $s = ${STATES[0]} ]]; then
ogr2ogr -t_srs "EPSG:4326" zillow_neighborhoods.shp ZillowNeighborhoods-$s.shp
else
ogr2ogr -t_srs "EPSG:4326" -update -append zillow_neighborhoods.shp ZillowNeighborhoods-$s.shp -nln zillow_neighborhoods
fi
rm -rf $s.zip
rm -rf ZillowNeighborhoods-$s.*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment