Project-OSRM / osrm-backend

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

Wrong results with nearest service #6980

Closed icantspake closed 4 months ago

icantspake commented 4 months ago

Issue

When I try to obtain the nearest point in the street network to some locations, the API returns a point in the middle of nowhere. This is affecting the Table service too, as I can't correctly compute the driving distance between some points in a set.

Steps to reproduce

Some of the problematic locations:

Screenshots

1st Captura2

2nd Captura3

3rd Captura4

jcoupey commented 4 months ago

(43.46165, -3.82461) is in a street in the middle of Santander (Spain); I obtain the coordinates (41.385842, -1.87573), which is in the countryside 315km away

The 315km distance in itself hints at something wrong. You're simply using lat,lon instead of lon,lat (expected order in OSRM API). The coordinate you supply is somewhere in the sea west of Africa and the snapped location is in Kenya.

icantspake commented 4 months ago

Oh, how stupid of me! I mislabelled longitud and latitude in my table and it was driving me mad. Thank you so much!