graphhopper / directions-api-js-client

JavaScript client for the GraphHopper Directions API
https://graphhopper.com/api/1/examples
108 stars 85 forks source link

Make association of path details to legs easier #31

Open karussell opened 6 years ago

karussell commented 6 years ago

If someone wants to know all surface or street name information per "leg" (one leg is between via points) the current process is a bit ugly, see this tutorial.

boldtrn commented 6 years ago

Good idea. We could introduce a "via point" marker that could be placed between the PathDetails, so that they are separated at this point, like:

["Street A", 0, 10], ["Via Point 1", 10, 10], ["Street A", 10, 20].

Another option would be to add a "leg" PathDetail, that would result in another PathDetail like:

["Leg 1", 0, 10], ["Leg 2", 10, 20]

karussell commented 6 years ago

I meant a purely JS solution without changing the JSON and e.g. create something that helps with separating into legs or is already separated and real JS objects.

karussell commented 4 years ago

For now I documented only the current state without any changes in the API: https://www.graphhopper.com/blog/2019/11/28/routing-api-using-path-details/