This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Using OSM (api) and latlon data, how to get the best public transport option/route/information

0

Hello all,

Being new to OSM I still don't understand much. I am looking for a way to:

  • give OSM 2 coordinates, as a lat-lon pair
  • receive the suggested (best?) public transport route between those

Many thanks in advance for any tips!

asked 07 Nov '17, 13:55

Mirela2's gravatar image

Mirela2
11112
accept rate: 0%

edited 07 Nov '17, 13:56


One Answer:

2

The OpenStreetMap API does not offer routing of any kind.

What's more, OpenStreetMap does not have information about timetables and hence cannot give you the best public transport route. OpenStreetMap knows where bus and train lines go, but it doesn't know how frequently a vehicle stops at a certain location, so even if OSM could compute a theoretically-optimal route, it is quite likely that in practice another route would be better.

There are some routing engines e.g. OpenTripPlanner or Valhalla, that use public transport data from third-party sources (where this is available - in many places it is not) in order to provide a multi-modal routing. But that is outside the scope of OpenStreetMap proper, and you will have to look into these projects for answers.

answered 07 Nov '17, 14:02

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thank you so much Frederik, that is very helpful! Perhaps not knowing the time and optimal route is even ok, so just knowing a possible route between two points, regardless of timing. Is this doable?

(07 Nov '17, 14:24) Mirela2

Source code available on GitHub .