-
Notifications
You must be signed in to change notification settings - Fork 4
/
919.txt
349 lines (243 loc) · 14.4 KB
/
919.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
[34] [DFN[GPX]] は、[[GPS]] [[測位]]で得た[[座標]]データの交換のための
[[XML]] ベースの[[マーク付け言語]]です。この分野での[[デファクト標準]]となっています。
* 仕様書
[REFS[
- [4] [CITE@en[GPX: the GPS Exchange Format]]
([TIME[2016-04-08 16:23:50 +09:00]] 版)
<http://www.topografix.com/gpx.asp>
-- [37] ([TIME[2014-08-07 02:03:14 +09:00]] 版) <http://www.topografix.com/GPX/1/1/gpx.xsd>
]REFS]
[33] 近代的な意味の[[仕様書]]は存在しないようです。 [[XML Schema]]
[[スキーマ]]が提供されています。
* 構文
[36] [[XML 1.0]] を使います。
;; [38] [[XML 1.1]] には言及されていませんが、実際に [[XML 1.1]]
を使った例は確認されていません。実装が [[XML 1.1]] に対応しているのかどうかは謎です。
[40] [[GPX]] の標準の[[語彙]]は、[[名前空間URL]]
[DFN[[CODE(URI)@en[http://www.topografix.com/GPX/1/1]]]]
で定義されています。拡張は他の[[名前空間]]を使うことがあります。
[62] [[GPX 1.0]] 時代の[[名前空間URL]]
[DFN[[CODE(URI)@en[http://www.topografix.com/GPX/1/0]]]]
が使われることもあります。どの程度流通しているのかは不明です。
[39] [[文書要素]]として [CODE(XMLe)@en[gpx]] [[要素]]を使います [SRC[>>37]]。
** [CODE(XMLe)@en[gpx]] 要素
[41] [DFN[[CODE(XMLe)@en[gpx]]]] [[要素]]は、
[[文書要素]]です [SRC[>>37]]。
*** 属性
[49] [DFN[[CODE(XMLa)@en[version]]]] [[属性]]は必須です。値は [CODE[1.1]]
でなければなりません。 [SRC[>>37]]
[50] [CODE(XMLa)@en[creator]] [[属性]]は必須です [SRC[>>37]]。
[48] [CODE(XMLa)@en[xsi:schemaLocation]] [[属性]]が指定されることがよくあります。
*** 内容
[42] 次のものを[[内容]]として含めることができます [SRC[>>37]]。
[FIG(list middle)[
= [43] [CODE(XMLe)@en[metadata][metadata (GPX)]] [[要素]] (0-1)
= [44] [CODE(XMLe)@en[wpt][wpt (GPX)]] [[要素]] (0-∞)
= [45] [CODE(XMLe)@en[rte]] [[要素]] (0-∞)
= [46] [CODE(XMLe)@en[trk]] [[要素]] (0-∞)
= [47] [CODE(XMLe)@en[extensions][extensions (GPX)]] [[要素]] (0-1)
]FIG]
* MIME 型
[32] 公式な規定は無いみたいです。
[9]
[FIG(list middle)[
- [CODE(MIME)@en[text/gpx]]
- [CODE(MIME)@en[application/gpx]]
- [CODE(MIME)@en[application/gpx+xml]]
- [CODE(MIME)@en[application/x-gpx]]
- [CODE(MIME)@en[application/x-gpx+xml]]
]FIG]
* 拡張子
[35] [DFN[[CODE[.gpx]]]] がよく使われるようです。
* ファイル例
[8] <http://www.yamareco.com/modules/yamainfo/download-gpx.php?route_id=332>
[CODE(MIME)@en[application/gpx+xml]]
[10] <http://latlonglab.yahoo.co.jp/route/get?id=8ef4df3bfb5dfa5870dca1867ce2833f&format=gpx>
[CODE(MIME)@en[[[application/gpx]]; [[charset]]=[[UTF-8]]]]
[11] <http://labs.coruscantconsulting.co.uk/garmin/gpxgmap/load.php?d=default&lang=en&elev=off&trk=off&o=gpx&cmt=off&desc=off&w=on&gdata=goo.gl%2Fmaps%2FTFxlI>
[CODE(MIME)@en[[[application/gpx+xml]]; [[charset]]=[[utf8]]]]
[26] <http://www.yamakei-online.com/cl_record/output_gps.php?id=55413&fid=1>
[CODE(MIME)@en[[[text/plain]]; [[charset]]=[[UTF-8]]]]
[51] [CITE[Google Maps dynamic GPX example]] ([TIME[2016-04-09 20:09:37 +09:00]] 版) <http://www.gpsvisualizer.com/examples/google_gpx.html>
[52] [CITE@en[stefanocudini/googletrace: Create and store online gpx traces over on Google Maps and OpenStreetMap Sat]] ([TIME[2016-04-09 20:16:00 +09:00]] 版) <https://github.com/stefanocudini/googletrace>
[53] [CITE@en[ultigpx/example1.gpx at master · Knio/ultigpx]] ([TIME[2016-04-09 20:20:53 +09:00]] 版) <https://github.com/Knio/ultigpx/blob/master/example1.gpx>
[54] [CITE@en[ultigpx/example2.gpx at master · Knio/ultigpx]] ([TIME[2016-04-09 20:20:53 +09:00]] 版) <https://github.com/Knio/ultigpx/blob/master/example2.gpx>
[55] [CITE@en[share-tracks/sentiero.catalupo.gpx at master · stefanocudini/share-tracks]] ([TIME[2016-04-09 20:29:48 +09:00]] 版) <https://github.com/stefanocudini/share-tracks/blob/master/gpxs/sentiero.catalupo.gpx>
[56] [CITE@en[share-tracks/chia.fosso.gpx at master · stefanocudini/share-tracks]] ([TIME[2016-04-09 20:30:18 +09:00]] 版) <https://github.com/stefanocudini/share-tracks/blob/master/gpxs/chia.fosso.gpx>
[58] [CITE@en[geotools-2.7.x/sample_gpx_file_01.gpx at master · boundlessgeo/geotools-2.7.x]] ([TIME[2016-04-09 20:36:25 +09:00]] 版) <https://github.com/boundlessgeo/geotools-2.7.x/blob/master/modules/unsupported/gpx2/test/org/geotools/gpx2/resources/sample_gpx_file_01.gpx>
[59] [CITE@en[geotools-2.7.x/sample_gpx_file_02.gpx at master · boundlessgeo/geotools-2.7.x]] ([TIME[2016-04-09 20:36:55 +09:00]] 版) <https://github.com/boundlessgeo/geotools-2.7.x/blob/master/modules/unsupported/gpx2/test/org/geotools/gpx2/resources/sample_gpx_file_02.gpx>
[61] ([TIME[2013-05-09 00:08:04 +09:00]] 版) <http://www.ic.daito.ac.jp/~mizutani/gps/data/2013_aug26_toyara.gpx>
[[MIME型]]なし
* 実装
[22] [[GPX]] の入出力に対応した[[ネイティブアプリ]]は多数あるようです。
[23] [[Webアプリケーション]]はそれほど多くないようです。
[13] [[Bing地図]]
[CODE(MIME)@en[[[application/x-unknown]]; [[charset]]=[[utf-8]]]]
[15] <http://www.ecoris.co.jp/contents/maptool.html>
[CODE(MIME)@en[application/octet-stream]]
[24] [[Strava]] ([[Webサイト]]、[[API]])
[64] [CITE@en-US[GPX Aviation Waypoint Generation]] ([TIME[2016-04-09 21:30:57 +09:00]] 版) <http://navaid.com/GPX/>
* メモ
[FIG(quote)[
[FIGCAPTION[
[1] ([TIME[2015-07-25 10:48:33 +09:00]] 版)
<http://npgpx.sourceforge.net/>
]FIGCAPTION]
> NPGPX - the GPX plugin
> NPGPX is a plugin that loads and displays GPX files directly in your browser window. It supports zooming and panning, as well as simple graphical settings. It should work with Mozilla and Mozilla-like browsers such as Firefox or Netscape.
> GPX, or the GPS eXchange format, is an XML-based file format that is designed to store GPS data - waypoints, routes, and tracks. It is used by many GPS programs, for example Quantum GIS and GPSBabel. The specification of the GPX format, and other useful documentation, can be found here.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[2] ([TIME[2004-11-11 04:20:14 +09:00]] 版)
<http://npgpx.sourceforge.net/demo.html>
]FIGCAPTION]
>
> <EMBED TYPE="text/gpx" SRC="arjeplog04.gpx" WIDTH=350 HEIGHT=350
> ALT="You don't have the NPGPX plugin!">
]FIG]
[3] [CITE@ja[GPX - Wikipedia]]
([TIME[2016-03-08 10:10:17 +09:00]] 版)
<https://ja.wikipedia.org/wiki/GPX>
[FIG(quote)[
[FIGCAPTION[
[5] [CITE@en[Strava Uploads V3 API]]
([TIME[2016-03-30 01:36:07 +09:00]] 版)
<https://strava.github.io/api/v3/uploads/>
]FIGCAPTION]
> The base version of GPX does not allow for the inclusion of heartrate, cadence, distance or temperature data. As a result, extensions to GPX were created and Strava supports the two most popular plus a general format. The extensions extend the <trkpt> tag to include extra attributes with each datapoint.
> Garmin’s Track Point Extension v1
> From the extensions available, Strava extracts:
> atemp as temperature
> hr as heartrate.
> Cluetrust GPX extension
> From the extensions available, Strava extracts:
> cadence as cadence
> distance as distance
> hr as heartrate
> temp as temperature.
> Strava also detects general tags placed in the <extensions> tag of each <trkpt> tag. Strava extracts:
> cadence as cadence
> distance as distance
> heartrate as heartrate
> power as power.
]FIG]
[6] [CITE[]] ([TIME[2008-08-14 06:42:00 +09:00]] 版) <http://www8.garmin.com/xmlschemas/TrackPointExtensionv1.xsd>
[7] <http://www.cluetrust.com/Schemas/gpxdata10.xsd>
[12] [CITE[Google Maps to GPX Converter]]
([[Sverrir Sigmundarson]] 著, [TIME[2016-04-08 21:12:01 +09:00]] 版)
<http://labs.coruscantconsulting.co.uk/garmin/gpxgmap/convert.php>
[FIG(quote)[
[FIGCAPTION[
[14] [CITE@ja[やっと巡り会えた、GPSロガーの軌跡上の位置の「時刻」も分かるGPXビュアー:GPS Tracks/GPS Tracks HD « アメリカより]]
([TIME[2016-04-08 21:19:44 +09:00]] 版)
<http://blogfromamerica.com/?p=15376>
]FIGCAPTION]
> 無料・有料を含めて、GPXファイル(GPSロガーが保存するファイルタイプ)を表示するアプリを探してみたのですが、なんと、地図上に軌跡のみを表示するアプリは沢山有っても、任意の軌跡上の点の時刻を表示するものと、軌跡を始点から終点まで再生して辿ってくれるアプリが、殆ど無いこと!
> 結局、20以上のアプリをダウンロードし、数十ドルのお金を有料アプリに費やしました。
> そして、もう諦めて、「これこそ、自分で自分の目的に合ったGPXビュアー・アプリを開発しなければならないか!?」と思っていたときに、やっと、それなりに自分の目的に叶うアプリを探し当てることが出来ました!
> ■ GPS Tracks/GPS Tracks HD (開発元:DMomeault)
> それが、
> ● GPS Tracks、iPhone対応(iPad/iPad Miniでも使える) $0.99
> ● GPS Tracks HD、iPad/iPad Mini専用 $3.99
> です。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[16] [CITE[【GPSロガー】GPX形式をITM形式に変換するウェブアプリを作りました。 | KUMA TYPE]]
([TIME[2016-04-08 21:28:50 +09:00]] 版)
<http://blog.kumacchi.com/2013/04/25/2352>
]FIGCAPTION]
> ezTourはITM形式以外のデータを読み込めないのです。
> しかし、山旅ロガーはITM形式でログを出力できないわけです。GPX形式とKML形式なら出力できるので、GPXとかKMLで出力してみたわけです。
]FIG]
[FIG(quote)[
[FIGCAPTION[
[17] [CITE[【GPSロガー】GPX形式をITM形式に変換するウェブアプリを作りました。 | KUMA TYPE]]
([TIME[2016-04-08 21:29:17 +09:00]] 版)
<http://blog.kumacchi.com/2013/04/25/2352>
]FIGCAPTION]
> 山旅ロガーとezTourで生成したGPXファイルの中では見たことが無かったのですが、他のソフトで、一つの<trk></trk>タグの中に<trkseg></trkseg>タグが複数存在する場合が、有るよう
]FIG]
[FIG(quote)[
[FIGCAPTION[
[18] [CITE[【GPSロガー】GPX形式をITM形式に変換するウェブアプリを作りました。 | KUMA TYPE]]
([TIME[2016-04-08 21:29:34 +09:00]] 版)
<http://blog.kumacchi.com/2013/04/25/2352>
]FIGCAPTION]
> GPXファイルのspeedエレメントは「メートル/秒」で有ることが判明したので、時速に変換してから登録するようにした。
> speedエレメントがない場合、座標と時刻から自力で速度を算出するように改良した。
]FIG]
[19] [CITE@ja[GPX2ITM コンバータ - GPXファイルをITMファイルに変換]]
([TIME[2016-04-08 21:30:55 +09:00]] 版)
<http://gpx2itm.kmake.net/>
[20] [CITE@ja[Why not GPX? - OpenStreetMap Wiki]]
([TIME[2016-01-21 16:32:39 +09:00]] 版)
<http://wiki.openstreetmap.org/wiki/Why_not_GPX%3F>
[21] [CITE@ja[GPX - OpenStreetMap Wiki]]
([TIME[2016-04-02 07:09:10 +09:00]] 版)
<http://wiki.openstreetmap.org/wiki/GPX>
[25] [CITE@ja[JavaScript版 あしあとデータ to GPX コンバーター]]
([TIME[2009-10-23 23:49:42 +09:00]] 版)
<http://cs88.awardspace.info/ashiato2gpx/>
[27] [CITE[GPX-POI file generator]]
([TIME[2016-04-08 22:02:29 +09:00]] 版)
<http://gpx-poi.com/>
[FIG(quote)[
[FIGCAPTION[
[28] [CITE@en[Default handler for mime type application/gpx+xml · Issue #527 · cgeo/cgeo]]
([TIME[2016-04-08 23:19:11 +09:00]] 版)
<https://github.com/cgeo/cgeo/issues/527>
]FIGCAPTION]
>
> I can see that results from pocket queries have Content-Type: application/gpx; - so we would probably need to register for both:
> Content-Type: application/gpx;
> Content-Type: application/gpx+xml;
]FIG]
[FIG(quote)[
[FIGCAPTION[
[29] [CITE[#4768 (GPX download Content-Type should be "application/gpx+xml") – OpenStreetMap]]
([TIME[2016-04-08 23:20:39 +09:00]] 版)
<https://trac.openstreetmap.org/ticket/4768>
]FIGCAPTION]
> It would be convenient if the Content-Type of GPX downloads was "application/gpx+xml" instead of "text/xml". This would match the media type defined for GPX on Wikipedia (http://en.wikipedia.org/wiki/GPS_eXchange_Format), and would allow better support for GPX-enabled applications to be selected automatically by the browser/operating-system when users click on download links.
> For example on iPhone Safari will render text/xml documents itself rather than passing them off to an appropriate application. If the Content-Type was application/gpx+xml then Safari would search for an installed application that knew how to handle GPX files and allow the user to open the download in that app.
>
]FIG]
[FIG(quote)[
[FIGCAPTION[
[30] [CITE[Open gpx files from browser]]
([TIME[2016-04-08 21:22:20 +09:00]] 版)
<http://help.locusmap.eu/topic/open_gpx_files_from_browser>
]FIGCAPTION]
> At first glance it looks like maybe Locus needs to register for the application/gpx+xml mime type (in addition to application/gpx)?
]FIG]
[31] [CITE[add application/x-gpx+xml, application/x-osm+xml, application/x-esri-shape to the mime-type database | Review Request | Review Board]]
([TIME[2016-04-08 23:23:54 +09:00]] 版)
<https://git.reviewboard.kde.org/r/106977/>
[57] [CITE@en[RouteConverter/gpx/src/main/doc at master · cpesch/RouteConverter]]
([TIME[2016-04-09 20:31:20 +09:00]] 版)
<https://github.com/cpesch/RouteConverter/tree/master/gpx/src/main/doc>
[FIG(quote)[
[FIGCAPTION[
[60] [CITE[独り言日記(2009/12) - FreeStyleWiki]]
([TIME[2016-04-09 20:52:23 +09:00]] 版)
<http://ft-lab.ne.jp/cgi-bin/wiki.cgi?page=%C6%C8%A4%EA%B8%C0%C6%FC%B5%AD%A1%CA2009%2F12%A1%CB#p40>
]FIGCAPTION]
> <gpx version="v1.1.5"
> creator="iTravel Tech Inc. - http://www.itravel-tech.com"
]FIG]
[FIG(quote)[
[FIGCAPTION[
[63] [CITE[GPX - GPS Exchange Format]]
([TIME[2016-04-09 20:05:35 +09:00]] 版)
<http://www.gdal.org/drv_gpx.html>
]FIGCAPTION]
> Expat library supports reading the following built-in encodings :
> US-ASCII
> UTF-8
> UTF-16
> ISO-8859-1
> OGR 1.8.0 adds supports for Windows-1252 encoding (for previous versions, altering the encoding mentioned in the XML header to ISO-8859-1 might work in some cases).
> The content returned by OGR will be encoded in UTF-8, after the conversion from the encoding mentioned in the file header is.
]FIG]