I must understand how encode polyline algorithm works and I follow this link: https://developers.google.com/maps/documentation/utilities/polylinealgorithm but I don't understand the 8 points?
what do you mean? asked 22 Oct '14, 18:16 scupetta18 aseerel4c26 ♦ |
I'm assuming that you understand points 1-6; please say if not. Point 7 means that you reverse the order of the bytes. In other words, the last should be first, the second-to-last should be second, and so on. A B C D E becomes E D C B A. Point 8 means that you add 32 (the decimal representation of 0x20, which is a hex value) to all but the last value. This is used as a signal for 'another value follows'. For most languages, there is a ready-made polylines library that you can use, so you don't have to worry about the intricacies of encoding/decoding yourself. For Ruby: https://github.com/joshuaclayton/polylines. For JavaScript using Leaflet: https://github.com/jieter/Leaflet.encoded. answered 23 Oct '14, 07:57 Richard ♦ |
This is an OpenStreetMap help forum. The Google polyline encoding algorithm is not on topic here even if it should be used by some software in conjunction with OSM. GIS Stack Exchange might be a better place to ask your question. answered 22 Oct '14, 18:40 Frederik Ramm ♦ 2
It's perfectly on topic. Being able to work with the "Google polyline" algorithm is essential for the most popular OSM-based routing software. You may as well close down any questions about tile URLs because the scheme we use for that, too, was invented by Google.
(23 Oct '14, 07:46)
Richard ♦
|