0

I have the OSRM setup up and running in my CentOS 7 and I have used car.lua profile with little modification to extract the osm data.

Also, with the GPS traces I have(which further converted to gpx format) I generated real "travel time models" using the below programs.

http://wiki.openstreetmap.org/wiki/Routing/Travel_Time_Analysis

and the result wold be like the below:

    <models-db>
    <model node-from="338720677" node-to="832908078" way="214413814" freeflow="5.4" avg-delay="0.9" />
      <model node-from="832908078" node-to="315264821" way="214413814" freeflow="1.0" avg-delay="0.2" />
      <model node-from="315264821" node-to="315264861" way="28682394" freeflow="7.3" avg-delay="2.1" />
      <model node-from="256019073" node-to="256019073" way="30625842" freeflow="18.0" avg-delay="5.9">
        <traffic-delay from="03:15:00" to="07:15:00" day="Any" delay="0.2" />
        <traffic-delay from="15:00:00" to="19:15:00" day="Any" delay="0.9" />
        <traffic-delay from="19:15:00" to="23:30:00" day="Any" delay="5.4" />
      </model>
      ..........
      ..........

Is there a way to use this "travel time model" results in OSRM data as the node-from and node-to are directly connected to the osm node id.

I know we can change the speed (forward and backward) using the lua profile and re populate the data. As the above results gives in time "freeflow" & "avg-delay", I am struggling in using the live travel time models in osrm data.

Also I found the feature "Traffic" in OSRM wiki from the below link

https://github.com/Project-OSRM/osrm-backend/wiki/Traffic

but again we need to give the input as node along with speed(edge_speed_in_km_h).

Thanks in advance.

sudesh
  • 973
  • 1
  • 10
  • 19

1 Answers1

3

Sadly you will need to invest a little effort here to convert the above format into something that OSRM will understand. We use a simple CSV-based schema, and as you already saw we require speed and not duration.

To convert your duration values to speed values you will need to write a conversion tool that does the following things:

  • Read an OSM file and save the coordinate for each node (indexed by OSM node id)
  • Read your XML file and for each model:
    • get the coordinates for node-from and node-to
    • compute the distance between those coordinates
    • divide the computed distance by the desired field you want to extract, e.g. free_flow / distance = speed [m/s]
    • divide the speed in m/s so divide by 3.6 to convert to km/h
    • Save the result as CSV {node_from},{node_to},{speed} for each connected node pairs

I'm assuming here that ǹode-from and node-to are always adjacent. I'm not sure how the format you posted is defined, I could not find a real specification under the link you provided.

OSRM does not deal with time-dependence itself. You need to orchestrate this yourself and provide an up-to-date CSV file for your current model of the road-network.

mrash
  • 883
  • 7
  • 18
themarex
  • 909
  • 7
  • 16
  • Thanks for you elaborated steps to make use of it. Even I thought similar to the above. I remember, I have seen some feature request in OSRM saying "Make Travel time & Edge weights independant". So that, I would want to know is there any direct way to make use of "Travel time" while extracting osm data instead of above as it costs more in terms of time. Anyway I will dig in to further. Thanks. – sudesh Apr 10 '16 at 07:30
  • No that issues is about being able to use arbitrary weights (for example distance or safety) as basis for routing. So you could find the shortest or safest route. This is unrelated to this problem, since the current weight _is_ travel time. – themarex Apr 10 '16 at 22:42
  • Oh ok. Thanks again for the clarification. Do you know is there any Roadmap or feature request to use "Duration" as like "speed"? – sudesh Apr 12 '16 at 09:17