[8] Encoded Polyline は、一連の経緯度の組のリストを単一の ASCII文字列として符号化する方式です。 Google Maps で用いられています。
[11] 一連の経緯度を符号化してそのままの順序で並べます。
[12] 各経緯度は、緯度、経度の順に符号化して順に並べます。
[13] 各値の最終文字は、 0x3F-0x5E を使って表されます。 それよりも前の文字は、0x5F-0x7E を使って表されます。
[10] 同じような性質を持つ他のデータにも適用できます。 Google 自身が 「level」の符号化に用いる例を示しています >>4。 ただし、この場合経緯度のように値2つの組ではなく、値1つだけのリストとなります。 しかも、経緯度のように前の値との差を取ったり、ビット演算したりせずに、 5ビット符号無し整数としてそのまま符号化しているようです。
[19] 一般化すると、符号化器・復号器は次の引数を取るアルゴリズムとなります。
[9] Google Maps の API で符号化と復号の機能が提供されています。
[2] mapbox/polyline: polyline encoding and decoding in javascript ( 版) https://github.com/mapbox/polyline
[4] Interactive Polyline Encoder Utility | Google Maps APIs | Google Developers ( 版) https://developers.google.com/maps/documentation/utilities/polylineutility
Polyline encoding is a lossy compression algorithm that allows you to store a series of coordinates as a single string. Point coordinates are encoded using signed values.
Polylines in Google Maps are formed as a set of latitude/longitude pairs. In addition, for each vertex (location) in an encoded polyline, a level can be specified indicating that the location should appear on that level and any level higher (i.e. any decrease in zoom.).
[7] Geo::Google::PolylineEncoder - search.cpan.org () http://search.cpan.org/dist/Geo-Google-PolylineEncoder/lib/Geo/Google/PolylineEncoder.pm
Activity and segment API requests may include summary polylines of their respective routes. The values are string encodings of the latitude and longitude points using the Google encoded polyline algorithm format.
[16] wakaba/perl-geo-encodedpolyline () https://github.com/wakaba/perl-geo-encodedpolyline
[17] wakaba/js-geo-encodedpolyline () https://github.com/wakaba/js-geo-encodedpolyline
[18] ST_AsEncodedPolyline () https://postgis.net/docs/ST_AsEncodedPolyline.html