I implemented the OSRM server for routing but I want the path of a person using the public transport lines (Bus) ; instead of getting the road path.

On building the OSRM from the pbf file I used the command

osrm-extract *.pbf -p profiles/car.lua 

May be because I am extracting car paths?

  • 1
    Does the OSRM server have public transport lines (Bus) as a value to extract? Also, yes I would say if you are extracting car paths that's why you are going to only receive those extractions.
    – whyzar
    Commented Sep 28, 2017 at 13:46

2 Answers 2


Bus routes in OpenStreetMap are mapped with relations.

Historically OSRM has not supported route relations, and so bus routing has not been possible unless you were prepared to pre-process the .osm.pbf source file somehow.

Happily, support for route relations has just been added to OSRM. So as of the upcoming 5.13 release you can write a custom profile to only use those ways which are part of bus routes. This will take a fair amount of Lua scripting to write the profile, but it is doable at least.

Note that OSM doesn't contain timetable information, so any route you can generate will be theoretical at best: there's no guarantee a bus will be running along the route at the time the user wants to take it, nor that the route generated will be the most efficient when timetables are taken into account. You may wish to look into Graphhopper or OpenTripPlanner as alternatives.

  • so this is the major difference between Open Trip Planner and OSRM ? Commented Aug 5, 2018 at 12:27

As far as I'm aware, Bus is not an available parameter to be extracted via OSRM server. OSRM does not do transit routing.

As mentioned here as well Routing of Public Transport based on GTFS #1961

However, based on this comment I found in a thread in a different forum How setup for bus way? you may have this as a workaround.

The profiles determine whitelists / blacklists for road types, road surfaces, how to handle obstacles like barriers and access tags, and of course they determine maxspeeds. You can start by copying the car.lua to a bus.lua profile. You can the adapt for example the speed on certain surface types.

Here are further resources:

Note how OSRM does not do transit routing, though. If you check the OSRM-talk mailinglist archives there are posts about bus routing and transit routing coming up ever so often: https://lists.openstreetmap.org/listinfo/osrm-talk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.