forked from macecchi/osrm-rio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·30 lines (24 loc) · 820 Bytes
/
run.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
#!/bin/bash
DATA_PATH=${DATA_PATH:="/data"}
MAP_LOCATION="http://overpass-api.de/api/xapi_meta?*[bbox=-43.795060,-23.076347,-43.101608,-22.746120]"
MAP_NAME="rio"
MAP_EXTENSION="osm"
_sig() {
kill -TERM $child 2>/dev/null
}
trap _sig SIGKILL SIGTERM SIGHUP SIGINT EXIT
echo "Using data container.."
# Use data container.
if [ ! -f $DATA_PATH/$MAP_NAME.osrm ]; then
if [ ! -f $DATA_PATH/$MAP_NAME.$MAP_EXTENSION ]; then
echo "Downloading maps..."
wget -O $DATA_PATH/$MAP_NAME.$MAP_EXTENSION $MAP_LOCATION || exit 1
echo "Maps downloaded."
fi
./osrm-extract -p "profile.lua" $DATA_PATH/$MAP_NAME.$MAP_EXTENSION && \
./osrm-prepare $DATA_PATH/$MAP_NAME.osrm && \
rm $DATA_PATH/$MAP_NAME.$MAP_EXTENSION
fi
./osrm-routed $DATA_PATH/$MAP_NAME.osrm --max-table-size 12000 &
child=$!
wait "$child"