Closed BasharMahajne closed 1 month ago
From the response, you can tell the second waypoint has been snapped some 41km away, which probably explains the difference. You have a snapping problem, so probably want to double check your input coordinates.
The input coordinates is good as i checked. So what means snapping problem, how this can be resolved ? Actually this is wired problem, cause this must be more easier than this like Google Maps API
Here is same coordinates given here, response must be : 1.8 km, 7 min
longitude: 32.524821 latitude: 35.161340
That is in the sea. The OSRM API expects lon, lat.
Closing as answered.
Working to calculate distance and ETA from 2 long,lat but in the response it show another coordinates 1: longitude: 32.524821 latitude: 35.161340
2: longitude: 32.533417 latitude: 35.149612
https://router.project-osrm.org/route/v1/driving/32.524821,35.161340;32.533417,35.149612?steps=false
The response i got : { "code": "Ok", "routes": [ { "geometry": "}xouEqaqeE}pCseJdeE_rCgzIehFpwKyie@kwMiee@c\oju@_mO
tGodBqbHyteEkymBopIkmHgBc{QgyO{rXanj@_ss@ohUsuLav[iil@d\\cxYqfJmdLkzEsdi@~{Ho}tAwiBiaeAbbLmim@pyReyHbwf@z
B~eU~lLxrEkVtjGmXc_JaqPdb@oaO
|P{yNp~RggAh_Tu~b@~fr@tnOhfDos[nxEmq@xrr@dn[xi\rc@zo~@{vZfkmA|_P~zwBmzJj{b@~vKbrYltX`EguD~~SjaOb}Lll[l|OryGzqF~}\\pco@
qh@|dHxpS~re@eqDuiIpgH~{a@tr~@sfEv}I~`Fz|G", "legs": [ { "steps": [], "summary": "", "weight": 135280.5, "duration": 61302.9, "distance": 1132222.7 } ], "weight_name": "routability", "weight": 135280.5, "duration": 61302.9, "distance": 1132222.7 } ], "waypoints": [ { "hint": "6QZXh_sGV4cMAAAAAAAAAJUBAAATAQAAeJyXQQAAAABPbRtEXp3RQwwAAAAAAAAAlQEAABMBAABTCgEAmGnwATlQGAK6U_ABImgYAhEATwMcClna", "distance": 849.234132194, "name": "Charalambos Fournides", "location": [32.532888, 35.147833] }, { "hint": "Xlb9gdifypAAAAAAMAAAAAAAAADaFgAAAAAAANo_VkEAAAAA7C_LRAAAAAAwAAAAAAAAANoWAABTCgEA9UgcAmn79AHYiRgCP03wAQAArwUcClna", "distance": 41078.557074714, "name": "", "location": [35.408117, 32.832361] } ] }