Revision 11561
Added by Paul Sarando about 11 years ago
update_gadm_data.sh | ||
---|---|---|
31 | 31 |
# GADM data originally available at http://www.gadm.org/data2/gadm_v2_shp.zip |
32 | 32 |
# gadm.org now links this file from biogeo.ucdavis.edu. |
33 | 33 |
GADM_DATA_URL="http://biogeo.ucdavis.edu/data/gadm2/gadm_v2_shp.zip" |
34 |
GADM_DATA_DIR="${SCRIPT_DIR}/gadm_v2_shp"
|
|
34 |
GADM_DATA_DIR="${HOME}/gadm_v2_shp"
|
|
35 | 35 |
|
36 | 36 |
function usage { |
37 | 37 |
echo "Usage: $0 [OPTIONS]" >&2 |
... | ... | |
39 | 39 |
echo "-d, --dbname=DBNAME database name psql commands will connect to" >&2 |
40 | 40 |
echo "-h, --host=HOSTNAME database server host or socket directory" >&2 |
41 | 41 |
echo "-U, --username=USERNAME database user name" >&2 |
42 |
echo "" |
|
43 |
echo "Input Data Options:" >&2 |
|
44 |
echo "-g, --gadm-data GADM data directory (default: ${HOME}/gadm_v2_shp)" >&2 |
|
45 |
echo " Delete this directory, or the GADM data in it," >&2 |
|
46 |
echo " to re-download the data." >&2 |
|
42 | 47 |
exit 1; |
43 | 48 |
} |
44 | 49 |
|
... | ... | |
83 | 88 |
DB_NAME="${1#*=}" |
84 | 89 |
shift |
85 | 90 |
;; |
91 |
-g) |
|
92 |
if [[ -z $2 ]]; then |
|
93 |
echo "Option $1 requires an argument." >&2 |
|
94 |
usage |
|
95 |
fi |
|
96 |
GADM_DATA_DIR="$2" |
|
97 |
shift 2 |
|
98 |
;; |
|
99 |
--gadm-data=*) |
|
100 |
GADM_DATA_DIR="${1#*=}" |
|
101 |
shift |
|
102 |
;; |
|
86 | 103 |
*) |
87 | 104 |
echo "Invalid option: $1" >&2 |
88 | 105 |
usage |
Also available in: Unified diff
Added biengeo script options for data directories.
Added GADM and geonames.org data dir options to
update_validation_data.sh scripts.
Added geoscrub input data dir option to geoscrub.sh scripts.