Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.29k stars 3.32k forks source link

fallback_speed wrong units #6584

Open jjbringg opened 1 year ago

jjbringg commented 1 year ago

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.

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 commented 1 year ago

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...

Rejudge-F commented 1 year ago

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