Project

General

Profile

« Previous | Next » 

Revision 11561

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.

View differences:

update_validation_data.sh
23 23
    echo "-d, --dbname=DBNAME      database name psql commands will connect to" >&2
24 24
    echo "-h, --host=HOSTNAME      database server host or socket directory" >&2
25 25
    echo "-U, --username=USERNAME  database user name" >&2
26
    echo ""
26 27
    echo "Update Options:" >&2
27 28
    echo "-G, --gadm-only             update only GADM data" >&2
28 29
    echo "-N, --geonames-only         update only geonames.org data" >&2
29 30
    echo "-M, --geonames-to-gadm-only update niether GADM nor geonames.org data," >&2
30 31
    echo "                            but geonames-to-gadm mappings are always updated." >&2
32
    echo ""
33
    echo "Input Data Options:" >&2
34
    echo "-g, --gadm-data          GADM data directory (default: ${HOME}/gadm_v2_shp)" >&2
35
    echo "                         Delete this directory, or the GADM data in it," >&2
36
    echo "                         to re-download the data." >&2
37
    echo "-m, --geonames-data      Geonames.org data directory (default: ${HOME}/geonames)" >&2
38
    echo "                         Delete this directory, or the geonames.org data in it," >&2
39
    echo "                         to re-download the data." >&2
31 40
    exit 1;
32 41
}
33 42

  
......
85 94
            NO_GEONAMES=TRUE
86 95
            shift
87 96
            ;;
97
        -g)
98
            if [[ -z $2  ]];  then
99
                echo "Option $1 requires an argument." >&2
100
                usage
101
            fi
102
            GADM_DATA_DIR_OPT="-g $2"
103
            shift 2
104
            ;;
105
        --gadm-data=*)
106
            GADM_DATA_DIR_OPT="$1"
107
            shift
108
            ;;
109
        -m)
110
            if [[ -z $2  ]];  then
111
                echo "Option $1 requires an argument." >&2
112
                usage
113
            fi
114
            GEONAMES_DATA_DIR_OPT="-m $2"
115
            shift 2
116
            ;;
117
        --geonames-data=*)
118
            GEONAMES_DATA_DIR_OPT="$1"
119
            shift
120
            ;;
88 121
        *)
89 122
            echo "Invalid option: $1" >&2
90 123
            usage
......
105 138
echo "Updating geoscrub validation data."
106 139

  
107 140
if [[ -z $NO_GADM ]]; then
108
    "${SCRIPT_DIR}"/update_gadm_data.sh -U "$DB_USER" $DB_HOST_OPT -d "$DB_NAME"
141
    "${SCRIPT_DIR}"/update_gadm_data.sh -U "$DB_USER" $DB_HOST_OPT -d "$DB_NAME" $GADM_DATA_DIR_OPT
109 142
    if [[ $? != 0 ]]; then
110 143
        echo "Could not update ${DB_NAME} database with GADM data."
111 144
        exit 1
......
113 146
fi
114 147

  
115 148
if [[ -z $NO_GEONAMES ]]; then
116
    "${SCRIPT_DIR}"/update_geonames_data.sh -U "$DB_USER" $DB_HOST_OPT -d "$DB_NAME"
149
    "${SCRIPT_DIR}"/update_geonames_data.sh -U "$DB_USER" $DB_HOST_OPT -d "$DB_NAME" $GEONAMES_DATA_DIR_OPT
117 150
    if [[ $? != 0 ]]; then
118 151
        echo "Could not update ${DB_NAME} database with geonames.org data."
119 152
        exit 1

Also available in: Unified diff