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_geonames_data.sh
24 24
DB_USER="bien"
25 25
DB_HOST_OPT=""
26 26
SCRIPT_DIR="$(dirname $0)"
27
DATADIR="${HOME}/geonames"
27 28
GEONAMES_DUMP_URL="http://download.geonames.org/export/dump"
28 29
ALL_COUNTRIES_ZIP=allCountries.zip
29 30
ALL_COUNTRIES_TXT=allCountries.txt
......
39 40
    echo "-d, --dbname=DBNAME      database name psql commands will connect to" >&2
40 41
    echo "-h, --host=HOSTNAME      database server host or socket directory" >&2
41 42
    echo "-U, --username=USERNAME  database user name" >&2
43
    echo ""
44
    echo "Input Data Options:" >&2
45
    echo "-m, --geonames-data      Geonames.org data directory (default: ${HOME}/geonames)" >&2
46
    echo "                         Delete this directory, or the geonames.org data in it," >&2
47
    echo "                         to re-download the data." >&2
42 48
    exit 1;
43 49
}
44 50

  
......
83 89
            DB_NAME="${1#*=}"
84 90
            shift
85 91
            ;;
92
        -m)
93
            if [[ -z $2  ]];  then
94
                echo "Option $1 requires an argument." >&2
95
                usage
96
            fi
97
            DATADIR="$2"
98
            shift 2
99
            ;;
100
        --geonames-data=*)
101
            DATADIR="${1#*=}"
102
            shift
103
            ;;
86 104
        *)
87 105
            echo "Invalid option: $1" >&2
88 106
            usage
......
113 131
echo "Updating geonames.org tables..."
114 132

  
115 133
# Check for data downloaded into geonames under the current directory.
116
DATADIR="$(dirname $0)/geonames"
117 134
if [[ ! -d "${DATADIR}" ]]; then
118 135
    echo "making directory ${DATADIR}"
119 136
    mkdir -p "${DATADIR}"

Also available in: Unified diff