OSRM Backend Service
Build a Service
- Install necessary packages
$ sudo apt install build-essential git cmake pkg-config \
libbz2-dev libstxxl-dev libstxxl1v5 libxml2-dev \
libzip-dev libboost-all-dev lua5.2 liblua5.2-dev libtbb-dev
$ wget https://github.com/Project-OSRM/osrm-backend/archive/v5.7.0.tar.gz
$ tar -xzf v5.7.0.tar.gz
$ cd osrm-backend-5.7.0
$ mkdir -p build
$ cd build
$ cmake ..
$ cmake --build .
$ sudo cmake --build . --target install
- Download the necessary data (taiwan-latest.osm)
$ wget http://download.geofabrik.de/asia/taiwan-latest.osm.pbf
- Prepare osm resource and start the routing service
$ osrm-extract taiwan-latest.osm.pbf -p ../profiles/car.lua
$ osrm-contract taiwan-latest.osrm
$ osrm-routed taiwan-latest.osrm
- Access the service by the browser or curl
curl http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true