Open Source Routing Machine
Johan Uhle
@freenerd
johan@mapbox.com
FOSS4G Bonn August 2016
1
2
3
4
Pipeline
• OSM road network
• Processing
• Routing
5
Pipeline
Processing
• OSM planet
• AWS EC2: r3.8xlarge with 32 CPUs & 244 GB RAM
• car 9 hours
• bike 13 hours
• walk 18 hours
6
Pipeline
Routing
• Car routing
• AWS EC2: r3.4xlarge with 16 CPUs & 122 GB RAM
7
OSRM v5
In-car navigation
8
9
OSRM v5
1. Guidance
2. Dynamic Speeds
10
Guidance
11
12
Guidance
Additional instruction types
depart new name
continue end of road
turn fork
roundabout merge
arrive on ramp
off ramp
use lane
rotary
roundabout turn
13
Guidance
Ramps
14
Guidance
Roundabouts
15
Guidance
Combinined Instructions
16
Guidance
Lanes
lanes=4
turn:lanes=left;through|through|through|through;right
17
OSRM v5
1. Guidance
2. Dynamic Speeds
18
Dynamic Speeds
• Goals:
• Give realistic ETAs
• Choose the best route
19
Dynamic Speeds
20
Dynamic Speeds
Current Design
• Speeds assigned by profiles
• OSM tag maxspeed
• Type of road, e.g. primary
• car 65 km/h
• bike 15 km/h
• walk 5 km/h
21
Dynamic Speeds
External speed data
• During processing
• Load external csv file with format
from_node,to_node,speed
22
Dynamic Speeds
External speed data
1. Freeflow
• Uncongested speed
2. Historical buckets
• In a typical week, speed for this 15 minute window
3. Realtime
• Speed "right now"
23
Dynamic Speeds
24
Dynamic Speeds
External speed data
Mapbox SF office to SFO x: time UTC y: ETA seconds blue: static speed from profile orange: external speed data is dynamic with rush hour
25
Dynamic Speeds
External speed data
Mapbox SF office to SFO different routes over time
26
Dynamic Speeds
Faster processing
• How to get speeds into osrm?
27
Dynamic Speeds
Faster processing
• Make processing faster by:
• Caching
• Doing less work
28
Dynamic Speeds
Faster processing: Caching
• Cache major parts of processing
• On speed update: only execute the speed relevant
processing
29
Dynamic Speeds
Faster processing: Do less work
• Tradeoff between processing time and query time
30
Dynamic Speeds
Faster processing: Do less work
• Eventually: smaller geographical areas process faster.
31
Dynamic Speeds
Faster processing
• Turnaround time for processing: 3 hours -> 10 minutes 1
• Route request time: 20ms -> 200ms
1
Shuttling of data between processing and api instance not included
32
33
Thanks
• OSRM has in-car-ready guidance
• Bring your own speeds
Johan
@freenerd
johan@mapbox.com
34
• project-osrm.org
• github.com/mapbox/guidance-sim
• Maps © Mapbox © OpenStreetMap contributors
• Map from JOSM © OpenStreetMap contributors
35

Open Source Routing Machine - FOSS4G 2016 Bonn