-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.sh
35 lines (23 loc) · 989 Bytes
/
launch.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
# 14.5.2020
# OSRM using pre-made .pbf's from https://server.nikhilvj.co.in/dump/ or other source
# bring in environment variables
# var=${DEPLOY_ENV:-default_value} - from https://stackoverflow.com/a/39296572/4355695
OSMPBF=${PBFURL:-https://server.nikhilvj.co.in/dump/chennai.pbf}
profile=${PROFILE:-/profiles/car-modified.lua}
# downloading OSM data from URL. Saves as area.pbf for simplicity in later commands.
cd /data/
wget -N --timeout=20 ${OSMPBF}
# keeping original filename to enable -N key for skipping dload if already done
cp "${OSMPBF##*/}" area.pbf
# compiling commands of OSRM - builds the graph
osrm-extract -p ${profile} /data/area.pbf
osrm-partition /data/area.osrm
osrm-customize /data/area.osrm
# list all files created in compile
ls -lS /data/
# setting env variable DISABLE_ACCESS_LOGGING=1 for improving performance
DISABLE_ACCESS_LOGGING=1
export DISABLE_ACCESS_LOGGING
# launch OSRM-backend API
osrm-routed --algorithm mld /data/area.osrm