[OSRM-talk] Accuracy of distance matrix calculation

Daniel Patterson daniel at mapbox.com
Thu Jun 30 17:46:32 UTC 2016


Milton,

  OSRM depends on the tags in OpenStreetmap to estimate travel speeds, and it is not always right.  For this particular route, it looks like we think the speed is about 60km/h based on the road tags.
  You can see what OSRM thinks of the underlying road network on the debug map:

    http://map.project-osrm.org/debug/#17.65/8.51453/76.97262 <http://map.project-osrm.org/debug/#17.65/8.51453/76.97262>

  The road is unnamed, and has a `maxspeed=60` tag on it.  We assume cars will drive at approximately the speed limit.

  I do not know where TravelMath gets their routing results from, but there's a good chance they are using Google behind the scenes.  Google uses data from mobile phones to get better estimates for travel speeds on roads, this leads to more realistic ETA calculation.  Unfortunately, that kind of data is all private, so OSRM does not have access to it.  The best we can do is estimate based on the metadata we have in OpenStreetmap.

  If you have your own source of improved driving-speed data, you can set up your own OSRM server and import it using the "traffic data features" (see the OSRM Wiki).

  To answer your other questions:

    - Do you want shortest distance routes, or do you want shortest time routes, and return the distances for those?  You can do the former by setting all speeds in the `car.lua` profile to 3.6km/h, routes will then be calculated as shortest distance, and returned "duration" values will be in meters.

    - If you run your own OSRM server, you can set the maximum car speed in the `car.lua` profile before pre-processing the data.  You cannot set it on a per-query basis.

  Note that the API can return an `annotations` element, which tells you the specific duration and distance of every segment of the returned route.  If you want to cap the speed, you could use this data to adjust the ETA in the returned response using your speed limit to fix the returned durations.  This would be somewhat complex, but doable.  Note that it would not *route* using a maximum speed, but you could somewhat correct your ETA with this approach.

daniel

> On Jun 30, 2016, at 10:10 AM, Milton Garcia Borroto <milton.garcia at gmail.com> wrote:
> 
> Dear Daniel,
> Thank you very much for your promptly reply. We are using osrm for building a large distance matrix. Take a look for example to this calculation: 
> Source: 8.512421667,76.97160333
> Destination: 8.538019178,76.96748103
> OSRM returns 3min 30 sec. If you check in travelmath, they return 10 minutes, which is more logical answer for a 5 km distance.
> Then I have some other questions:
> - Is there a way to get the distances instead of time?
> - Is there a way to select maximum car speed?
> Regards,
> Milton
> 
> 2016-06-30 11:55 GMT-05:00 Daniel Patterson <daniel at mapbox.com <mailto:daniel at mapbox.com>>:
> Milton,
> 
>   What's the exact route in question?  Start/end coordinates, or a link to map.project-osrm.org <http://map.project-osrm.org/> would help us figure out why it's marked as being so fast.
> 
> daniel
> 
>> On Jun 30, 2016, at 9:30 AM, Milton Garcia Borroto <milton.garcia at gmail.com <mailto:milton.garcia at gmail.com>> wrote:
>> 
>> Hi everybody,
>> I started using osrm few weeks ago, first the demo and now I am running it in my own server. When using the distance matrix, I am obtaining very different results from other services like TravelMath (www.travelmath.com <http://www.travelmath.com/>). Taken a deeper look at the osrm results, I note that you need to move really fast to attain the resultant times. For example, a ride of 3.3 km is reported to be done in 3 minutes 30 seconds. Am I doing or understanding something wront? Can I change the maximum speed?
>> Regards,
>> Milton
>> _______________________________________________
>> OSRM-talk mailing list
>> OSRM-talk at openstreetmap.org <mailto:OSRM-talk at openstreetmap.org>
>> https://lists.openstreetmap.org/listinfo/osrm-talk <https://lists.openstreetmap.org/listinfo/osrm-talk>
> 
> 
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org <mailto:OSRM-talk at openstreetmap.org>
> https://lists.openstreetmap.org/listinfo/osrm-talk <https://lists.openstreetmap.org/listinfo/osrm-talk>
> 
> 
> _______________________________________________
> OSRM-talk mailing list
> OSRM-talk at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/osrm-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osrm-talk/attachments/20160630/e35c3952/attachment-0001.html>


More information about the OSRM-talk mailing list