routing on rails with openstreetmap...michael reichert (nakaner) current solutions osmdata features...

33
Routing on rails with OpenStreetMap Michael Reichert (Nakaner) photo: Andre de, Wikimedia Commons, CC-BY-SA 4.0

Upload: others

Post on 10-Feb-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

Routing on rails with

OpenStreetMap

Michael Reichert (Nakaner)

photo: Andre de, Wikimedia Commons, CC-BY-SA 4.0

Page 2: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Page 3: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Current solutionsTravic

proprietary

Page 4: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Current solutionsMentz

proprietary

Page 5: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Current solutionsRaildar.fr

filtering the planet using osmfilter, routing with OSRM,rumours about tag replacement

Page 6: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Current solutionsSignal.eu.org

OSRM, support of left/right track, reversing

Page 7: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Railway tracks in OpenStreetMap

connected

one way per track

1 841 430 km tracks(608 055 km in Europe)

1 239 753 possiblepoints (634 524 inEurope)

289 423 points taggedwith railway=switch

(208 078 in Europe)

Page 8: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Railway tracks in OpenStreetMapSimple points

Page 9: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Railway tracks in OpenStreetMapSlip points

double slip point (railway=switch +railway:switch=double slip)

Page 10: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Railway tracks in OpenStreetMapSlip points

single slip point (railway=switch +railway:switch=single slip)

Page 11: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Railway tracks in OpenStreetMapSlip points

crossing (railway=railway crossing)

Page 12: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Railway tracks in OpenStreetMapTags

railway=rail/light rail/tram/subway/narrow gauge

gauge=*

electrified=no/yes/contact line/rail

voltage=*

frequency=*

See Railways at OpenStreetMap at SotM 2016 for more.

Page 13: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Features

power systems

gauges

preconfigured profiles

freight train and TGV profiles for France andGermany/Austria/Switzerlanduniversal diesel train (any gauges), max. 120 kphuniversal electric train (any gauges, any power system),max. 140 kph

profile customization via YAML file

reversing

reduced default speeds for crossovers and other slowertracks

map matching (CSV, GPX)

Page 14: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Demo

Demo

Page 15: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Performance

osmium tags-filter -o planet-rail.osm.pbf

planet.osm.pbf nw/railway 6 minutes on a fast server,1–2GB RAM

168MB .osm.pbf file

import: about 1 minute, 1200 MB RAM withoutcontraction hierarchies

graph: 204MB

2450 routes through Germany

2352 successfull routes2 minutes 8 seconds, 1 threadaverage length per route: 409 km

Page 16: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Implementation

com.graphhopper

com.graphhopper.reader.osm

de.geofabrik.railway routing

GraphHopper

GraphHopperOSM

RailwayHopper

+ cleanUp(): void

Page 17: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

ImplementierungFlagEncoder

com.graphhopper.routing.util

de.geofabrik.railway routing

≪interface≫FlagEncoder

AbstractFlagEncoder

RailFlagEncoder

Page 18: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

ImplementierungRailFlagEncoder

RailFlagEncoder

- electrifiedValues: ArrayList<String>- acceptedVoltages: ArrayList<Integer>- acceptedFrequencies: ArrayList<Double>- acceptedGauges: ArrayList<Integer>- speedCorrectionFactor: double

+ RailFlagEncoder(properties: PMap)

Page 19: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

ImplementierungRailFlagEncoder

RailFlagEncoder

- electrifiedValues: ArrayList<String>- acceptedVoltages: ArrayList<Integer>- acceptedFrequencies: ArrayList<Double>- acceptedGauges: ArrayList<Integer>- speedCorrectionFactor: double

+ RailFlagEncoder(properties: PMap)

YAML configname

electrified

voltages

frequencies

gauges

maxspeed

speedFactor

Page 20: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Experiences with GraphHopper

+ suitable for routing on any routeable OSM network

– introduction into FlagEncoder could be more verbose

– TurnCostExtension without good documentation →

misconceptions

– no different penalities for reversing for each FlagEncoder

– a library for car routing only

flag encoders designed to be extensibleaddition of turn restrictions not designed to be extensiblereading of OSM files not extensible → fork of GraphHopper

+ forum

Read the unit tests!

Page 21: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Space for improvementLeft/right track on double-tracked lines

directio

n of trave

l

Page 22: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Space for improvementTag to distinguish left and right tracks

railway:preferred direction=forward/backward

Page 23: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Space for improvementEstimation of travel times

currently 0.9 · speed limit

Page 24: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Space for improvementEstimation of travel times

currently 0.9 · speed limit

Comparison of timetables of nonstop IC trains using the TGVprofile (max. 160 kph due to old infrastructure)

timetable routing

IC Koblenz–Mainz 1:05 0:50IC Magdeburg–Dessau 0:42 0:36

Page 25: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Space for improvementSpecify heading direction

Saabrucken–Frankfurt

Page 26: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Space for improvementSpecify heading direction

Saabrucken–Frankfurt

Page 27: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Missing dataGradients

Hansueli Krapf, Wikimedia Commons, CC-BY-SA 3.0

Page 28: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Missing dataGradients

Problems

SRTM resolution too low

cuttings and embankments in SRTM datanarrow valleysvertical precision

Page 29: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Missing dataGradients

Problems

SRTM resolution too low

cuttings and embankments in SRTM datanarrow valleysvertical precision

Solutions?

Use railway lines to correct elevation data?

elevation profiles provided by operator of infrastructure

Measure elevation profiles data ourselves?

Page 30: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Missing dataLines for special purpose (S-train, RER, . . . ), diesel engine bans

Poudou99, Wikimedia Commons, CC-BY-SA 4.0

Page 31: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Missing dataLoading gauge

Falk2, Wikimedia Commons, CC-BY-SA 4.0

Page 32: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

Missing dataLoading gauge

.osm.pbf file

FlagEncodershape file/PostGIS database

polygons around lineswith special properties

Page 33: Routing on rails with OpenStreetMap...Michael Reichert (Nakaner) Current solutions OSMdata Features Demo Performance Implemen-tation Future Currentsolutions Signal.eu.org OSRM, support

MichaelReichert(Nakaner)

Currentsolutions

OSM data

Features

Demo

Performance

Implemen-tation

Future

The development of this software has been sponsored by

Source code:https://github.com/geofabrik/railway_routing