forked from OpenTransitTools-BonePile/pelias.dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep_data.sh
executable file
·54 lines (43 loc) · 1.78 KB
/
prep_data.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# start elasticsearch if it's not already running
if ! [ $(curl --output /dev/null --silent --head --fail http://localhost:9200) ]; then
docker-compose up -d elasticsearch;
# wait for elasticsearch to start up
echo 'waiting for elasticsearch service to come up';
until $(curl --output /dev/null --silent --head --fail http://localhost:9200); do
printf '.'
sleep 2
done
fi
# create the index in elasticsearch before importing data
docker-compose run -T --rm schema npm run create_index;
# download all the data to be used by imports
. ./who_date.sh
if $UPDATE_WHO ; then
docker-compose run -T --rm whosonfirst npm run download &
fi
docker-compose run -T --rm openaddresses npm run download &
docker-compose run -T --rm openstreetmap npm run download &
docker-compose run -T --rm interpolation npm run download-tiger &
docker-compose run -T --rm transit npm run download &
wait;
# apply postal cities fixes
. ./postal_cities_fix.sh
# polylines data prep requires openstreetmap data, so wait until that's done to start this
# but then wait to run the polylines importer process until this is finished
docker-compose run -T --rm polylines bash ./docker_extract.sh;
docker-compose run -T --rm placeholder npm run extract;
docker-compose run -T --rm placeholder npm run build;
wait;
# NOTE: w/out the background (ampersand) processes and wait, the Pelias loader will start all
# loaders, which isn't good if the WoF data is the whole world (you'll run out of RAM)
docker-compose run -T --rm interpolation bash ./docker_build.sh &
wait;
docker-compose run -T --rm openaddresses npm start &
wait;
docker-compose run -T --rm openstreetmap npm start &
wait;
docker-compose run -T --rm polylines npm start &
wait;
docker-compose run -T --rm transit npm start &
wait;