2

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 Sep 28 '17 at 13:46
1

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, or right now if you use master from github, 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.

  • Actually on November2017 wich is the latest version, please provide me the link to download it – Rabie Ben Oct 25 '17 at 8:39
  • Here the link to latest OSRM libraries.io/npm/osrm/5.13.0-rc.4 – Rabie Ben Oct 28 '17 at 11:25
  • so this is the major difference between Open Trip Planner and OSRM ? – Mickey Perlstein Aug 5 '18 at 12:27
2

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:
http://wiki.openstreetmap.org/wiki/OSM_tags_for_routing
http://wiki.openstreetmap.org/wiki/Map_Features

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, privacy policy and cookie policy

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