I am trying to map routes which should match the Google Maps street network.
I know how to serialize the JSON result from the Google Maps Directions API.
I am looking now at encoding the polylines from the individual routing steps.
I have found some decoder algorithm here on stackoverflow but tested first Google's own Interactive Polyline Encoder. I would expect the encoded line to match the Google Map but it doesn't.
The screenshot shows the result of an encoded segment in the Interactive Polyline Encoder on the left and the result from a Google Maps route on the right.
The encoded polyline is "uxhuBxrc|QPA@?@?B?B@@B@D@HDFD@B@H@JBB@DBFJ"
Is it possible that the Algorithm in Google's Interactive Polyline Encoder is wrong?
Has anyone tested Jeffrey Sambells algorithm and knows whether the results match the results from Google's Interactive decoder?
Cheers, Dennis
EDIT: The problem is with the returned polyline segments and not the encoding algorithm. Even the sample segment which Google provides in the example response on the Directions API page fits very poorly with the underlying road geometry.