Is there any way to detect that an encoded polyline contains elevation data?


#1

Hi,

I’m working on transitioning my app from google’s direction api to Graphhopper. Most of the data in the local db is stored as the encoded polyline recieved from google’s api which did not contain elevation data. Now that I am doing this transition, I need to figure in code if the encoded polyline which is stored has elevation data or not.

How can I do that?

Thanks


#2

If you have the full response we store "points_encoded": true in the JSON.

If you really only have the polyline string: you’ll have to try both variants and then apply certain heuristics which one it is.