-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrdmdownload
53 lines (44 loc) · 1.13 KB
/
rdmdownload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh
#
# This script download the most recent version of the complete set of
# TIGER files from the US Census Bureau's web site.
#
# USAGE:
# ------
#
# rdmdownload <destination-path> [format=2000|2002|2004] [<state-symbol> ..]
#
# Example: downloadmap /var/tmp/maps CA
#
# PLEASE NOTE THE TIGER FILES ARE HUGE: THIS DOWNLOAD IS LIKELY
# TO TAKE A VERY LONG TIME TO COMPLETE AND THE TIGER FILES WILL
# USE A AWFUL LOT OF SPACE ON YOUR LOCAL HARD DRIVE.
#
# Now you know...
TIGERDIR=$1
shift
TIGERURL=http://www2.census.gov/geo/tiger/tiger2004se
TIGEROPT1="-nd -np -r -N -P $TIGERDIR -A.zip"
TIGEROPT2="-nd -np -r -N -P $TIGERDIR -A.ZIP"
case $1 in
format=2000) TIGERURL=http://www2.census.gov/geo/tiger/tigerua
shift
;;
format=2002) TIGERURL=http://www2.census.gov/geo/tiger/tiger2002
shift
;;
format=2004)
shift
;;
esac
if [ $# -gt 0 ] ; then
for i in $*
do
wget $TIGEROPT1 $TIGERURL/$i/
wget $TIGEROPT2 $TIGERURL/$i/
done
else
wget $TIGEROPT1 $TIGERURL/
wget $TIGEROPT2 $TIGERURL/
fi
rm -f $TIGERDIR/robots.txt