OpenSourceHelpCommunity / Questions

To add your question raise an issue in this repository.
MIT License
27 stars 47 forks source link

How to interpret OSRM results #516

Open Lambo2020 opened 1 month ago

Lambo2020 commented 1 month ago

Hi

Pls refer to website: https://project-osrm.org/docs/v5.24.0/api/#trip-service

When I paste the below code: "http://router.project-osrm.org/trip/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219;13.418555,52.523215?source=first&destination=any"

Question 1: What is the meaning of waypoint_index": 0"? Does it mean that the point: "13.388798, 52.517033" is the first coordinate aka starting point?

Question 2: Why is it ""distance": 4.231521214," in the result? What does this distance represent? Does it equate to the distance between the required first coordinate (13.388860,52.517037) and the actually mapped first coordinate (13.388798, 52.517033)?

Question 3: So does that mean that the OSRM does not use the exact first coordiante that I asked it to use? Whys is this so?

How do I interpret the bolded section of the results shown below by answering my questions above posted:

{ "code": "Ok", "trips": [ { "geometry": "mfp_IvpAk~@xHgGgg@{DwWq@cf@lG{m@bDiQrCkGqImHs@cY~BcP@sDb@e@hDLjKkRt@InHpCDFFpL[rD}BzK{GnUzOrQbCpBZu@}CkDPi@kCuCk@m@Of@{@w@iGyHgKn[dTnXnEIdOh@pEbJvAtEvDzOtBl_A@b@VC", "legs": [ { "steps": [], "summary": "", "weight": 263.2, "duration": 260.3, "distance": 1886.8 }, { "steps": [], "summary": "", "weight": 370.4, "duration": 370.4, "distance": 2845.4 }, { "steps": [], "summary": "", "weight": 163.5, "duration": 163.5, "distance": 1344.3 }, { "steps": [], "summary": "", "weight": 323.2, "duration": 322, "distance": 2921.4 } ], "weight_name": "routability", "weight": 1120.3, "duration": 1116.2, "distance": 8997.9 } ], "waypoints": [ { "waypoint_index": 0, "trips_index": 0, "hint": "PPwJgDHgm4UXAAAABQAAAAAAAAAgAAAAIXRPQYXNK0AAAAAAcPePQQsAAAADAAAAAAAAABAAAACdCAEA_kvMAKlYIQM8TMwArVghAwAA7wojejYY", "distance": 4.231521214, "name": "Friedrichstraße", "location": [13.388798, 52.517033] }, { "waypoint_index": 1, "trips_index": 0, "hint": "eP7dgW2djIcGAAAACQAAAAAAAAB3AAAAppONQCyhu0AAAAAA1J-EQgYAAAAJAAAAAAAAAHcAAACdCAEAfm7MABiJIQOCbswA_4ghAwAAXwUjejYY", "distance": 2.795148358, "name": "Torstraße", "location": [13.39763, 52.529432] }, { "waypoint_index": 2, "trips_index": 0, "hint": "QSUYgP___38fAAAAUQAAACYAAABSAAAAeosKQlNOX0Ki6yZCakq4Qh8AAABRAAAAJgAAAFIAAACdCAEASufMAOdwIQNL58wA03AhAwQAvxAjejYY", "distance": 2.226580806, "name": "Platz der Vereinten Nationen", "location": [13.428554, 52.523239] }, { "waypoint_index": 3, "tripsindex": 0, "hint": "j6Pkgf3_XAAAAHAEAADEAAAAAAAAAe5ezQqdY40HN5KNBAAAAANcAAAAcAQAAMQAAAAAAAACdCAEAe7_MABxxIQM7wMwAz3AhAwIAHwIjejYY", "distance": 15.595935657, "name": "", "location": [13.418363, 52.523292] } ] }