I have tried to implement the hand crafted client, but i keep getting 405 errors (“Method not allowed”).
// Hint: create this thread safe instance only once in your application to allow the underlying library to cache the costly initial https handshake
GraphHopperWeb gh = new GraphHopperWeb();
// insert your key here
// change timeout, default is 5 seconds
GHRequest req = new GHRequest()
.addPoint(new GHPoint(51.9073273, -0.2260282))
.addPoint(new GHPoint(51.9373273, -0.2560282))
GHResponse res = gh.route(req);
Can anyone tell me why this might be the case, i have tried all sorts of combinations, cutting it back to the simplest possible and i have made no progress.
I am still having trouble integrating the response from the Routing API into the Mapbox navigation endpoint.
Correct me if i’m wrong, but the navigation endpoint in the example SDK uses https://graphhopper.com/api/1/navigate/ to generate an encoded polyline which is used by the Mapbox API to generate the route, whereas the HC routing api uses https://graphhopper.com/api/1/route to generate a routing response which does not include the correct information to pass to the mapbox API.
How do i turn the response of the Routing API into something that can be used by the Navigation endpoint, without creating a second Routing request?