Customised speed

I have installed a local instance of OpenRouteService for France to compute travel time matrix and it works very well.
The driving times are in my opinion a bit optimistic, especially in dense areas. I guess this is to be expected as Openroute does not take traffic into account.
I put together a simple workflow to try to improve the results by applying regional corrections and I would like to have your opinion to understand whether I am missing something.

As I read in #1165 the maxspeed in OSM is given priority when calculating the travel speed. If that is missing, an heuristic procedure determines the speed to use.
Because I would like to apply corrections geographically, my idea is to act directly on the input data rather than ORS configuration. In practice, this means:

  1. Download OSM data
  2. Fill all the maxspeed missing values with a value by type of road to make sure that there is no need for the heuristic.
  3. Apply regional coefficient (for example 0.6*maxspeed for Paris, 0.95*maxspeed for low traffic areas) to tweak the maxspeed.
  4. Use the modified data to initiate the OSR instance
    In my view, this should make sure that each road has a maxspeed value and that ORS uses that value to compute the travel distance.

Does it make sense ? Am I missing something important ?

Thank you for your time and for the great work you are doing.

Thanks for reaching out!

The ORS heuristic to assign edge speed tries to model travel in low-traffic occurrence. Of course, as you pointed out, it is not expected to return correct estimates during rush hour especially in densely populated agglomerations such as Paris.

While your idea of editing OSM maxspeed tags might in general give you better estimates, I don’t think there is actually need for this tedious task. Assuming you are running your local ORS instance, a somewhat more scalable solution would be to simply alter the ORS internal heuristic to calculate the speed. The actual challenging part would probably be applying the regional coefficients, as there is currently no build-in solution in ORS for such type of tweaking. But if you already have methods of doing so directly in the OSM data, I expect this approach could as well be directly translated into the ORS code to set the edge speeds.

Hello !
Thank you for your reply.

Indeed, your outline of a solution would be more scalable but I would have a few issues with this approach:

  1. If I change the internal heuristic, wouldn’t I be making my own version of OpenRouteService and wouldn’t it make difficult to keep up with its updates in the future?
  2. I don’t know how I would do it in the internal code, but applying regional coefficient would involve some spatial intersection that would probably increase the computing time of the distance matrix quite a lot (I didn’t mention but performance is a key issue).

Anyway, thank you for the tips.