[OSRM-talk] Small ways get small speeds

Daniel Patterson daniel at mapbox.com
Wed Feb 28 19:37:35 UTC 2018


Hi François,

  What you are seeing is rounding error.

  Internally, OSRM only stores the "duration" of each segment, with a
resolution of 0.1 seconds.  On the map, the speed is calculated by taking
the length of the segment, and dividing it by the "duration" value.

  We store longitude/latitude to 6 decimal places, so they have
approximately 10cm precision (https://en.wikipedia.org/wiki/Decimal_degrees)
depending on your latitude.  This precision means that calculating the
length of a segment is limited to +/- approx 10cm precision as well.

  Both of these precision limits compound for short segments when displayed
on the map, and sometimes the speed values look weird.

  However, they do not affect route selection very much, because routing is
done by accumulating time, and short segments generally only add small
amounts of time to the routing decision.

daniel



On Wed, Feb 28, 2018 at 10:41 AM, François Lacombe <
fl.infosreseaux at gmail.com> wrote:

> Hi,
>
> While investigating for flaws in a custom profile I'm trying to write, I
> discovered that arbitrary small ways got strange speed regarding the rules
> I used.
>
> Here is an extract from osrm-frontend debug
> https://imgur.com/a/L8coz
>
> All segments on the red line have the same attributes.
> I don't understand why the small parts in the middle got really slower
> speed than the longer ones.
> Do you have any idea?
>
> The purple road with 0km/h speed is normal and expected.
>
>
> Thank you for any hint
>
> Thanks in advance
>
> François
>
> _______________________________________________
> 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/20180228/6e7038dc/attachment.html>


More information about the OSRM-talk mailing list