Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created March 24, 2011 20:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thejefflarson/885812 to your computer and use it in GitHub Desktop.
Save thejefflarson/885812 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
WD=`pwd`
tiger_em () {
directory=$WD/$1
shift
until [ -z "$1" ]
do
get_em $directory "ftp://ftp2.census.gov/geo/tiger/TIGER2010/"$1
shift
done
}
get_em () {
echo "Getting" $1 $2
wget -r -nH -c -nd -P $1 $2
unzip_em $1
}
unzip_em () {
cd $1
unzip -o "*.zip"
cd $WD
}
tiger_em "shapes/districts" "CD/108/tl_2010_us*" "CD/111/tl_2010_us*"
tiger_em "shapes/states" "STATE/2000/tl_2010_us*" "STATE/2010/tl_2010_us*"
tiger_em "shapes/counties" "COUNTY/2000/tl_2010_us*" "COUNTY/2010/tl_2010_us*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment