-
Notifications
You must be signed in to change notification settings - Fork 63
/
download-world.sh
executable file
·35 lines (29 loc) · 873 Bytes
/
download-world.sh
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
#!/bin/bash
set -x
unzip -v >/dev/null 2>&1 || { echo >&2 "I require 'unzip' but it's not installed. Aborting."; exit 1; }
curl -h >/dev/null 2>&1 || { echo >&2 "I require 'curl' but it's not installed. Aborting."; exit 1; }
mkdir -p data/downloaded/
mkdir -p data/downloaded/zip/
FILE=data/downloaded/allCountries.txt
if [ -f $FILE ];
then
echo "File $FILE exists."
else
curl -o $FILE.zip http:https://download.geonames.org/export/dump/allCountries.zip
unzip -o $FILE.zip
mv allCountries.txt $FILE
rm $FILE.zip
fi
FILE=data/downloaded/zip/allCountries.txt
if [ -f $FILE ];
then
echo "File $FILE exists."
else
curl -o $FILE.zip http:https://download.geonames.org/export/zip/allCountries.zip
unzip -o $FILE.zip
mv allCountries.txt $FILE
rm $FILE.zip
fi
source scripts/download-common.sh
./scripts/extract-wiki-buildings.py
./scripts/extract-adm.py