How to understand and edit factors contributing to drive time

Hello all,

I’m new to OSM and working on a proof of concept to use local dockerized OSM in place of Google Maps for a time and distance project.

The tool works well except in some rural routes where OSM provides much longer drive time estimates on a route.

For example, routing between lat/long
34.1225, -90.9842
34.2797, -91.3369

OSM, Google, Waze, and Bing all return the same route and mileage but OSM estimates 1 hr 55 minutes travel time while all the others estimate ~ 1 hr 5 mins.

My questions are:
How can I determine the factors contributing to longer drive time for the same route?
How can I edit my configuration to bring travel time more in line with the other services?

Thanks in advance for the guidance.

For reference, here’s how I’m building my route server:

sudo docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-extract -p /opt/car.lua /data/merged.osm.pbf

sudo docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-partition /data/merged.osm.pbf

sudo docker run -t -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-customize /data/merged.osm.pbf

sudo docker run -t -i -p 5000:5000 -v "${PWD}:/data" ghcr.io/project-osrm/osrm-backend osrm-routed --algorithm mld /data/merged.osm.pbf

I’m not familiar with the tech stack aspect of OSRM, but I do know there’s a debug view that you can use to inspect the explicit or assumed speed of each way.
In the OSRM map for your example in the lower left click “Open in debug map” (the square with magnifying glass icon)

I can think of a few possibilities the estimates might be different:

  • There is missing geometry in OSM that would allow a faster route
  • maxspeed tags are inaccurate or missing in OSM
  • Road ways are incorrectly classified in OSM (for example, OSRM may assume the default speed of a highway=track is 10 mph, whereas that road would be better described as highway=unclassified.
  • Google or Apple has other data to augment their speed limit data. Something like “drivers typically go 10 over on this road segment”. We don’t have anything like that in OSM, AFAIK.
  • OSM is more correct than Google/Apple, so there is no issue
3 Likes

Maybe this document about the profiles of OSRM can help you, especially the linked car.lua profile file. It’s possible that the assumed speed values (these are km/h not miles/hour) are too low in your case.

Edit: added link :slight_smile:

3 Likes

Changing the default speeds in the section below seems to be the right approach. Thanks for the guidance.

speeds = Sequence {
  highway = {
    motorway        = 90,
    motorway_link   = 45,
    trunk           = 85,
    trunk_link      = 40,
    primary         = 65,
    primary_link    = 30,
    secondary       = 55,
    secondary_link  = 25,
    tertiary        = 40,
    tertiary_link   = 20,
    unclassified    = 25,
    residential     = 25,
    living_street   = 10,
    service         = 15
  }
},
1 Like

I wasn’t familiar with the debug feature in the map. Thanks for that guidance.

1 Like