I have a lot of geographical proprietary data that I want to use in routing algorithms. I was using pgRouting, but the requirements of the software changed (now includes multi-modal routes that pgRouting doesn't support). So I looked around, and I found Open Trip Planner and Open Source Routing Machine (Not sure if it supports Multi-Modal).

My question is, using a solution like OTP or OSRM, can I import my own data, in form of Open Street Map data (.osm) and use that AND define my own Dijkstra cost function?


I can not talk about OTP, but OSRM works exactly that way, providing an .osm file where the routing will take place. Just have a look of the running instructions to getting a city up and running in 4 steps.

Regarding multimodal, OSRM supports "partially" multimodal routing. You can specify that by a so-called profile, which is the way of personalized OSRM, and, in summary, a file to describe what kind of intersections to consider and what is the cost to traverse them.

As an example, if you use the default profile provided (car.lua), the pedestrian streets will not be included in the routing graph. The costs of traversing the arcs is the travel time needed, taking into account parameters such as the type of the road, speed, and the length of the arc. Other provided profiles are foot and bicycle.

You can not have multiple profiles running at the same time, though. You will need several running instances to achieve that.

To label the arcs with your own Dijkstra cost function the profiles is the way to go. Another constraint you may have is that these costs can not be modified dynamically. Once you run OSRM, the input data is contracted to a smaller graph, so there is no way of modifying the arc costs other than re-run again OSRM with a different profile. If this suits you, OSRM has a extremely fast runtime performance, solving queries in milliseconds.

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.