-
Notifications
You must be signed in to change notification settings - Fork 4
/
831.txt
70 lines (49 loc) · 3 KB
/
831.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[8] [DFN[Encoded Polyline]] は、一連の[[経緯度]]の組の[[リスト]]を単一の
[[ASCII文字列]]として[[符号化]]する方式です。
[[Google Maps]] で用いられています。
[REFS[
- [1] [CITE@en[Encoded Polyline Algorithm Format | Google Maps APIs | Google Developers]]
([TIME[2016-02-16 08:30:05 +09:00]] 版)
<https://developers.google.com/maps/documentation/utilities/polylinealgorithm>
]REFS]
* 符号化
[11] 一連の[[経緯度]]を[[符号化]]してそのままの順序で並べます。
[12] 各[[経緯度]]は、[[緯度]]、[[経度]]の順に[[符号化]]して順に並べます。
[10] 同じような性質を持つ他のデータにも適用できます。 [[Google]] 自身が
「level」の符号化に用いる例を示しています [SRC[>>4]]。
この場合[[経緯度]]のように値2つの組ではなく、値1つだけの[[リスト]]となります。
[13] 各値の最終文字は、 [N[0x5F]]-[N[0x7E]] を使って表されます。
それよりも前の文字は、 [N[0x3F]]-[N[0x5E]] を使って表されます。
* API
[9] [[Google Maps]] の [[API]] で[[符号化]]と[[復号]]の機能が提供されています。
[REFS[
- [3] [CITE@en[Google Maps JavaScript API V3 Reference | Google Maps JavaScript API | Google Developers]]
([TIME[2016-03-01 13:00:09 +09:00]] 版)
<https://developers.google.com/maps/documentation/javascript/reference?csw=1#spherical>
]REFS]
* メモ
[2] [CITE@en[mapbox/polyline: polyline encoding and decoding in javascript]]
([TIME[2016-04-20 15:07:00 +09:00]] 版)
<https://github.com/mapbox/polyline>
[4] [CITE@en[Interactive Polyline Encoder Utility | Google Maps APIs | Google Developers]]
([TIME[2016-02-16 08:30:08 +09:00]] 版)
<https://developers.google.com/maps/documentation/utilities/polylineutility>
[FIG(quote)[
[FIGCAPTION[
[5] [CITE@en[Encoded Polyline Algorithm Format | Google Maps APIs | Google Developers]]
([TIME[2016-07-13 06:14:37 +09:00]])
<https://developers.google.com/maps/documentation/utilities/polylinealgorithm>
]FIGCAPTION]
> 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.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[6] [CITE@en[Interactive Polyline Encoder Utility | Google Maps APIs | Google Developers]]
([TIME[2016-07-13 06:14:40 +09:00]])
<https://developers.google.com/maps/documentation/utilities/polylineutility>
]FIGCAPTION]
> 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.).
]FIG]
[7] [CITE[Geo::Google::PolylineEncoder - search.cpan.org]]
([TIME[2016-07-19 20:55:42 +09:00]])
<http://search.cpan.org/dist/Geo-Google-PolylineEncoder/lib/Geo/Google/PolylineEncoder.pm>