Hi, I have installed OSRM and downloaded then extracted .osm.pbf file for my country, Iran, from here.
when I send request via this link:
http://127.0.0.1:5000/nearest/v1/driving/35.721169,51.391656?number=3&bearings=0,20
for this location: 35.721169,51.391656
it returns this:
{"waypoints":[{"distance":1463026.930788,"hint":"mQsAAF0ZAYAAAAAAAAAAAEQAAAByAAAAdwsAAB1EAgBiGgAAOQIAgB95qAKIPV8C0Q8hAqgsEAMCAAEBEnrBmg==","name":"","location":[44.595487,39.796104]},{"distance":1463082.918863,"hint":"mQsAAF0ZAYAAAAAAAAAAAHgAAAC2AAAA_woAAB1EAgBiGgAAOQIAgH55qAKAO18C0Q8hAqgsEAMDAAEBEnrBmg==","name":"","location":[44.595582,39.795584]},{"distance":1463176.276753,"hint":"mQsAAF0ZAYAAAAAAAAAAAOEFAAAuAQAAHgUAAB1EAgBiGgAAOQIAgGp5qALcN18C0Q8hAqgsEAMEAAEBEnrBmg==","name":"","location":[44.595562,39.794652]}],"code":"Ok"}
as you see the distance is wrong and the location is far away from my country!
result of this request from here:
http://router.project-osrm.org/nearest/v1/driving/35.721169,51.391656?number=3&bearings=0,20
is:
{"waypoints":[{"distance":1162.687317,"hint":"SD_zBWCYjoe8qQQBAAAAAIMCAABcBQAAAAAAAAYjegTWUAAFCLUAAIIhIQJYBRAD0Q8hAqgsEAMDAAEBtzEFGQ==","name":"","location":[35.725698,51.381592]},{"distance":1212.677693,"hint":"r89Jh8XPSQcAAAAAUgAAAAAAAAB0BQAAPAAAAAXqrwQNx9kFCLUAAEnPIAKIOhAD0Q8hAqgsEAMLAAEBtzEFGQ==","name":"","location":[35.704649,51.395208]},{"distance":1488.630003,"hint":"YpiOh2mYjgcAAAAAXAAAAAAAAAAFAQAAKQMAAL4YBQa3GAUGCLUAAFMsIQJ_-w8D0Q8hAqgsEAMDAAEBtzEFGQ==","name":"","location":[35.728467,51.379071]}],"code":"Ok"}
and it seems true.
Do I have made a mistake somewhere?
You accidentally swapped latitude with longitude:
coordinates: String of format {longitude},{latitude};{longitude},{latitude}[;{longitude},{latitude} ...]
https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#http-api
You are right, Thanks a lot!
Most helpful comment
You accidentally swapped latitude with longitude:
https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#http-api