Points from routing wrong


I’m trying to call the API to get a route as a Polyline using points. The problem is that if I select for it to give me the points in the form of encoded points they get wrong quickly. However, when I wish to get it in latlng pairs it works great. But I want it in encoded points since it’s more efficient that way. If you aren’t understanding where I am coming from see the picture below!
As you can see, it gives a rather good line until it decides to take a left and just leave. I’ve had it working a couple of months ago but now it just quits on me. Does anyone know how I can solve this?

Kind regards,

Please use the correct decoding method. E.g. in JavaScript:

and Java:


I used online decoders such as google’s own decoder and that happened. Is there a seperate decoder for graphhopper?

Update: I seem to have the same issue using google’s directions API. Will update if I find a solution.

Solution has been found! Apparently it responded with a string where it used double backslashes ("\") instead of 1 backslash (""). Solution was just to replace “\” with “” and the problem was then solved!

Powered by Discourse