osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

fallback_speed wrong units

Open jjbringg opened this issue 2 years ago • 3 comments

Issue

Hi, I believe that fallback speed is using the wrong units. Specifically, if I take the distance in meters from the response and divide by the duration in seconds from the response, I see that the actual speed used in m/s is 10 times the fallback_speed provided in the request.

Steps to reproduce

Please provide the steps required to reproduce your problem.

  • osrm-backend = 5.27.1
  • OSM extract that was processed = planet
  • Processing commands (e.g. CH vs MLD processing) = MLD
  • Server queries = /table/v1/car/-81.58123608830448,23.133062732807502;-81.75449525435954,24.565179382517456?annotations=duration,distance&fallback_speed=1.6

Note that the response specifies a distance of "159594.4" meters and a duration of "9974.6" seconds. And 159594.4/9974.6=16 m/s. It is off by a factor of 10 from what was specified in the request.

I tried in multiple locations, not just here, and I found this factor of 10 error consistently.

Specifications

Postman request to osrm instance running in docker.

jjbringg avatar Mar 29 '23 15:03 jjbringg

I would assume maybe the units are just off (though a 10m isn't a common unit, nor is a 0.1 second), but I saw elsewhere in documentation for OSRM (nodejs - https://github.com/Project-OSRM/osrm-backend/blob/0ca913132acea46e0c56e4665af50d68f53eec68/docs/nodejs/api.md?plain=1#L144 ) that osrm expects units of m/s for fallback_speed, so that probably isn't the issue...

jjbringg avatar Apr 20 '23 08:04 jjbringg

I also encountered this problem. i think is a bug here.

Rejudge-F avatar Jun 09 '23 07:06 Rejudge-F