graphhopper / directions-api-js-client

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

Optionally return full route geometry on route optimization request #7

Closed karussell closed 7 years ago

karussell commented 9 years ago

Hmmh, I can see you've included a fix for this. Would you mind to explain? Or can we make this more explicit e.g. call profile just tspProfile as the profile is only use for this or defaultProfile if nothing is specified. If it is just as default then I would like to avoid this as we (should) handle this on the server side.

oblonski commented 9 years ago

I need the route's profile in the solution as we also need the actual locations. Therefore, I attached the vehicle's profile to the solution here: https://github.com/graphhopper/directions-api-js-client/blob/master/js/GraphHopperOptimization.js#L184

oblonski commented 9 years ago

The profile itself is retrieved from the vehicles. However, if a vehicle does not have any reference to a type, the default profile is assigned.

karussell commented 9 years ago

Still do not understand why a profile is necessary and a default profile should be handled server side.

Do you mean we need this for e.g. the Routing API?

oblonski commented 9 years ago

The vrp solution does not come with the actual routes. However, if we want to show them on a map, we need to make another routing request to gh-routing. And this is where we need the profile.

karussell commented 9 years ago

Ok, it seems to me that this is indeed necessary to do this post processing. Including the profile in the response JSON wouldn't make sense as we have the vehicle_id and the user can inject by himself, as he would do for any other information too.

Still we should make it possible in the API to include the routes directly where the fetching is done behind the scenes.

karussell commented 7 years ago

This is already fixed? @oblonski