Artifact
5921c1e0ba5530938095535bfddf651edbe7f90a:
Wiki page
[GPX tracks] by
sandro
2020-07-18 17:43:55.
0000: 44 20 32 30 32 30 2d 30 37 2d 31 38 54 31 37 3a D 2020-07-18T17:
0010: 34 33 3a 35 35 2e 34 39 31 0a 4c 20 47 50 58 5c 43:55.491.L GPX\
0020: 73 74 72 61 63 6b 73 0a 50 20 66 35 30 31 62 39 stracks.P f501b9
0030: 38 37 38 35 35 33 36 63 63 31 63 36 31 34 39 36 8785536cc1c61496
0040: 39 38 32 66 37 30 39 38 62 38 63 39 34 35 64 63 982f7098b8c945dc
0050: 64 33 0a 55 20 73 61 6e 64 72 6f 0a 57 20 39 30 d3.U sandro.W 90
0060: 35 34 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 54.<table cellsp
0070: 61 63 69 6e 67 3d 22 31 32 22 20 77 69 64 74 68 acing="12" width
0080: 3d 22 31 30 30 25 22 3e 0d 0a 3c 74 72 3e 3c 74 ="100%">..<tr><t
0090: 64 20 63 6f 6c 73 70 61 6e 3d 22 32 22 3e 0d 0a d colspan="2">..
00a0: 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 <table width="10
00b0: 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 0%" bgcolor="#f0
00c0: 66 30 66 38 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 f0f8">..<tr><td
00d0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 0d align="center">.
00e0: 0a 3c 68 31 3e 47 50 58 20 74 72 61 63 6b 73 3a .<h1>GPX tracks:
00f0: 20 61 20 71 75 69 63 6b 20 69 6e 74 72 6f 3c 2f a quick intro</
0100: 68 31 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 3c h1>..</td></tr><
0110: 2f 74 61 62 6c 65 3e 0d 0a 3c 74 61 62 6c 65 20 /table>..<table
0120: 77 69 64 74 68 3d 22 31 30 30 25 22 3e 3c 74 72 width="100%"><tr
0130: 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 >..<td width="33
0140: 25 22 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 3e %" align="left">
0150: 3c 2f 74 64 3e 0d 0a 3c 74 64 20 61 6c 69 67 6e </td>..<td align
0160: 3d 22 63 65 6e 74 65 72 22 3e 42 61 63 6b 20 74 ="center">Back t
0170: 6f 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 o <a href="https
0180: 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e ://www.gaia-gis.
0190: 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 it/fossil/libspa
01a0: 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d tialite/wiki?nam
01b0: 65 3d 35 2e 30 2e 30 2d 64 6f 63 22 3e 35 2e 30 e=5.0.0-doc">5.0
01c0: 2e 30 2d 64 6f 63 20 6d 61 69 6e 20 70 61 67 65 .0-doc main page
01d0: 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 77 </a></td>..<td w
01e0: 69 64 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e idth="33%" align
01f0: 3d 22 72 69 67 68 74 22 3e 3c 2f 74 64 3e 0d 0a ="right"></td>..
0200: 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 3c 62 72 </tr></table><br
0210: 3e 3c 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 ><table width="1
0220: 30 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22 23 66 00%" bgcolor="#f
0230: 66 66 66 64 66 22 20 63 65 6c 6c 73 70 61 63 69 fffdf" cellspaci
0240: 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 ng="4" cellpaddi
0250: 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c 74 64 ng="8">..<tr><td
0260: 3e 3c 62 3e 57 68 61 74 20 69 73 20 61 20 47 50 ><b>What is a GP
0270: 58 20 66 69 6c 65 20 3f 3c 2f 62 3e 3c 2f 74 64 X file ?</b></td
0280: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
0290: 3c 62 3e 47 50 58 3c 2f 62 3e 20 73 74 61 6e 64 <b>GPX</b> stand
02a0: 73 20 66 6f 72 20 3c 69 3e 3c 62 3e 47 50 3c 2f s for <i><b>GP</
02b0: 62 3e 53 20 45 3c 62 3e 78 3c 2f 62 3e 63 68 61 b>S E<b>x</b>cha
02c0: 6e 67 65 20 46 6f 72 6d 61 74 3c 2f 69 3e 3b 20 nge Format</i>;
02d0: 69 74 27 73 20 61 20 76 65 72 79 20 70 6f 70 75 it's a very popu
02e0: 6c 61 72 20 66 69 6c 65 20 66 6f 72 6d 61 74 20 lar file format
02f0: 75 73 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f used in order to
0300: 20 65 78 63 68 61 6e 67 65 20 47 50 53 20 64 61 exchange GPS da
0310: 74 61 20 61 63 72 6f 73 73 20 64 69 66 66 65 72 ta across differ
0320: 65 6e 74 20 64 65 76 69 63 65 73 2e 3c 62 72 3e ent devices.<br>
0330: 20 0d 0a 47 50 58 20 69 73 20 61 6e 20 6f 70 65 ..GPX is an ope
0340: 6e 20 66 6f 72 6d 61 74 20 61 6e 64 20 69 73 20 n format and is
0350: 61 6c 6d 6f 73 74 20 61 6c 77 61 79 73 20 73 75 almost always su
0360: 70 70 6f 72 74 65 64 3a 20 69 74 27 73 20 62 61 pported: it's ba
0370: 73 65 64 20 6f 6e 20 61 20 66 6f 72 6d 61 6c 6c sed on a formall
0380: 79 20 64 65 66 69 6e 65 64 20 3c 61 20 68 72 65 y defined <a hre
0390: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 74 6f f="http://www.to
03a0: 70 6f 67 72 61 66 69 78 2e 63 6f 6d 2f 47 50 58 pografix.com/GPX
03b0: 2f 31 2f 31 2f 23 74 6f 70 22 3e 58 4d 4c 20 73 /1/1/#top">XML s
03c0: 63 68 65 6d 61 3c 2f 61 3e 3c 62 72 3e 0d 0a 4d chema</a><br>..M
03d0: 61 6e 79 20 72 65 61 6c 20 77 6f 72 64 20 69 6d any real word im
03e0: 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 61 72 plementations ar
03f0: 65 20 6f 6e 6c 79 20 6c 6f 6f 73 65 6c 79 20 63 e only loosely c
0400: 6f 6e 66 6f 72 6d 61 6e 74 20 74 6f 20 74 68 65 onformant to the
0410: 20 73 74 61 6e 64 61 72 64 20 73 63 68 65 6d 61 standard schema
0420: 20 61 6e 64 20 66 75 72 74 68 65 72 20 6e 6f 6e and further non
0430: 2d 73 74 61 6e 64 61 72 64 20 74 61 67 73 20 68 -standard tags h
0440: 61 76 65 20 62 65 65 6e 20 69 6e 74 72 6f 64 75 ave been introdu
0450: 63 65 64 20 62 79 20 73 65 76 65 72 61 6c 20 76 ced by several v
0460: 65 6e 64 6f 72 73 2e 3c 62 72 3e 3c 62 72 3e 0d endors.<br><br>.
0470: 0a 41 20 47 50 58 20 66 69 6c 65 20 69 73 20 65 .A GPX file is e
0480: 78 70 65 63 74 65 64 20 74 6f 20 69 6e 74 65 72 xpected to inter
0490: 6e 61 6c 6c 79 20 73 74 6f 72 65 20 61 74 20 6c nally store at l
04a0: 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 65 20 east one of the
04b0: 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6e 74 65 6e following conten
04c0: 74 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c ts:..<ul>..<li><
04d0: 62 3e 54 72 61 63 6b 73 3c 2f 62 3e 3a 20 61 20 b>Tracks</b>: a
04e0: 54 72 61 63 6b 20 69 73 20 61 6e 20 6f 72 64 65 Track is an orde
04f0: 72 65 64 20 6c 69 73 74 20 6f 66 20 70 6f 69 6e red list of poin
0500: 74 73 20 64 65 73 63 72 69 62 69 6e 67 20 61 20 ts describing a
0510: 70 61 74 68 2e 0d 0a 41 20 54 72 61 63 6b 20 6d path...A Track m
0520: 75 73 74 20 63 6f 6e 74 61 69 6e 20 61 74 20 6c ust contain at l
0530: 65 61 73 74 20 6f 6e 65 20 54 72 61 63 6b 20 53 east one Track S
0540: 65 67 6d 65 6e 74 20 68 6f 6c 64 69 6e 67 20 61 egment holding a
0550: 20 6c 69 73 74 20 6f 66 20 54 72 61 63 6b 20 50 list of Track P
0560: 6f 69 6e 74 73 20 77 68 69 63 68 20 61 72 65 20 oints which are
0570: 6c 6f 67 69 63 61 6c 6c 79 20 63 6f 6e 6e 65 63 logically connec
0580: 74 65 64 20 69 6e 20 6f 72 64 65 72 2e 3c 62 72 ted in order.<br
0590: 3e 0d 0a 41 20 54 72 61 63 6b 20 63 61 6e 20 63 >..A Track can c
05a0: 6f 6e 74 61 69 6e 20 6d 6f 72 65 20 53 65 67 6d ontain more Segm
05b0: 65 6e 74 73 2c 20 61 6e 64 20 6d 6f 72 65 20 54 ents, and more T
05c0: 72 61 63 6b 73 20 63 61 6e 20 62 65 20 73 74 6f racks can be sto
05d0: 72 65 64 20 69 6e 74 6f 20 74 68 65 20 73 61 6d red into the sam
05e0: 65 20 47 50 58 20 66 69 6c 65 2e 3c 2f 6c 69 3e e GPX file.</li>
05f0: 0d 0a 3c 6c 69 3e 3c 62 3e 57 61 79 50 6f 69 6e ..<li><b>WayPoin
0600: 74 73 3c 2f 62 3e 3c 2f 62 3e 3a 20 61 20 57 61 ts</b></b>: a Wa
0610: 79 50 6f 69 6e 74 20 63 6f 6e 73 69 73 74 73 20 yPoint consists
0620: 6f 66 20 74 68 65 20 57 47 53 20 38 34 20 28 47 of the WGS 84 (G
0630: 50 53 29 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 PS) coordinates
0640: 6f 66 20 61 20 70 6f 69 6e 74 20 61 6e 64 20 70 of a point and p
0650: 6f 73 73 69 62 6c 79 20 6f 74 68 65 72 20 64 65 ossibly other de
0660: 73 63 72 69 70 74 69 76 65 20 69 6e 66 6f 72 6d scriptive inform
0670: 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 54 68 65 20 ation.<br>..The
0680: 73 61 6d 65 20 47 50 58 20 66 69 6c 65 20 63 61 same GPX file ca
0690: 6e 20 63 6f 6e 74 61 69 6e 20 61 20 63 6f 6c 6c n contain a coll
06a0: 65 63 74 69 6f 6e 20 6f 66 20 6d 61 6e 79 20 57 ection of many W
06b0: 61 79 50 6f 69 6e 74 73 20 77 69 74 68 20 6e 6f ayPoints with no
06c0: 20 73 65 71 75 65 6e 74 69 61 6c 20 72 65 6c 61 sequential rela
06d0: 74 69 6f 6e 73 68 69 70 2e 3c 2f 6c 69 3e 0d 0a tionship.</li>..
06e0: 3c 6c 69 3e 3c 62 3e 52 6f 75 74 65 73 3c 2f 62 <li><b>Routes</b
06f0: 3e 3a 20 61 20 52 6f 75 74 65 20 69 73 20 61 6e >: a Route is an
0700: 20 6f 72 64 65 72 65 64 20 6c 69 73 74 20 6f 66 ordered list of
0710: 20 72 6f 75 74 65 70 6f 69 6e 74 73 20 28 77 61 routepoints (wa
0720: 79 70 6f 69 6e 74 73 20 72 65 70 72 65 73 65 6e ypoints represen
0730: 74 69 6e 67 20 61 20 73 65 72 69 65 73 20 6f 66 ting a series of
0740: 20 73 69 67 6e 69 66 69 63 61 6e 74 20 74 75 72 significant tur
0750: 6e 20 6f 72 20 73 74 61 67 65 20 70 6f 69 6e 74 n or stage point
0760: 73 29 20 6c 65 61 64 69 6e 67 20 74 6f 20 61 20 s) leading to a
0770: 64 65 73 74 69 6e 61 74 69 6f 6e 2e 3c 2f 6c 69 destination.</li
0780: 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 53 70 >..</ul><br>..Sp
0790: 61 74 69 61 4c 69 74 65 20 6f 6e 6c 79 20 73 75 atiaLite only su
07a0: 70 70 6f 72 74 73 20 3c 62 3e 47 50 58 20 54 72 pports <b>GPX Tr
07b0: 61 63 6b 73 3c 2f 62 3e 20 61 6e 64 20 77 69 6c acks</b> and wil
07c0: 6c 20 61 6c 77 61 79 73 20 73 69 6c 65 6e 74 6c l always silentl
07d0: 79 20 69 67 6e 6f 72 65 20 61 6e 79 20 6f 74 68 y ignore any oth
07e0: 65 72 20 63 6f 6e 74 65 6e 74 2e 3c 62 72 3e 3c er content.<br><
07f0: 62 72 3e 0d 0a 3c 68 33 3e 41 6e 61 74 6f 6d 79 br>..<h3>Anatomy
0800: 20 6f 66 20 61 20 47 50 58 20 66 69 6c 65 20 63 of a GPX file c
0810: 6f 6e 74 61 69 6e 69 6e 67 20 61 20 47 50 53 20 ontaining a GPS
0820: 54 72 61 63 6b 3c 2f 68 33 3e 0d 0a 49 66 20 79 Track</h3>..If y
0830: 6f 75 20 61 72 65 20 69 6e 74 65 72 65 73 74 65 ou are intereste
0840: 64 20 69 6e 74 6f 20 47 50 53 20 54 72 61 63 6b d into GPS Track
0850: 73 20 79 6f 75 27 6c 6c 20 76 65 72 79 20 70 72 s you'll very pr
0860: 6f 62 61 62 6c 79 20 68 61 76 65 20 6c 6f 74 73 obably have lots
0870: 20 6f 66 20 47 50 58 20 66 69 6c 65 73 20 6f 66 of GPX files of
0880: 20 79 6f 75 72 20 6f 77 6e 20 74 68 61 74 20 79 your own that y
0890: 6f 75 20 63 61 6e 20 75 73 65 20 61 73 20 74 65 ou can use as te
08a0: 73 74 20 73 61 6d 70 6c 65 73 2e 3c 62 72 3e 0d st samples.<br>.
08b0: 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 65 .The following e
08c0: 78 61 6d 70 6c 65 73 20 75 73 65 20 74 68 69 73 xamples use this
08d0: 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f <a href="http:/
08e0: 2f 77 77 77 2e 73 68 6d 75 6d 61 2e 72 75 2f 77 /www.shmuma.ru/w
08f0: 69 6b 69 2f 69 6d 61 67 65 73 2f 35 2f 35 31 2f iki/images/5/51/
0900: 47 70 78 2d 66 75 6c 6c 2d 73 61 6d 70 6c 65 2e Gpx-full-sample.
0910: 67 70 78 22 3e 47 50 58 20 73 61 6d 70 6c 65 3c gpx">GPX sample<
0920: 2f 61 3e 3c 62 72 3e 0d 0a 3c 76 65 72 62 61 74 /a><br>..<verbat
0930: 69 6d 3e 0d 0a 3c 3f 78 6d 6c 20 76 65 72 73 69 im>..<?xml versi
0940: 6f 6e 3d 22 31 2e 30 22 3f 3e 0d 0a 3c 67 70 78 on="1.0"?>..<gpx
0950: 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 78 version="1.0" x
0960: 6d 6c 6e 73 3d 22 68 74 74 70 3a 2f 2f 77 77 77 mlns="http://www
0970: 2e 74 6f 70 6f 67 72 61 66 69 78 2e 63 6f 6d 2f .topografix.com/
0980: 47 50 58 2f 31 2f 30 22 3e 0d 0a 20 20 3c 74 72 GPX/1/0">.. <tr
0990: 6b 3e 0d 0a 20 20 20 20 3c 74 72 6b 73 65 67 3e k>.. <trkseg>
09a0: 0d 0a 20 20 20 20 20 20 3c 74 72 6b 70 74 20 6c .. <trkpt l
09b0: 61 74 3d 22 35 35 2e 37 35 33 35 37 32 22 20 6c at="55.753572" l
09c0: 6f 6e 3d 22 33 37 2e 38 30 38 32 35 30 22 3e 0d on="37.808250">.
09d0: 0a 20 20 20 20 20 20 20 20 3c 65 6c 65 3e 31 33 . <ele>13
09e0: 35 2e 30 30 3c 2f 65 6c 65 3e 0d 0a 20 20 20 20 5.00</ele>..
09f0: 20 20 20 20 3c 74 69 6d 65 3e 32 30 30 39 2d 30 <time>2009-0
0a00: 35 2d 31 39 54 30 34 3a 30 30 3a 33 30 5a 3c 2f 5-19T04:00:30Z</
0a10: 74 69 6d 65 3e 0d 0a 20 20 20 20 20 20 3c 2f 74 time>.. </t
0a20: 72 6b 70 74 3e 0d 0a 20 20 20 20 20 20 3c 74 72 rkpt>.. <tr
0a30: 6b 70 74 20 6c 61 74 3d 22 35 35 2e 37 35 33 36 kpt lat="55.7536
0a40: 32 32 22 20 6c 6f 6e 3d 22 33 37 2e 38 30 38 32 22" lon="37.8082
0a50: 35 35 22 3e 0d 0a 20 20 20 20 20 20 20 20 3c 65 55">.. <e
0a60: 6c 65 3e 31 33 35 2e 30 30 3c 2f 65 6c 65 3e 0d le>135.00</ele>.
0a70: 0a 20 20 20 20 20 20 20 20 3c 74 69 6d 65 3e 32 . <time>2
0a80: 30 30 39 2d 30 35 2d 31 39 54 30 34 3a 30 30 3a 009-05-19T04:00:
0a90: 33 31 5a 3c 2f 74 69 6d 65 3e 0d 0a 20 20 20 20 31Z</time>..
0aa0: 20 20 3c 2f 74 72 6b 70 74 3e 0d 0a 20 20 20 20 </trkpt>..
0ab0: 20 20 3c 74 72 6b 70 74 20 6c 61 74 3d 22 35 35 <trkpt lat="55
0ac0: 2e 37 35 33 35 39 33 22 20 6c 6f 6e 3d 22 33 37 .753593" lon="37
0ad0: 2e 38 30 38 31 35 38 22 3e 0d 0a 20 20 20 20 20 .808158">..
0ae0: 20 20 20 3c 65 6c 65 3e 31 33 35 2e 30 30 3c 2f <ele>135.00</
0af0: 65 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 3c 74 ele>.. <t
0b00: 69 6d 65 3e 32 30 30 39 2d 30 35 2d 31 39 54 30 ime>2009-05-19T0
0b10: 34 3a 30 30 3a 33 32 5a 3c 2f 74 69 6d 65 3e 0d 4:00:32Z</time>.
0b20: 0a 20 20 20 20 20 20 3c 2f 74 72 6b 70 74 3e 0d . </trkpt>.
0b30: 0a 2e 2e 2e 2e 0d 0a 20 20 20 20 20 20 3c 74 72 ....... <tr
0b40: 6b 70 74 20 6c 61 74 3d 22 35 35 2e 37 35 38 31 kpt lat="55.7581
0b50: 37 37 22 20 6c 6f 6e 3d 22 33 37 2e 36 37 37 38 77" lon="37.6778
0b60: 30 32 22 3e 0d 0a 20 20 20 20 20 20 20 20 3c 65 02">.. <e
0b70: 6c 65 3e 31 35 32 2e 30 30 3c 2f 65 6c 65 3e 0d le>152.00</ele>.
0b80: 0a 20 20 20 20 20 20 20 20 3c 74 69 6d 65 3e 32 . <time>2
0b90: 30 30 39 2d 30 35 2d 31 39 54 30 34 3a 34 36 3a 009-05-19T04:46:
0ba0: 32 37 5a 3c 2f 74 69 6d 65 3e 0d 0a 20 20 20 20 27Z</time>..
0bb0: 20 20 3c 2f 74 72 6b 70 74 3e 0d 0a 20 20 20 20 </trkpt>..
0bc0: 3c 2f 74 72 6b 73 65 67 3e 0d 0a 20 20 3c 2f 74 </trkseg>.. </t
0bd0: 72 6b 3e 0d 0a 3c 2f 67 70 78 3e 0d 0a 3c 2f 76 rk>..</gpx>..</v
0be0: 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 6c 3e 0d 0a erbatim>..<ul>..
0bf0: 3c 6c 69 3e 74 68 65 20 77 68 6f 6c 65 20 47 50 <li>the whole GP
0c00: 58 20 66 69 6c 65 20 69 73 20 65 6e 63 6c 6f 73 X file is enclos
0c10: 65 64 20 77 69 74 68 69 6e 20 3c 62 3e 26 6c 74 ed within <b><
0c20: 3b 67 70 78 26 67 74 3b 3c 2f 62 3e 20 61 6e 64 ;gpx></b> and
0c30: 20 3c 62 3e 26 6c 74 3b 2f 67 70 78 26 67 74 3b <b></gpx>
0c40: 3c 2f 62 3e 20 74 61 67 73 2e 3c 2f 6c 69 3e 0d </b> tags.</li>.
0c50: 0a 3c 6c 69 3e 65 61 63 68 20 54 72 61 63 6b 20 .<li>each Track
0c60: 69 73 20 64 65 6c 69 6d 69 74 65 64 20 62 79 20 is delimited by
0c70: 61 20 6d 61 74 63 68 69 6e 67 20 70 61 69 72 20 a matching pair
0c80: 6f 66 20 3c 62 3e 26 6c 74 3b 74 72 6b 26 67 74 of <b><trk>
0c90: 3b 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 26 6c 74 ;</b> and <b><
0ca0: 3b 2f 74 72 6b 26 67 74 3b 3c 2f 62 3e 20 74 61 ;/trk></b> ta
0cb0: 67 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 65 61 gs.</li>..<li>ea
0cc0: 63 68 20 54 72 61 63 6b 20 53 65 67 6d 65 6e 74 ch Track Segment
0cd0: 20 69 73 20 64 65 6c 69 6d 69 74 65 64 20 62 79 is delimited by
0ce0: 20 61 20 6d 61 74 63 68 69 6e 67 20 70 61 69 72 a matching pair
0cf0: 20 6f 66 20 3c 62 3e 26 6c 74 3b 74 72 6b 73 65 of <b><trkse
0d00: 67 26 67 74 3b 3c 2f 62 3e 20 61 6e 64 20 3c 62 g></b> and <b
0d10: 3e 26 6c 74 3b 2f 74 72 6b 73 65 67 26 67 74 3b ></trkseg>
0d20: 3c 2f 62 3e 20 74 61 67 73 2e 3c 2f 6c 69 3e 0d </b> tags.</li>.
0d30: 0a 3c 6c 69 3e 65 61 63 68 20 54 72 61 63 6b 20 .<li>each Track
0d40: 50 6f 69 6e 74 20 69 73 20 65 6e 63 6c 6f 73 65 Point is enclose
0d50: 64 20 77 69 74 68 69 6e 20 3c 62 3e 26 6c 74 3b d within <b><
0d60: 74 72 6b 70 74 26 67 74 3b 3c 2f 62 3e 20 61 6e trkpt></b> an
0d70: 64 20 3c 62 3e 26 6c 74 3b 2f 74 72 6b 70 74 26 d <b></trkpt&
0d80: 67 74 3b 3c 2f 62 3e 20 74 61 67 73 2e 0d 0a 3c gt;</b> tags...<
0d90: 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e ul>..<li>the <b>
0da0: 6c 61 74 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 6c lat</b> and <b>l
0db0: 6f 6e 3c 2f 62 3e 20 6d 61 6e 64 61 74 6f 72 79 on</b> mandatory
0dc0: 20 61 74 74 72 69 62 75 74 65 73 20 61 72 65 20 attributes are
0dd0: 69 6e 74 65 6e 64 65 64 20 74 6f 20 64 65 63 6c intended to decl
0de0: 61 72 65 20 74 68 65 20 57 47 53 20 38 34 20 3c are the WGS 84 <
0df0: 62 3e 3c 69 3e 6c 61 74 69 74 75 64 65 3c 2f 69 b><i>latitude</i
0e00: 3e 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 3c 69 3e ></b> and <b><i>
0e10: 6c 6f 6e 67 69 74 75 64 65 3c 2f 69 3e 3c 2f 62 longitude</i></b
0e20: 3e 20 6f 66 20 74 68 65 20 70 6f 69 6e 74 2e 3c > of the point.<
0e30: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 /li>..<li>the <b
0e40: 3e 3c 69 3e 65 6c 65 76 61 74 69 6f 6e 3c 2f 69 ><i>elevation</i
0e50: 3e 3c 2f 62 3e 20 6f 66 20 74 68 65 20 70 6f 69 ></b> of the poi
0e60: 6e 74 20 28 6d 65 61 73 75 72 65 64 20 69 6e 20 nt (measured in
0e70: 6d 65 74 65 72 73 29 20 63 61 6e 20 62 65 20 6f meters) can be o
0e80: 70 74 69 6f 6e 61 6c 6c 79 20 64 65 63 6c 61 72 ptionally declar
0e90: 65 64 20 77 69 74 68 69 6e 20 61 20 70 61 69 72 ed within a pair
0ea0: 20 6f 66 20 3c 62 3e 26 6c 74 3b 65 6c 65 26 67 of <b><ele&g
0eb0: 74 3b 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 26 6c t;</b> and <b>&l
0ec0: 74 3b 2f 65 6c 65 26 67 74 3b 3c 2f 62 3e 20 74 t;/ele></b> t
0ed0: 61 67 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 ags.</li>..<li>t
0ee0: 68 65 20 3c 62 3e 3c 69 3e 64 61 74 65 20 61 6e he <b><i>date an
0ef0: 64 20 74 69 6d 65 3c 2f 69 3e 3c 2f 62 3e 20 6f d time</i></b> o
0f00: 66 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 f the correspond
0f10: 69 6e 67 20 47 50 53 20 6d 65 61 73 75 72 65 20 ing GPS measure
0f20: 63 61 6e 20 62 65 20 6f 70 74 69 6f 6e 61 6c 6c can be optionall
0f30: 79 20 64 65 63 6c 61 72 65 64 20 77 69 74 68 69 y declared withi
0f40: 6e 20 61 20 70 61 69 72 20 6f 66 20 3c 62 3e 26 n a pair of <b>&
0f50: 6c 74 3b 74 69 6d 65 26 67 74 3b 3c 2f 62 3e 20 lt;time></b>
0f60: 61 6e 64 20 3c 62 3e 26 6c 74 3b 2f 74 69 6d 65 and <b></time
0f70: 26 67 74 3b 3c 2f 62 3e 20 74 61 67 73 2e 3c 62 ></b> tags.<b
0f80: 72 3e 0d 0a 44 61 74 65 73 20 61 6e 64 20 74 69 r>..Dates and ti
0f90: 6d 65 73 20 61 72 65 20 6e 6f 74 20 6c 6f 63 61 mes are not loca
0fa0: 6c 20 74 69 6d 65 2c 20 62 75 74 20 69 6e 73 74 l time, but inst
0fb0: 65 61 64 20 61 72 65 20 3c 61 20 68 72 65 66 3d ead are <a href=
0fc0: 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 "https://en.wiki
0fd0: 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 43 pedia.org/wiki/C
0fe0: 6f 6f 72 64 69 6e 61 74 65 64 5f 55 6e 69 76 65 oordinated_Unive
0ff0: 72 73 61 6c 5f 54 69 6d 65 22 3e 43 6f 6f 72 64 rsal_Time">Coord
1000: 69 6e 61 74 65 64 20 55 6e 69 76 65 72 73 61 6c inated Universal
1010: 20 54 69 6d 65 3c 2f 61 3e 20 28 3c 62 3e 55 54 Time</a> (<b>UT
1020: 43 3c 2f 62 3e 29 20 75 73 69 6e 67 20 3c 61 20 C</b>) using <a
1030: 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e href="https://en
1040: 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 .wikipedia.org/w
1050: 69 6b 69 2f 49 53 4f 5f 38 36 30 31 22 3e 49 53 iki/ISO_8601">IS
1060: 4f 20 38 36 30 31 3c 2f 61 3e 20 66 6f 72 6d 61 O 8601</a> forma
1070: 74 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f t.</li>..</ul></
1080: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 li>..</ul>..</td
1090: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e ></tr>..</table>
10a0: 3c 62 72 3e 0d 0a 3c 68 72 3e 3c 62 72 3e 0d 0a <br>..<hr><br>..
10b0: 3c 68 32 3e 49 6d 70 6f 72 74 69 6e 67 20 47 50 <h2>Importing GP
10c0: 58 20 74 72 61 63 6b 73 20 69 6e 74 6f 20 61 20 X tracks into a
10d0: 53 70 61 74 69 61 4c 69 74 65 20 47 65 6f 54 61 SpatiaLite GeoTa
10e0: 62 6c 65 3c 2f 68 32 3e 0d 0a 3c 76 65 72 62 61 ble</h2>..<verba
10f0: 74 69 6d 3e 0d 0a 43 52 45 41 54 45 20 54 41 42 tim>..CREATE TAB
1100: 4c 45 20 72 61 77 5f 67 70 78 20 28 0d 0a 20 20 LE raw_gpx (..
1110: 20 20 69 64 5f 67 70 78 20 49 4e 54 45 47 45 52 id_gpx INTEGER
1120: 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 55 54 PRIMARY KEY AUT
1130: 4f 49 4e 43 52 45 4d 45 4e 54 2c 0d 0a 20 20 20 OINCREMENT,..
1140: 20 67 70 78 20 42 4c 4f 42 20 4e 4f 54 20 20 4e gpx BLOB NOT N
1150: 55 4c 4c 29 3b 0d 0a 0d 0a 49 4e 53 45 52 54 20 ULL);....INSERT
1160: 49 4e 54 4f 20 72 61 77 5f 67 70 78 20 56 41 4c INTO raw_gpx VAL
1170: 55 45 53 20 28 4e 55 4c 4c 2c 20 58 42 5f 43 72 UES (NULL, XB_Cr
1180: 65 61 74 65 28 58 42 5f 4c 6f 61 64 58 4d 4c 28 eate(XB_LoadXML(
1190: 27 47 70 78 2d 66 75 6c 6c 2d 73 61 6d 70 6c 65 'Gpx-full-sample
11a0: 2e 67 70 78 27 29 29 29 3b 0d 0a 0d 0a 53 45 4c .gpx')));....SEL
11b0: 45 43 54 20 69 64 5f 67 70 78 2c 20 58 42 5f 49 ECT id_gpx, XB_I
11c0: 73 47 50 58 28 67 70 78 29 20 0d 0a 46 52 4f 4d sGPX(gpx) ..FROM
11d0: 20 72 61 77 5f 67 70 78 3b 0d 0a 2d 2d 2d 2d 2d raw_gpx;..-----
11e0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a --------------..
11f0: 31 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 1..</verbatim>..
1200: 53 69 6e 63 65 20 47 50 58 20 66 69 6c 65 73 20 Since GPX files
1210: 61 72 65 20 58 4d 4c 20 66 69 6c 65 73 2c 20 79 are XML files, y
1220: 6f 75 20 6d 75 73 74 20 75 73 65 20 74 68 65 20 ou must use the
1230: 73 74 61 6e 64 61 72 64 20 53 51 4c 20 66 75 6e standard SQL fun
1240: 63 74 69 6f 6e 73 20 73 75 70 70 6f 72 74 69 6e ctions supportin
1250: 67 20 67 65 6e 65 72 69 63 20 58 4d 4c 2e 3c 62 g generic XML.<b
1260: 72 3e 0d 0a 3c 62 3e 58 42 5f 49 73 47 50 58 28 r>..<b>XB_IsGPX(
1270: 29 3c 2f 62 3e 20 69 73 20 61 20 6e 65 77 20 53 )</b> is a new S
1280: 51 4c 20 66 75 6e 63 74 69 6f 6e 20 69 6e 74 72 QL function intr
1290: 6f 64 75 63 65 64 20 62 79 20 53 70 61 74 69 61 oduced by Spatia
12a0: 4c 69 74 65 20 3c 62 3e 34 2e 34 2e 30 3c 2f 62 Lite <b>4.4.0</b
12b0: 3e 3b 20 69 74 20 77 69 6c 6c 20 74 65 73 74 20 >; it will test
12c0: 74 68 65 20 61 63 74 75 61 6c 20 58 4d 4c 20 69 the actual XML i
12d0: 6e 70 75 74 20 61 6e 64 20 77 69 6c 6c 20 72 65 nput and will re
12e0: 74 75 72 6e 20 3c 62 3e 31 3c 2f 62 3e 20 69 66 turn <b>1</b> if
12f0: 20 69 74 20 72 65 61 6c 6c 79 20 69 73 20 6f 66 it really is of
1300: 20 74 68 65 20 47 50 58 20 74 79 70 65 2c 20 3c the GPX type, <
1310: 62 3e 30 3c 2f 62 3e 20 69 66 20 6e 6f 74 2c 20 b>0</b> if not,
1320: 61 6e 64 20 3c 62 3e 2d 31 3c 2f 62 3e 20 77 68 and <b>-1</b> wh
1330: 65 6e 20 74 68 65 20 70 61 73 73 65 64 20 61 72 en the passed ar
1340: 67 75 6d 65 6e 74 20 69 73 20 6e 6f 74 20 61 20 gument is not a
1350: 76 61 6c 69 64 20 58 4d 4c 20 64 6f 63 75 6d 65 valid XML docume
1360: 6e 74 2e 3c 62 72 3e 0d 0a 3c 76 65 72 62 61 74 nt.<br>..<verbat
1370: 69 6d 3e 0d 0a 43 52 45 41 54 45 20 54 41 42 4c im>..CREATE TABL
1380: 45 20 67 70 78 5f 74 72 61 63 6b 73 20 28 0d 0a E gpx_tracks (..
1390: 20 20 20 20 69 64 5f 74 72 6b 20 49 4e 54 45 47 id_trk INTEG
13a0: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 ER PRIMARY KEY A
13b0: 55 54 4f 49 4e 43 52 45 4d 45 4e 54 29 3b 0d 0a UTOINCREMENT);..
13c0: 0d 0a 53 45 4c 45 43 54 20 41 64 64 47 65 6f 6d ..SELECT AddGeom
13d0: 65 74 72 79 43 6f 6c 75 6d 6e 28 27 67 70 78 5f etryColumn('gpx_
13e0: 74 72 61 63 6b 73 27 2c 20 27 67 65 6f 6d 27 2c tracks', 'geom',
13f0: 20 34 33 32 36 2c 20 27 4d 55 4c 54 49 4c 49 4e 4326, 'MULTILIN
1400: 45 53 54 52 49 4e 47 27 2c 20 27 58 59 5a 4d 27 ESTRING', 'XYZM'
1410: 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d );..------------
1420: 2d 0d 0a 31 0d 0a 0d 0a 49 4e 53 45 52 54 20 49 -..1....INSERT I
1430: 4e 54 4f 20 67 70 78 5f 74 72 61 63 6b 73 20 0d NTO gpx_tracks .
1440: 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 58 42 .SELECT NULL, XB
1450: 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 28 67 70 _MLineFromGPX(gp
1460: 78 29 0d 0a 46 52 4f 4d 20 72 61 77 5f 67 70 78 x)..FROM raw_gpx
1470: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
1480: 4e 6f 77 20 77 65 27 6c 6c 20 63 72 65 61 74 65 Now we'll create
1490: 20 61 6e 6f 74 68 65 72 20 74 61 62 6c 65 20 69 another table i
14a0: 6e 63 6c 75 64 69 6e 67 20 61 20 47 65 6f 6d 65 ncluding a Geome
14b0: 74 72 79 20 63 6f 6c 75 6d 6e 20 64 65 63 6c 61 try column decla
14c0: 72 65 64 20 6f 66 20 74 68 65 20 3c 62 3e 4d 55 red of the <b>MU
14d0: 4c 54 49 4c 49 4e 45 53 54 52 49 4e 47 3c 2f 62 LTILINESTRING</b
14e0: 3e 20 74 79 70 65 20 61 6e 64 20 68 61 76 69 6e > type and havin
14f0: 67 20 3c 62 3e 58 59 5a 4d 3c 2f 62 3e 20 64 69 g <b>XYZM</b> di
1500: 6d 65 6e 73 69 6f 6e 73 2e 20 54 68 65 20 53 52 mensions. The SR
1510: 49 44 20 66 6f 72 20 74 68 69 73 20 47 65 6f 6d ID for this Geom
1520: 65 74 72 79 20 3c 62 3e 6d 75 73 74 3c 2f 62 3e etry <b>must</b>
1530: 20 62 65 20 3c 62 3e 34 33 32 36 3c 2f 62 3e 20 be <b>4326</b>
1540: 28 61 6c 69 61 73 20 3c 62 3e 57 47 53 20 38 34 (alias <b>WGS 84
1550: 3c 2f 62 3e 29 2c 20 77 68 69 63 68 20 69 73 20 </b>), which is
1560: 3c 62 3e 61 6c 77 61 79 73 3c 2f 62 3e 20 75 73 <b>always</b> us
1570: 65 64 20 77 69 74 68 20 47 50 53 20 64 61 74 61 ed with GPS data
1580: 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 57 69 74 68 20 .<br><br>..With
1590: 74 68 69 73 2c 20 77 65 20 63 61 6e 20 69 6e 76 this, we can inv
15a0: 6f 6b 65 20 74 68 65 20 6e 65 77 20 3c 62 3e 58 oke the new <b>X
15b0: 42 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 28 29 B_MLineFromGPX()
15c0: 3c 2f 62 3e 20 53 51 4c 20 66 75 6e 63 74 69 6f </b> SQL functio
15d0: 6e 20 77 68 69 63 68 20 77 69 6c 6c 20 70 61 72 n which will par
15e0: 73 65 20 74 68 65 20 47 50 58 20 69 6e 70 75 74 se the GPX input
15f0: 2c 20 70 6f 73 73 69 62 6c 79 20 63 72 65 61 74 , possibly creat
1600: 69 6e 67 20 61 20 4d 75 6c 74 69 4c 69 6e 65 73 ing a MultiLines
1610: 74 72 69 6e 67 20 63 6f 72 72 65 73 70 6f 6e 64 tring correspond
1620: 69 6e 67 20 74 6f 20 61 6c 6c 20 6f 66 20 74 68 ing to all of th
1630: 65 20 54 72 61 63 6b 2d 53 65 67 6d 65 6e 74 73 e Track-Segments
1640: 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 65 20 defined in the
1650: 47 50 58 2d 46 69 6c 65 2e 3c 62 72 3e 0d 0a 50 GPX-File.<br>..P
1660: 6c 65 61 73 65 20 6e 6f 74 65 3a 0d 0a 3c 75 6c lease note:..<ul
1670: 3e 0d 0a 3c 6c 69 3e 58 42 5f 4d 4c 69 6e 65 46 >..<li>XB_MLineF
1680: 72 6f 6d 47 50 58 28 29 20 77 69 6c 6c 20 72 65 romGPX() will re
1690: 74 75 72 6e 20 3c 62 3e 4e 55 4c 4c 3c 2f 62 3e turn <b>NULL</b>
16a0: 20 69 66 20 65 69 74 68 65 72 20 74 68 65 20 70 if either the p
16b0: 61 73 73 65 64 20 61 72 67 75 6d 65 6e 74 20 69 assed argument i
16c0: 73 20 6e 6f 74 20 61 20 76 61 6c 69 64 20 42 4c s not a valid BL
16d0: 4f 42 2c 20 6f 72 20 69 74 27 73 20 61 20 76 61 OB, or it's a va
16e0: 6c 69 64 20 42 4c 4f 42 20 62 75 74 20 6e 6f 74 lid BLOB but not
16f0: 20 6f 66 20 74 68 65 20 47 50 58 20 74 79 70 65 of the GPX type
1700: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 42 5f 4d .</li>..<li>XB_M
1710: 4c 69 6e 65 46 72 6f 6d 47 50 58 28 29 20 77 69 LineFromGPX() wi
1720: 6c 6c 20 72 65 74 75 72 6e 20 61 20 3c 62 3e 4e ll return a <b>N
1730: 55 4c 4c 3c 2f 62 3e 20 76 61 6c 75 65 2c 20 69 ULL</b> value, i
1740: 66 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 63 6f f it does not co
1750: 6e 74 61 69 6e 73 20 61 6e 79 20 54 72 61 63 6b ntains any Track
1760: 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 77 68 65 s.</li>..<li>whe
1770: 6e 20 73 75 63 63 65 73 73 66 75 6c 2c 20 74 68 n successful, th
1780: 65 20 72 65 74 75 72 6e 65 64 20 47 65 6f 6d 65 e returned Geome
1790: 74 72 79 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 try will always
17a0: 62 65 20 61 20 4d 75 6c 74 69 4c 69 6e 65 73 74 be a MultiLinest
17b0: 72 69 6e 67 2c 20 61 6e 64 20 61 20 64 69 73 74 ring, and a dist
17c0: 69 6e 63 74 20 4c 69 6e 65 73 74 72 69 6e 67 20 inct Linestring
17d0: 77 69 6c 6c 20 62 65 20 63 72 65 61 74 65 64 20 will be created
17e0: 69 6e 73 69 64 65 20 66 6f 72 20 65 76 65 72 79 inside for every
17f0: 20 3c 62 3e 54 72 61 63 6b 20 53 65 67 6d 65 6e <b>Track Segmen
1800: 74 3c 2f 62 3e 20 66 6f 75 6e 64 20 77 69 74 68 t</b> found with
1810: 69 6e 20 74 68 65 20 47 50 58 2d 46 69 6c 65 2e in the GPX-File.
1820: 3c 62 72 3e 0d 0a 45 61 63 68 20 3c 62 3e 54 72 <br>..Each <b>Tr
1830: 61 63 6b 50 6f 69 6e 74 3c 2f 62 3e 20 77 69 6c ackPoint</b> wil
1840: 6c 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 6f 20 l correspond to
1850: 61 20 56 65 72 74 65 78 20 6f 66 20 74 68 65 20 a Vertex of the
1860: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 4c 69 corresponding Li
1870: 6e 65 73 74 72 69 6e 67 0d 0a 3c 75 6c 3e 0d 0a nestring..<ul>..
1880: 3c 6c 69 3e 74 68 65 20 3c 62 3e 58 3c 2f 62 3e <li>the <b>X</b>
1890: 20 61 6e 64 20 3c 62 3e 59 3c 2f 62 3e 20 63 6f and <b>Y</b> co
18a0: 6f 72 64 69 6e 61 74 65 73 20 6f 66 20 74 68 65 ordinates of the
18b0: 20 56 65 72 74 65 78 20 77 69 6c 6c 20 62 65 20 Vertex will be
18c0: 73 65 74 20 61 63 63 6f 72 64 69 6e 67 6c 79 20 set accordingly
18d0: 74 6f 20 74 68 65 20 64 65 63 6c 61 72 65 64 20 to the declared
18e0: 3c 62 3e 3c 69 3e 6c 6f 6e 3c 2f 69 3e 3c 2f 62 <b><i>lon</i></b
18f0: 3e 20 61 6e 64 20 3c 62 3e 3c 69 3e 6c 61 74 3c > and <b><i>lat<
1900: 2f 69 3e 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a 3c /i></b>.</li>..<
1910: 6c 69 3e 69 66 20 61 6e 20 3c 62 3e 3c 69 3e 65 li>if an <b><i>e
1920: 6c 65 3c 2f 69 3e 3c 2f 62 3e 20 74 61 67 20 77 le</i></b> tag w
1930: 61 73 20 64 65 63 6c 61 72 65 64 20 74 68 65 20 as declared the
1940: 3c 62 3e 5a 3c 2f 62 3e 20 63 6f 6f 72 64 69 6e <b>Z</b> coordin
1950: 61 74 65 20 77 69 6c 6c 20 62 65 20 73 65 74 20 ate will be set
1960: 74 6f 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e to the correspon
1970: 64 69 6e 67 20 76 61 6c 75 65 2e 3c 62 72 3e 0d ding value.<br>.
1980: 0a 4f 74 68 65 72 77 69 73 65 20 74 68 65 20 3c .Otherwise the <
1990: 62 3e 5a 3c 2f 62 3e 20 63 6f 6f 72 64 69 6e 61 b>Z</b> coordina
19a0: 74 65 20 77 69 6c 6c 20 62 65 20 73 65 74 20 74 te will be set t
19b0: 6f 20 3c 62 3e 30 2e 30 3c 2f 62 3e 20 28 64 65 o <b>0.0</b> (de
19c0: 66 61 75 6c 74 20 76 61 6c 75 65 29 2e 3c 2f 6c fault value).</l
19d0: 69 3e 0d 0a 3c 6c 69 3e 69 66 20 61 20 3c 62 3e i>..<li>if a <b>
19e0: 3c 69 3e 74 69 6d 65 3c 2f 69 3e 3c 2f 62 3e 20 <i>time</i></b>
19f0: 74 61 67 20 77 61 73 20 64 65 63 6c 61 72 65 64 tag was declared
1a00: 2c 20 74 68 65 20 49 53 4f 20 38 36 30 31 20 74 , the ISO 8601 t
1a10: 69 6d 65 73 74 61 6d 70 20 77 69 6c 6c 20 62 65 imestamp will be
1a20: 20 74 72 61 6e 73 66 6f 72 6d 65 64 20 69 6e 74 transformed int
1a30: 6f 20 61 20 3c 61 20 68 72 65 66 3d 22 68 74 74 o a <a href="htt
1a40: 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 ps://en.wikipedi
1a50: 61 2e 6f 72 67 2f 77 69 6b 69 2f 4a 75 6c 69 61 a.org/wiki/Julia
1a60: 6e 5f 64 61 79 22 3e 6a 75 6c 69 61 6e 20 64 61 n_day">julian da
1a70: 79 20 6e 75 6d 62 65 72 3c 2f 61 3e 2c 20 61 6e y number</a>, an
1a80: 64 20 74 68 65 20 3c 62 3e 4d 3c 2f 62 3e 20 63 d the <b>M</b> c
1a90: 6f 6f 72 64 69 6e 61 74 65 20 77 69 6c 6c 20 62 oordinate will b
1aa0: 65 20 73 65 74 20 74 6f 20 74 68 65 20 63 6f 72 e set to the cor
1ab0: 72 65 73 70 6f 6e 64 69 6e 67 20 76 61 6c 75 65 responding value
1ac0: 2e 3c 62 72 3e 0d 0a 4f 74 68 65 72 77 69 73 65 .<br>..Otherwise
1ad0: 20 74 68 65 20 3c 62 3e 4d 3c 2f 62 3e 20 63 6f the <b>M</b> co
1ae0: 6f 72 64 69 6e 61 74 65 20 77 69 6c 6c 20 62 65 ordinate will be
1af0: 20 73 65 74 20 74 6f 20 3c 62 3e 31 37 32 31 30 set to <b>17210
1b00: 35 39 2e 35 3c 2f 62 3e 2c 20 74 68 69 73 20 63 59.5</b>, this c
1b10: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 orresponding to
1b20: 3c 62 3e 30 30 30 30 2d 30 31 2d 30 31 54 30 30 <b>0000-01-01T00
1b30: 3a 30 30 3a 30 30 5a 3c 2f 62 3e 20 28 64 65 66 :00:00Z</b> (def
1b40: 61 75 6c 74 20 76 61 6c 75 65 29 2e 3c 2f 6c 69 ault value).</li
1b50: 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 6c 69 3e 20 >..</ul>..</li>
1b60: 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c 68 72 ..</ul><br>..<hr
1b70: 3e 0d 0a 3c 68 32 3e 43 68 65 63 6b 69 6e 67 20 >..<h2>Checking
1b80: 74 68 65 20 69 6d 70 6f 72 74 65 64 20 54 72 61 the imported Tra
1b90: 63 6b 50 6f 69 6e 74 73 3c 2f 68 32 3e 0d 0a 3c ckPoints</h2>..<
1ba0: 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 verbatim>..SELEC
1bb0: 54 20 27 50 6f 69 6e 74 20 23 31 27 20 41 53 20 T 'Point #1' AS
1bc0: 70 6f 69 6e 74 2c 20 53 54 5f 58 28 61 2e 70 74 point, ST_X(a.pt
1bd0: 29 20 41 53 20 6c 6f 6e 2c 20 53 54 5f 59 28 61 ) AS lon, ST_Y(a
1be0: 2e 70 74 29 20 41 53 20 6c 61 74 2c 20 53 54 5f .pt) AS lat, ST_
1bf0: 5a 28 61 2e 70 74 29 20 41 53 20 65 6c 65 2c 20 Z(a.pt) AS ele,
1c00: 44 61 74 65 54 69 6d 65 28 53 54 5f 4d 28 61 2e DateTime(ST_M(a.
1c10: 70 74 29 29 20 41 53 20 74 69 6d 65 0d 0a 46 52 pt)) AS time..FR
1c20: 4f 4d 20 28 53 45 4c 45 43 54 20 53 54 5f 53 74 OM (SELECT ST_St
1c30: 61 72 74 50 6f 69 6e 74 28 67 65 6f 6d 29 20 41 artPoint(geom) A
1c40: 53 20 70 74 20 46 52 4f 4d 20 67 70 78 5f 74 72 S pt FROM gpx_tr
1c50: 61 63 6b 73 29 20 41 53 20 61 0d 0a 55 4e 49 4f acks) AS a..UNIO
1c60: 4e 0d 0a 53 45 4c 45 43 54 20 27 50 6f 69 6e 74 N..SELECT 'Point
1c70: 20 23 32 27 20 41 53 20 70 6f 69 6e 74 2c 20 53 #2' AS point, S
1c80: 54 5f 58 28 61 2e 70 74 29 20 41 53 20 6c 6f 6e T_X(a.pt) AS lon
1c90: 2c 20 53 54 5f 59 28 61 2e 70 74 29 20 41 53 20 , ST_Y(a.pt) AS
1ca0: 6c 61 74 2c 20 53 54 5f 5a 28 61 2e 70 74 29 20 lat, ST_Z(a.pt)
1cb0: 41 53 20 65 6c 65 2c 20 44 61 74 65 54 69 6d 65 AS ele, DateTime
1cc0: 28 53 54 5f 4d 28 61 2e 70 74 29 29 20 41 53 20 (ST_M(a.pt)) AS
1cd0: 74 69 6d 65 0d 0a 46 52 4f 4d 20 28 53 45 4c 45 time..FROM (SELE
1ce0: 43 54 20 53 54 5f 50 6f 69 6e 74 4e 28 67 65 6f CT ST_PointN(geo
1cf0: 6d 2c 20 32 29 20 41 53 20 70 74 20 46 52 4f 4d m, 2) AS pt FROM
1d00: 20 67 70 78 5f 74 72 61 63 6b 73 29 20 41 53 20 gpx_tracks) AS
1d10: 61 0d 0a 55 4e 49 4f 4e 0d 0a 53 45 4c 45 43 54 a..UNION..SELECT
1d20: 20 27 50 6f 69 6e 74 20 23 33 27 20 41 53 20 70 'Point #3' AS p
1d30: 6f 69 6e 74 2c 20 53 54 5f 58 28 61 2e 70 74 29 oint, ST_X(a.pt)
1d40: 20 41 53 20 6c 6f 6e 2c 20 53 54 5f 59 28 61 2e AS lon, ST_Y(a.
1d50: 70 74 29 20 41 53 20 6c 61 74 2c 20 53 54 5f 5a pt) AS lat, ST_Z
1d60: 28 61 2e 70 74 29 20 41 53 20 65 6c 65 2c 20 44 (a.pt) AS ele, D
1d70: 61 74 65 54 69 6d 65 28 53 54 5f 4d 28 61 2e 70 ateTime(ST_M(a.p
1d80: 74 29 29 20 41 53 20 74 69 6d 65 0d 0a 46 52 4f t)) AS time..FRO
1d90: 4d 20 28 53 45 4c 45 43 54 20 53 54 5f 50 6f 69 M (SELECT ST_Poi
1da0: 6e 74 4e 28 67 65 6f 6d 2c 20 33 29 20 41 53 20 ntN(geom, 3) AS
1db0: 70 74 20 46 52 4f 4d 20 67 70 78 5f 74 72 61 63 pt FROM gpx_trac
1dc0: 6b 73 29 20 41 53 20 61 0d 0a 55 4e 49 4f 4e 0d ks) AS a..UNION.
1dd0: 0a 53 45 4c 45 43 54 20 27 50 6f 69 6e 74 20 23 .SELECT 'Point #
1de0: 4e 27 20 41 53 20 70 6f 69 6e 74 2c 20 53 54 5f N' AS point, ST_
1df0: 58 28 61 2e 70 74 29 20 41 53 20 6c 6f 6e 2c 20 X(a.pt) AS lon,
1e00: 53 54 5f 59 28 61 2e 70 74 29 20 41 53 20 6c 61 ST_Y(a.pt) AS la
1e10: 74 2c 20 53 54 5f 5a 28 61 2e 70 74 29 20 41 53 t, ST_Z(a.pt) AS
1e20: 20 65 6c 65 2c 20 44 61 74 65 54 69 6d 65 28 53 ele, DateTime(S
1e30: 54 5f 4d 28 61 2e 70 74 29 29 20 41 53 20 74 69 T_M(a.pt)) AS ti
1e40: 6d 65 0d 0a 46 52 4f 4d 20 28 53 45 4c 45 43 54 me..FROM (SELECT
1e50: 20 53 54 5f 45 6e 64 50 6f 69 6e 74 28 67 65 6f ST_EndPoint(geo
1e60: 6d 29 20 41 53 20 70 74 20 46 52 4f 4d 20 67 70 m) AS pt FROM gp
1e70: 78 5f 74 72 61 63 6b 73 29 20 41 53 20 61 3b 0d x_tracks) AS a;.
1e80: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 74 .</verbatim>..<t
1e90: 61 62 6c 65 20 62 67 63 6f 6c 6f 72 3d 22 23 64 able bgcolor="#d
1ea0: 30 66 66 62 30 22 20 63 65 6c 6c 73 70 61 63 69 0ffb0" cellspaci
1eb0: 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 ng="4" cellpaddi
1ec0: 6e 67 3d 22 34 22 20 62 6f 72 64 65 72 3d 22 31 ng="4" border="1
1ed0: 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 63 6f ">..<tr><td bgco
1ee0: 6c 6f 72 3d 22 23 63 30 64 64 61 6f 22 3e 3c 62 lor="#c0ddao"><b
1ef0: 3e 70 6f 69 6e 74 3c 2f 62 3e 3c 2f 74 64 3e 3c >point</b></td><
1f00: 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 63 30 64 td bgcolor="#c0d
1f10: 64 61 6f 22 3e 3c 62 3e 6c 6f 6e 3c 2f 62 3e 3c dao"><b>lon</b><
1f20: 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d /td><td bgcolor=
1f30: 22 23 63 30 64 64 61 6f 22 3e 3c 62 3e 6c 61 74 "#c0ddao"><b>lat
1f40: 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 </b></td><td bgc
1f50: 6f 6c 6f 72 3d 22 23 63 30 64 64 61 6f 22 3e 3c olor="#c0ddao"><
1f60: 62 3e 65 6c 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 b>ele</b></td><t
1f70: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 63 30 64 64 d bgcolor="#c0dd
1f80: 61 6f 22 3e 3c 62 3e 74 69 6d 65 3c 2f 62 3e 3c ao"><b>time</b><
1f90: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
1fa0: 74 64 3e 50 6f 69 6e 74 20 23 31 3c 2f 74 64 3e td>Point #1</td>
1fb0: 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 <td align="right
1fc0: 22 3e 33 37 2e 38 30 38 32 35 30 3c 2f 74 64 3e ">37.808250</td>
1fd0: 3c 74 64 20 61 6c 6f 67 6e 3d 22 72 69 67 68 74 <td alogn="right
1fe0: 22 3e 35 35 2e 37 35 33 35 37 32 3c 2f 74 64 3e ">55.753572</td>
1ff0: 3c 74 64 3e 31 33 35 2e 30 30 30 30 30 30 3c 2f <td>135.000000</
2000: 74 64 3e 3c 74 64 3e 32 30 30 39 2d 30 35 2d 31 td><td>2009-05-1
2010: 39 20 30 34 3a 30 30 3a 33 30 3c 2f 74 64 3e 3c 9 04:00:30</td><
2020: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 50 6f /tr>..<tr><td>Po
2030: 69 6e 74 20 23 32 3c 2f 74 64 3e 3c 74 64 20 61 int #2</td><td a
2040: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 37 2e lign="right">37.
2050: 38 30 38 32 35 35 3c 2f 74 64 3e 3c 74 64 20 61 808255</td><td a
2060: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 35 2e lign="right">55.
2070: 37 35 33 36 32 32 3c 2f 74 64 3e 3c 74 64 20 61 753622</td><td a
2080: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 33 35 lign="right">135
2090: 2e 30 30 30 30 30 30 3c 2f 74 64 3e 3c 74 64 3e .000000</td><td>
20a0: 32 30 30 39 2d 30 35 2d 31 39 20 30 34 3a 30 30 2009-05-19 04:00
20b0: 3a 33 31 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c :31</td></tr>..<
20c0: 74 72 3e 3c 74 64 3e 50 6f 69 6e 74 20 23 33 3c tr><td>Point #3<
20d0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
20e0: 69 67 68 74 22 3e 33 37 2e 38 30 38 31 35 38 3c ight">37.808158<
20f0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
2100: 69 67 68 74 22 3e 35 35 2e 37 35 33 35 39 33 3c ight">55.753593<
2110: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 /td><td align="r
2120: 69 67 68 74 22 3e 31 33 35 2e 30 30 30 30 30 30 ight">135.000000
2130: 3c 2f 74 64 3e 3c 74 64 3e 32 30 30 39 2d 30 35 </td><td>2009-05
2140: 2d 31 39 20 30 34 3a 30 30 3a 33 32 3c 2f 74 64 -19 04:00:32</td
2150: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
2160: 50 6f 69 6e 74 20 23 4e 3c 2f 74 64 3e 3c 74 64 Point #N</td><td
2170: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 align="right">3
2180: 37 2e 36 37 37 38 30 32 3c 2f 74 64 3e 3c 74 64 7.677802</td><td
2190: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 align="right">5
21a0: 35 2e 37 35 38 31 37 37 3c 2f 74 64 3e 3c 74 64 5.758177</td><td
21b0: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
21c0: 35 32 2e 30 30 30 30 30 30 3c 2f 74 64 3e 3c 74 52.000000</td><t
21d0: 64 3e 32 30 30 39 2d 30 35 2d 31 39 20 30 34 3a d>2009-05-19 04:
21e0: 34 36 3a 32 37 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 46:27</td></tr>.
21f0: 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 41 .</table><br>..A
2200: 73 20 79 6f 75 20 63 61 6e 20 65 61 73 69 6c 79 s you can easily
2210: 20 73 65 65 2c 20 74 68 65 20 4d 75 6c 74 69 4c see, the MultiL
2220: 69 6e 65 73 74 72 69 6e 67 20 58 59 5a 4d 20 72 inestring XYZM r
2230: 65 74 75 72 6e 65 64 20 62 79 20 3c 62 3e 58 42 eturned by <b>XB
2240: 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 28 29 3c _MLineFromGPX()<
2250: 2f 62 3e 20 66 61 69 74 68 66 75 6c 6c 79 20 70 /b> faithfully p
2260: 72 65 73 65 72 76 65 73 20 62 6f 74 68 20 74 68 reserves both th
2270: 65 20 73 70 61 74 69 61 6c 20 63 6f 6f 72 64 69 e spatial coordi
2280: 6e 61 74 65 73 20 61 6e 64 20 74 68 65 20 74 69 nates and the ti
2290: 6d 65 73 74 61 6d 70 73 20 6f 72 69 67 69 6e 61 mestamps origina
22a0: 6c 6c 79 20 72 65 67 69 73 74 65 72 65 64 20 62 lly registered b
22b0: 79 20 74 68 65 20 47 50 53 20 73 65 6e 73 6f 72 y the GPS sensor
22c0: 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 ...<br><br>..<ta
22d0: 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 25 22 ble width="100%"
22e0: 3e 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 74 68 ><tr>..<td width
22f0: 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 6c 65 ="33%" align="le
2300: 66 74 22 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 20 61 ft"></td>..<td a
2310: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 42 61 lign="center">Ba
2320: 63 6b 20 74 6f 20 3c 61 20 68 72 65 66 3d 22 68 ck to <a href="h
2330: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
2340: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 gis.it/fossil/li
2350: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 bspatialite/wiki
2360: 3f 6e 61 6d 65 3d 35 2e 30 2e 30 2d 64 6f 63 22 ?name=5.0.0-doc"
2370: 3e 35 2e 30 2e 30 2d 64 6f 63 20 6d 61 69 6e 20 >5.0.0-doc main
2380: 70 61 67 65 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c page</a></td>..<
2390: 74 64 20 77 69 64 74 68 3d 22 33 33 25 22 20 61 td width="33%" a
23a0: 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 3c 2f 74 lign="right"></t
23b0: 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 d>..</tr></table
23c0: 3e 0a 5a 20 66 64 65 62 31 64 63 33 36 30 65 65 >.Z fdeb1dc360ee
23d0: 61 66 64 66 63 34 30 36 62 34 39 37 30 65 33 37 afdfc406b4970e37
23e0: 37 66 34 65 0a 7f4e.