Artifact
50b6e0c75cb7ebcebaff907553b4bfcf3aecd647:
Wiki page
[GPX tracks] by
sandro
2015-12-13 11:21:20.
0000: 44 20 32 30 31 35 2d 31 32 2d 31 33 54 31 31 3a D 2015-12-13T11:
0010: 32 31 3a 32 30 2e 35 37 37 0a 4c 20 47 50 58 5c 21:20.577.L GPX\
0020: 73 74 72 61 63 6b 73 0a 50 20 31 63 63 61 39 63 stracks.P 1cca9c
0030: 62 37 61 39 30 66 30 31 65 38 38 30 62 30 38 34 b7a90f01e880b084
0040: 39 61 65 61 65 31 33 33 61 64 34 36 31 63 66 39 9aeae133ad461cf9
0050: 62 32 0a 55 20 73 61 6e 64 72 6f 0a 57 20 39 30 b2.U sandro.W 90
0060: 32 36 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 26.<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 3c 61 20 68 72 65 ="center"><a hre
0170: 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 f="https://www.g
0180: 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 aia-gis.it/fossi
0190: 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f l/libspatialite/
01a0: 77 69 6b 69 3f 6e 61 6d 65 3d 6d 69 73 63 2d 64 wiki?name=misc-d
01b0: 6f 63 73 22 3e 62 61 63 6b 20 74 6f 20 69 6e 64 ocs">back to ind
01c0: 65 78 3c 2f 61 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 ex</a></td>..<td
01d0: 20 77 69 64 74 68 3d 22 33 33 25 22 20 61 6c 69 width="33%" ali
01e0: 67 6e 3d 22 72 69 67 68 74 22 3e 3c 2f 74 64 3e gn="right"></td>
01f0: 0d 0a 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 3c ..</tr></table><
0200: 62 72 3e 3c 74 61 62 6c 65 20 77 69 64 74 68 3d br><table width=
0210: 22 31 30 30 25 22 20 62 67 63 6f 6c 6f 72 3d 22 "100%" bgcolor="
0220: 23 66 66 66 66 64 66 22 20 63 65 6c 6c 73 70 61 #ffffdf" cellspa
0230: 63 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 cing="4" cellpad
0240: 64 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 3e 3c ding="8">..<tr><
0250: 74 64 3e 3c 62 3e 57 68 61 74 20 69 73 20 61 20 td><b>What is a
0260: 47 50 58 20 66 69 6c 65 20 3f 3c 2f 62 3e 3c 2f GPX file ?</b></
0270: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
0280: 64 3e 3c 62 3e 47 50 58 3c 2f 62 3e 20 73 74 61 d><b>GPX</b> sta
0290: 6e 64 73 20 66 6f 72 20 3c 69 3e 3c 62 3e 47 50 nds for <i><b>GP
02a0: 3c 2f 62 3e 53 20 45 3c 62 3e 78 3c 2f 62 3e 63 </b>S E<b>x</b>c
02b0: 68 61 6e 67 65 20 46 6f 72 6d 61 74 3c 2f 69 3e hange Format</i>
02c0: 3b 20 69 74 27 73 20 61 20 76 65 72 79 20 70 6f ; it's a very po
02d0: 70 75 6c 61 72 20 66 69 6c 65 20 66 6f 72 6d 61 pular file forma
02e0: 74 20 75 73 65 64 20 69 6e 20 6f 72 64 65 72 20 t used in order
02f0: 74 6f 20 65 78 63 68 61 6e 67 65 20 47 50 53 20 to exchange GPS
0300: 64 61 74 61 20 61 63 72 6f 73 73 20 64 69 66 66 data across diff
0310: 65 72 65 6e 74 20 64 65 76 69 63 65 73 2e 3c 62 erent devices.<b
0320: 72 3e 20 0d 0a 47 50 58 20 69 73 20 61 6e 20 6f r> ..GPX is an o
0330: 70 65 6e 20 66 6f 72 6d 61 74 20 61 6e 64 20 69 pen format and i
0340: 73 20 61 6c 6d 6f 73 74 20 61 6c 77 61 79 73 20 s almost always
0350: 73 75 70 70 6f 72 74 65 64 3a 20 69 74 27 73 20 supported: it's
0360: 62 61 73 65 64 20 6f 6e 20 61 20 66 6f 72 6d 61 based on a forma
0370: 6c 6c 79 20 64 65 66 69 6e 65 64 20 3c 61 20 68 lly defined <a h
0380: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e ref="http://www.
0390: 74 6f 70 6f 67 72 61 66 69 78 2e 63 6f 6d 2f 47 topografix.com/G
03a0: 50 58 2f 31 2f 31 2f 23 74 6f 70 22 3e 58 4d 4c PX/1/1/#top">XML
03b0: 20 73 63 68 65 6d 61 3c 2f 61 3e 3c 62 72 3e 0d schema</a><br>.
03c0: 0a 4d 61 6e 79 20 72 65 61 6c 20 77 6f 72 64 20 .Many real word
03d0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 20 implementations
03e0: 61 72 65 20 6f 6e 6c 79 20 6c 6f 6f 73 65 6c 79 are only loosely
03f0: 20 63 6f 6e 66 6f 72 6d 61 6e 74 20 74 6f 20 74 conformant to t
0400: 68 65 20 73 74 61 6e 64 61 72 64 20 73 63 68 65 he standard sche
0410: 6d 61 20 61 6e 64 20 66 75 72 74 68 65 72 20 6e ma and further n
0420: 6f 6e 2d 73 74 61 6e 64 61 72 64 20 74 61 67 73 on-standard tags
0430: 20 68 61 76 65 20 62 65 65 6e 20 69 6e 74 72 6f have been intro
0440: 64 75 63 65 64 20 62 79 20 73 65 76 65 72 61 6c duced by several
0450: 20 76 65 6e 64 6f 72 73 2e 3c 62 72 3e 3c 62 72 vendors.<br><br
0460: 3e 0d 0a 41 20 47 50 58 20 66 69 6c 65 20 69 73 >..A GPX file is
0470: 20 65 78 70 65 63 74 65 64 20 74 6f 20 69 6e 74 expected to int
0480: 65 72 6e 61 6c 6c 79 20 73 74 6f 72 65 20 61 74 ernally store at
0490: 20 6c 65 61 73 74 20 6f 6e 65 20 6f 66 20 74 68 least one of th
04a0: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6e 74 e following cont
04b0: 65 6e 74 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 ents:..<ul>..<li
04c0: 3e 3c 62 3e 54 72 61 63 6b 73 3c 2f 62 3e 3a 20 ><b>Tracks</b>:
04d0: 61 20 54 72 61 63 6b 20 69 73 20 61 6e 20 6f 72 a Track is an or
04e0: 64 65 72 65 64 20 6c 69 73 74 20 6f 66 20 70 6f dered list of po
04f0: 69 6e 74 73 20 64 65 73 63 72 69 62 69 6e 67 20 ints describing
0500: 61 20 70 61 74 68 2e 0d 0a 41 20 54 72 61 63 6b a path...A Track
0510: 20 6d 75 73 74 20 63 6f 6e 74 61 69 6e 20 61 74 must contain at
0520: 20 6c 65 61 73 74 20 6f 6e 65 20 54 72 61 63 6b least one Track
0530: 20 53 65 67 6d 65 6e 74 20 68 6f 6c 64 69 6e 67 Segment holding
0540: 20 61 20 6c 69 73 74 20 6f 66 20 54 72 61 63 6b a list of Track
0550: 20 50 6f 69 6e 74 73 20 77 68 69 63 68 20 61 72 Points which ar
0560: 65 20 6c 6f 67 69 63 61 6c 6c 79 20 63 6f 6e 6e e logically conn
0570: 65 63 74 65 64 20 69 6e 20 6f 72 64 65 72 2e 3c ected in order.<
0580: 62 72 3e 0d 0a 41 20 54 72 61 63 6b 20 63 61 6e br>..A Track can
0590: 20 63 6f 6e 74 61 69 6e 20 6d 6f 72 65 20 53 65 contain more Se
05a0: 67 6d 65 6e 74 73 2c 20 61 6e 64 20 6d 6f 72 65 gments, and more
05b0: 20 54 72 61 63 6b 73 20 63 61 6e 20 62 65 20 73 Tracks can be s
05c0: 74 6f 72 65 64 20 69 6e 74 6f 20 74 68 65 20 73 tored into the s
05d0: 61 6d 65 20 47 50 58 20 66 69 6c 65 2e 3c 2f 6c ame GPX file.</l
05e0: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 57 61 79 50 6f i>..<li><b>WayPo
05f0: 69 6e 74 73 3c 2f 62 3e 3c 2f 62 3e 3a 20 61 20 ints</b></b>: a
0600: 57 61 79 50 6f 69 6e 74 20 63 6f 6e 73 69 73 74 WayPoint consist
0610: 73 20 6f 66 20 74 68 65 20 57 47 53 20 38 34 20 s of the WGS 84
0620: 28 47 50 53 29 20 63 6f 6f 72 64 69 6e 61 74 65 (GPS) coordinate
0630: 73 20 6f 66 20 61 20 70 6f 69 6e 74 20 61 6e 64 s of a point and
0640: 20 70 6f 73 73 69 62 6c 79 20 6f 74 68 65 72 20 possibly other
0650: 64 65 73 63 72 69 70 74 69 76 65 20 69 6e 66 6f descriptive info
0660: 72 6d 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 54 68 rmation.<br>..Th
0670: 65 20 73 61 6d 65 20 47 50 58 20 66 69 6c 65 20 e same GPX file
0680: 63 61 6e 20 63 6f 6e 74 61 69 6e 20 61 20 63 6f can contain a co
0690: 6c 6c 65 63 74 69 6f 6e 20 6f 66 20 6d 61 6e 79 llection of many
06a0: 20 57 61 79 50 6f 69 6e 74 73 20 77 69 74 68 20 WayPoints with
06b0: 6e 6f 20 73 65 71 75 65 6e 74 69 61 6c 20 72 65 no sequential re
06c0: 6c 61 74 69 6f 6e 73 68 69 70 2e 3c 2f 6c 69 3e lationship.</li>
06d0: 0d 0a 3c 6c 69 3e 3c 62 3e 52 6f 75 74 65 73 3c ..<li><b>Routes<
06e0: 2f 62 3e 3a 20 61 20 52 6f 75 74 65 20 69 73 20 /b>: a Route is
06f0: 61 6e 20 6f 72 64 65 72 65 64 20 6c 69 73 74 20 an ordered list
0700: 6f 66 20 72 6f 75 74 65 70 6f 69 6e 74 73 20 28 of routepoints (
0710: 77 61 79 70 6f 69 6e 74 73 20 72 65 70 72 65 73 waypoints repres
0720: 65 6e 74 69 6e 67 20 61 20 73 65 72 69 65 73 20 enting a series
0730: 6f 66 20 73 69 67 6e 69 66 69 63 61 6e 74 20 74 of significant t
0740: 75 72 6e 20 6f 72 20 73 74 61 67 65 20 70 6f 69 urn or stage poi
0750: 6e 74 73 29 20 6c 65 61 64 69 6e 67 20 74 6f 20 nts) leading to
0760: 61 20 64 65 73 74 69 6e 61 74 69 6f 6e 2e 3c 2f a destination.</
0770: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a li>..</ul><br>..
0780: 53 70 61 74 69 61 4c 69 74 65 20 6f 6e 6c 79 20 SpatiaLite only
0790: 73 75 70 70 6f 72 74 73 20 3c 62 3e 47 50 58 20 supports <b>GPX
07a0: 54 72 61 63 6b 73 3c 2f 62 3e 20 61 6e 64 20 77 Tracks</b> and w
07b0: 69 6c 6c 20 61 6c 77 61 79 73 20 73 69 6c 65 6e ill always silen
07c0: 74 6c 79 20 69 67 6e 6f 72 65 20 61 6e 79 20 6f tly ignore any o
07d0: 74 68 65 72 20 63 6f 6e 74 65 6e 74 2e 3c 62 72 ther content.<br
07e0: 3e 3c 62 72 3e 0d 0a 3c 68 33 3e 41 6e 61 74 6f ><br>..<h3>Anato
07f0: 6d 79 20 6f 66 20 61 20 47 50 58 20 66 69 6c 65 my of a GPX file
0800: 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 20 47 50 containing a GP
0810: 53 20 54 72 61 63 6b 3c 2f 68 33 3e 0d 0a 49 66 S Track</h3>..If
0820: 20 79 6f 75 20 61 72 65 20 69 6e 74 65 72 65 73 you are interes
0830: 74 65 64 20 69 6e 74 6f 20 47 50 53 20 54 72 61 ted into GPS Tra
0840: 63 6b 73 20 79 6f 75 27 6c 6c 20 76 65 72 79 20 cks you'll very
0850: 70 72 6f 62 61 62 6c 79 20 68 61 76 65 20 6c 6f probably have lo
0860: 74 73 20 6f 66 20 47 50 58 20 66 69 6c 65 73 20 ts of GPX files
0870: 6f 66 20 79 6f 75 72 20 6f 77 6e 20 74 68 61 74 of your own that
0880: 20 79 6f 75 20 63 61 6e 20 75 73 65 20 61 73 20 you can use as
0890: 74 65 73 74 20 73 61 6d 70 6c 65 73 2e 3c 62 72 test samples.<br
08a0: 3e 0d 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 >..The following
08b0: 20 65 78 61 6d 70 6c 65 73 20 75 73 65 20 74 68 examples use th
08c0: 69 73 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 is <a href="http
08d0: 3a 2f 2f 77 77 77 2e 73 68 6d 75 6d 61 2e 72 75 ://www.shmuma.ru
08e0: 2f 77 69 6b 69 2f 69 6d 61 67 65 73 2f 35 2f 35 /wiki/images/5/5
08f0: 31 2f 47 70 78 2d 66 75 6c 6c 2d 73 61 6d 70 6c 1/Gpx-full-sampl
0900: 65 2e 67 70 78 22 3e 47 50 58 20 73 61 6d 70 6c e.gpx">GPX sampl
0910: 65 3c 2f 61 3e 3c 62 72 3e 0d 0a 3c 76 65 72 62 e</a><br>..<verb
0920: 61 74 69 6d 3e 0d 0a 3c 3f 78 6d 6c 20 76 65 72 atim>..<?xml ver
0930: 73 69 6f 6e 3d 22 31 2e 30 22 3f 3e 0d 0a 3c 67 sion="1.0"?>..<g
0940: 70 78 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 px version="1.0"
0950: 20 78 6d 6c 6e 73 3d 22 68 74 74 70 3a 2f 2f 77 xmlns="http://w
0960: 77 77 2e 74 6f 70 6f 67 72 61 66 69 78 2e 63 6f ww.topografix.co
0970: 6d 2f 47 50 58 2f 31 2f 30 22 3e 0d 0a 20 20 3c m/GPX/1/0">.. <
0980: 74 72 6b 3e 0d 0a 20 20 20 20 3c 74 72 6b 73 65 trk>.. <trkse
0990: 67 3e 0d 0a 20 20 20 20 20 20 3c 74 72 6b 70 74 g>.. <trkpt
09a0: 20 6c 61 74 3d 22 35 35 2e 37 35 33 35 37 32 22 lat="55.753572"
09b0: 20 6c 6f 6e 3d 22 33 37 2e 38 30 38 32 35 30 22 lon="37.808250"
09c0: 3e 0d 0a 20 20 20 20 20 20 20 20 3c 65 6c 65 3e >.. <ele>
09d0: 31 33 35 2e 30 30 3c 2f 65 6c 65 3e 0d 0a 20 20 135.00</ele>..
09e0: 20 20 20 20 20 20 3c 74 69 6d 65 3e 32 30 30 39 <time>2009
09f0: 2d 30 35 2d 31 39 54 30 34 3a 30 30 3a 33 30 5a -05-19T04:00:30Z
0a00: 3c 2f 74 69 6d 65 3e 0d 0a 20 20 20 20 20 20 3c </time>.. <
0a10: 2f 74 72 6b 70 74 3e 0d 0a 20 20 20 20 20 20 3c /trkpt>.. <
0a20: 74 72 6b 70 74 20 6c 61 74 3d 22 35 35 2e 37 35 trkpt lat="55.75
0a30: 33 36 32 32 22 20 6c 6f 6e 3d 22 33 37 2e 38 30 3622" lon="37.80
0a40: 38 32 35 35 22 3e 0d 0a 20 20 20 20 20 20 20 20 8255">..
0a50: 3c 65 6c 65 3e 31 33 35 2e 30 30 3c 2f 65 6c 65 <ele>135.00</ele
0a60: 3e 0d 0a 20 20 20 20 20 20 20 20 3c 74 69 6d 65 >.. <time
0a70: 3e 32 30 30 39 2d 30 35 2d 31 39 54 30 34 3a 30 >2009-05-19T04:0
0a80: 30 3a 33 31 5a 3c 2f 74 69 6d 65 3e 0d 0a 20 20 0:31Z</time>..
0a90: 20 20 20 20 3c 2f 74 72 6b 70 74 3e 0d 0a 20 20 </trkpt>..
0aa0: 20 20 20 20 3c 74 72 6b 70 74 20 6c 61 74 3d 22 <trkpt lat="
0ab0: 35 35 2e 37 35 33 35 39 33 22 20 6c 6f 6e 3d 22 55.753593" lon="
0ac0: 33 37 2e 38 30 38 31 35 38 22 3e 0d 0a 20 20 20 37.808158">..
0ad0: 20 20 20 20 20 3c 65 6c 65 3e 31 33 35 2e 30 30 <ele>135.00
0ae0: 3c 2f 65 6c 65 3e 0d 0a 20 20 20 20 20 20 20 20 </ele>..
0af0: 3c 74 69 6d 65 3e 32 30 30 39 2d 30 35 2d 31 39 <time>2009-05-19
0b00: 54 30 34 3a 30 30 3a 33 32 5a 3c 2f 74 69 6d 65 T04:00:32Z</time
0b10: 3e 0d 0a 20 20 20 20 20 20 3c 2f 74 72 6b 70 74 >.. </trkpt
0b20: 3e 0d 0a 2e 2e 2e 2e 0d 0a 20 20 20 20 20 20 3c >........ <
0b30: 74 72 6b 70 74 20 6c 61 74 3d 22 35 35 2e 37 35 trkpt lat="55.75
0b40: 38 31 37 37 22 20 6c 6f 6e 3d 22 33 37 2e 36 37 8177" lon="37.67
0b50: 37 38 30 32 22 3e 0d 0a 20 20 20 20 20 20 20 20 7802">..
0b60: 3c 65 6c 65 3e 31 35 32 2e 30 30 3c 2f 65 6c 65 <ele>152.00</ele
0b70: 3e 0d 0a 20 20 20 20 20 20 20 20 3c 74 69 6d 65 >.. <time
0b80: 3e 32 30 30 39 2d 30 35 2d 31 39 54 30 34 3a 34 >2009-05-19T04:4
0b90: 36 3a 32 37 5a 3c 2f 74 69 6d 65 3e 0d 0a 20 20 6:27Z</time>..
0ba0: 20 20 20 20 3c 2f 74 72 6b 70 74 3e 0d 0a 20 20 </trkpt>..
0bb0: 20 20 3c 2f 74 72 6b 73 65 67 3e 0d 0a 20 20 3c </trkseg>.. <
0bc0: 2f 74 72 6b 3e 0d 0a 3c 2f 67 70 78 3e 0d 0a 3c /trk>..</gpx>..<
0bd0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 75 6c 3e /verbatim>..<ul>
0be0: 0d 0a 3c 6c 69 3e 74 68 65 20 77 68 6f 6c 65 20 ..<li>the whole
0bf0: 47 50 58 20 66 69 6c 65 20 69 73 20 65 6e 63 6c GPX file is encl
0c00: 6f 73 65 64 20 77 69 74 68 69 6e 20 3c 62 3e 26 osed within <b>&
0c10: 6c 74 3b 67 70 78 26 67 74 3b 3c 2f 62 3e 20 61 lt;gpx></b> a
0c20: 6e 64 20 3c 62 3e 26 6c 74 3b 2f 67 70 78 26 67 nd <b></gpx&g
0c30: 74 3b 3c 2f 62 3e 20 74 61 67 73 2e 3c 2f 6c 69 t;</b> tags.</li
0c40: 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 54 72 61 63 >..<li>each Trac
0c50: 6b 20 69 73 20 64 65 6c 69 6d 69 74 65 64 20 62 k is delimited b
0c60: 79 20 61 20 6d 61 74 63 68 69 6e 67 20 70 61 69 y a matching pai
0c70: 72 20 6f 66 20 3c 62 3e 26 6c 74 3b 74 72 6b 26 r of <b><trk&
0c80: 67 74 3b 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 26 gt;</b> and <b>&
0c90: 6c 74 3b 2f 74 72 6b 26 67 74 3b 3c 2f 62 3e 20 lt;/trk></b>
0ca0: 74 61 67 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e tags.</li>..<li>
0cb0: 65 61 63 68 20 54 72 61 63 6b 20 53 65 67 6d 65 each Track Segme
0cc0: 6e 74 20 69 73 20 64 65 6c 69 6d 69 74 65 64 20 nt is delimited
0cd0: 62 79 20 61 20 6d 61 74 63 68 69 6e 67 20 70 61 by a matching pa
0ce0: 69 72 20 6f 66 20 3c 62 3e 26 6c 74 3b 74 72 6b ir of <b><trk
0cf0: 73 65 67 26 67 74 3b 3c 2f 62 3e 20 61 6e 64 20 seg></b> and
0d00: 3c 62 3e 26 6c 74 3b 2f 74 72 6b 73 65 67 26 67 <b></trkseg&g
0d10: 74 3b 3c 2f 62 3e 20 74 61 67 73 2e 3c 2f 6c 69 t;</b> tags.</li
0d20: 3e 0d 0a 3c 6c 69 3e 65 61 63 68 20 54 72 61 63 >..<li>each Trac
0d30: 6b 20 50 6f 69 6e 74 20 69 73 20 65 6e 63 6c 6f k Point is enclo
0d40: 73 65 64 20 77 69 74 68 69 6e 20 3c 62 3e 26 6c sed within <b>&l
0d50: 74 3b 74 72 6b 70 74 26 67 74 3b 3c 2f 62 3e 20 t;trkpt></b>
0d60: 61 6e 64 20 3c 62 3e 26 6c 74 3b 2f 74 72 6b 70 and <b></trkp
0d70: 74 26 67 74 3b 3c 2f 62 3e 20 74 61 67 73 2e 0d t></b> tags..
0d80: 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c .<ul>..<li>the <
0d90: 62 3e 6c 61 74 3c 2f 62 3e 20 61 6e 64 20 3c 62 b>lat</b> and <b
0da0: 3e 6c 6f 6e 3c 2f 62 3e 20 6d 61 6e 64 61 74 6f >lon</b> mandato
0db0: 72 79 20 61 74 74 72 69 62 75 74 65 73 20 61 72 ry attributes ar
0dc0: 65 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 64 65 e intended to de
0dd0: 63 6c 61 72 65 20 74 68 65 20 57 47 53 20 38 34 clare the WGS 84
0de0: 20 3c 62 3e 3c 69 3e 6c 61 74 69 74 75 64 65 3c <b><i>latitude<
0df0: 2f 69 3e 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 3c /i></b> and <b><
0e00: 69 3e 6c 6f 6e 67 69 74 75 64 65 3c 2f 69 3e 3c i>longitude</i><
0e10: 2f 62 3e 20 6f 66 20 74 68 65 20 70 6f 69 6e 74 /b> of the point
0e20: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 68 65 20 .</li>..<li>the
0e30: 3c 62 3e 3c 69 3e 65 6c 65 76 61 74 69 6f 6e 3c <b><i>elevation<
0e40: 2f 69 3e 3c 2f 62 3e 20 6f 66 20 74 68 65 20 70 /i></b> of the p
0e50: 6f 69 6e 74 20 28 6d 65 61 73 75 72 65 64 20 69 oint (measured i
0e60: 6e 20 6d 65 74 65 72 73 29 20 63 61 6e 20 62 65 n meters) can be
0e70: 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 64 65 63 6c optionally decl
0e80: 61 72 65 64 20 77 69 74 68 69 6e 20 61 20 70 61 ared within a pa
0e90: 69 72 20 6f 66 20 3c 62 3e 26 6c 74 3b 65 6c 65 ir of <b><ele
0ea0: 26 67 74 3b 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e ></b> and <b>
0eb0: 26 6c 74 3b 2f 65 6c 65 26 67 74 3b 3c 2f 62 3e </ele></b>
0ec0: 20 74 61 67 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 tags.</li>..<li
0ed0: 3e 74 68 65 20 3c 62 3e 3c 69 3e 64 61 74 65 20 >the <b><i>date
0ee0: 61 6e 64 20 74 69 6d 65 3c 2f 69 3e 3c 2f 62 3e and time</i></b>
0ef0: 20 6f 66 20 74 68 65 20 63 6f 72 72 65 73 70 6f of the correspo
0f00: 6e 64 69 6e 67 20 47 50 53 20 6d 65 61 73 75 72 nding GPS measur
0f10: 65 20 63 61 6e 20 62 65 20 6f 70 74 69 6f 6e 61 e can be optiona
0f20: 6c 6c 79 20 64 65 63 6c 61 72 65 64 20 77 69 74 lly declared wit
0f30: 68 69 6e 20 61 20 70 61 69 72 20 6f 66 20 3c 62 hin a pair of <b
0f40: 3e 26 6c 74 3b 74 69 6d 65 26 67 74 3b 3c 2f 62 ><time></b
0f50: 3e 20 61 6e 64 20 3c 62 3e 26 6c 74 3b 2f 74 69 > and <b></ti
0f60: 6d 65 26 67 74 3b 3c 2f 62 3e 20 74 61 67 73 2e me></b> tags.
0f70: 3c 62 72 3e 0d 0a 44 61 74 65 73 20 61 6e 64 20 <br>..Dates and
0f80: 74 69 6d 65 73 20 61 72 65 20 6e 6f 74 20 6c 6f times are not lo
0f90: 63 61 6c 20 74 69 6d 65 2c 20 62 75 74 20 69 6e cal time, but in
0fa0: 73 74 65 61 64 20 61 72 65 20 3c 61 20 68 72 65 stead are <a hre
0fb0: 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 f="https://en.wi
0fc0: 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 kipedia.org/wiki
0fd0: 2f 43 6f 6f 72 64 69 6e 61 74 65 64 5f 55 6e 69 /Coordinated_Uni
0fe0: 76 65 72 73 61 6c 5f 54 69 6d 65 22 3e 43 6f 6f versal_Time">Coo
0ff0: 72 64 69 6e 61 74 65 64 20 55 6e 69 76 65 72 73 rdinated Univers
1000: 61 6c 20 54 69 6d 65 3c 2f 61 3e 20 28 3c 62 3e al Time</a> (<b>
1010: 55 54 43 3c 2f 62 3e 29 20 75 73 69 6e 67 20 3c UTC</b>) using <
1020: 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f a href="https://
1030: 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 en.wikipedia.org
1040: 2f 77 69 6b 69 2f 49 53 4f 5f 38 36 30 31 22 3e /wiki/ISO_8601">
1050: 49 53 4f 20 38 36 30 31 3c 2f 61 3e 20 66 6f 72 ISO 8601</a> for
1060: 6d 61 74 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e mat.</li>..</ul>
1070: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f </li>..</ul>..</
1080: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c td></tr>..</tabl
1090: 65 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 3c 62 72 3e e><br>..<hr><br>
10a0: 0d 0a 3c 68 32 3e 49 6d 70 6f 72 74 69 6e 67 20 ..<h2>Importing
10b0: 47 50 58 20 74 72 61 63 6b 73 20 69 6e 74 6f 20 GPX tracks into
10c0: 61 20 53 70 61 74 69 61 4c 69 74 65 20 47 65 6f a SpatiaLite Geo
10d0: 54 61 62 6c 65 3c 2f 68 32 3e 0d 0a 3c 76 65 72 Table</h2>..<ver
10e0: 62 61 74 69 6d 3e 0d 0a 43 52 45 41 54 45 20 54 batim>..CREATE T
10f0: 41 42 4c 45 20 72 61 77 5f 67 70 78 20 28 0d 0a ABLE raw_gpx (..
1100: 20 20 20 20 69 64 5f 67 70 78 20 49 4e 54 45 47 id_gpx INTEG
1110: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 ER PRIMARY KEY A
1120: 55 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0d 0a 20 UTOINCREMENT,..
1130: 20 20 20 67 70 78 20 42 4c 4f 42 20 4e 4f 54 20 gpx BLOB NOT
1140: 20 4e 55 4c 4c 29 3b 0d 0a 0d 0a 49 4e 53 45 52 NULL);....INSER
1150: 54 20 49 4e 54 4f 20 72 61 77 5f 67 70 78 20 56 T INTO raw_gpx V
1160: 41 4c 55 45 53 20 28 4e 55 4c 4c 2c 20 58 42 5f ALUES (NULL, XB_
1170: 43 72 65 61 74 65 28 58 42 5f 4c 6f 61 64 58 4d Create(XB_LoadXM
1180: 4c 28 27 47 70 78 2d 66 75 6c 6c 2d 73 61 6d 70 L('Gpx-full-samp
1190: 6c 65 2e 67 70 78 27 29 29 29 3b 0d 0a 0d 0a 53 le.gpx')));....S
11a0: 45 4c 45 43 54 20 69 64 5f 67 70 78 2c 20 58 42 ELECT id_gpx, XB
11b0: 5f 49 73 47 50 58 28 67 70 78 29 20 0d 0a 46 52 _IsGPX(gpx) ..FR
11c0: 4f 4d 20 72 61 77 5f 67 70 78 3b 0d 0a 2d 2d 2d OM raw_gpx;..---
11d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d ----------------
11e0: 0d 0a 31 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e ..1..</verbatim>
11f0: 0d 0a 53 69 6e 63 65 20 47 50 58 20 66 69 6c 65 ..Since GPX file
1200: 73 20 61 72 65 20 58 4d 4c 20 66 69 6c 65 73 2c s are XML files,
1210: 20 79 6f 75 20 6d 75 73 74 20 75 73 65 20 74 68 you must use th
1220: 65 20 73 74 61 6e 64 61 72 64 20 53 51 4c 20 66 e standard SQL f
1230: 75 6e 63 74 69 6f 6e 73 20 73 75 70 70 6f 72 74 unctions support
1240: 69 6e 67 20 67 65 6e 65 72 69 63 20 58 4d 4c 2e ing generic XML.
1250: 3c 62 72 3e 0d 0a 3c 62 3e 58 42 5f 49 73 47 50 <br>..<b>XB_IsGP
1260: 58 28 29 3c 2f 62 3e 20 69 73 20 61 20 6e 65 77 X()</b> is a new
1270: 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 69 6e SQL function in
1280: 74 72 6f 64 75 63 65 64 20 62 79 20 53 70 61 74 troduced by Spat
1290: 69 61 4c 69 74 65 20 3c 62 3e 34 2e 34 2e 30 3c iaLite <b>4.4.0<
12a0: 2f 62 3e 3b 20 69 74 20 77 69 6c 6c 20 74 65 73 /b>; it will tes
12b0: 74 20 74 68 65 20 61 63 74 75 61 6c 20 58 4d 4c t the actual XML
12c0: 20 69 6e 70 75 74 20 61 6e 64 20 77 69 6c 6c 20 input and will
12d0: 72 65 74 75 72 6e 20 3c 62 3e 31 3c 2f 62 3e 20 return <b>1</b>
12e0: 69 66 20 69 74 20 72 65 61 6c 6c 79 20 69 73 20 if it really is
12f0: 6f 66 20 74 68 65 20 47 50 58 20 74 79 70 65 2c of the GPX type,
1300: 20 3c 62 3e 30 3c 2f 62 3e 20 69 66 20 6e 6f 74 <b>0</b> if not
1310: 2c 20 61 6e 64 20 3c 62 3e 2d 31 3c 2f 62 3e 20 , and <b>-1</b>
1320: 77 68 65 6e 20 74 68 65 20 70 61 73 73 65 64 20 when the passed
1330: 61 72 67 75 6d 65 6e 74 20 69 73 20 6e 6f 74 20 argument is not
1340: 61 20 76 61 6c 69 64 20 58 4d 4c 20 64 6f 63 75 a valid XML docu
1350: 6d 65 6e 74 2e 3c 62 72 3e 0d 0a 3c 76 65 72 62 ment.<br>..<verb
1360: 61 74 69 6d 3e 0d 0a 43 52 45 41 54 45 20 54 41 atim>..CREATE TA
1370: 42 4c 45 20 67 70 78 5f 74 72 61 63 6b 73 20 28 BLE gpx_tracks (
1380: 0d 0a 20 20 20 20 69 64 5f 74 72 6b 20 49 4e 54 .. id_trk INT
1390: 45 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 EGER PRIMARY KEY
13a0: 20 41 55 54 4f 49 4e 43 52 45 4d 45 4e 54 29 3b AUTOINCREMENT);
13b0: 0d 0a 0d 0a 53 45 4c 45 43 54 20 41 64 64 47 65 ....SELECT AddGe
13c0: 6f 6d 65 74 72 79 43 6f 6c 75 6d 6e 28 27 67 70 ometryColumn('gp
13d0: 78 5f 74 72 61 63 6b 73 27 2c 20 27 67 65 6f 6d x_tracks', 'geom
13e0: 27 2c 20 34 33 32 36 2c 20 27 4d 55 4c 54 49 4c ', 4326, 'MULTIL
13f0: 49 4e 45 53 54 52 49 4e 47 27 2c 20 27 58 59 5a INESTRING', 'XYZ
1400: 4d 27 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d M');..----------
1410: 2d 2d 2d 0d 0a 31 0d 0a 0d 0a 49 4e 53 45 52 54 ---..1....INSERT
1420: 20 49 4e 54 4f 20 67 70 78 5f 74 72 61 63 6b 73 INTO gpx_tracks
1430: 20 0d 0a 53 45 4c 45 43 54 20 4e 55 4c 4c 2c 20 ..SELECT NULL,
1440: 58 42 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 28 XB_MLineFromGPX(
1450: 67 70 78 29 0d 0a 46 52 4f 4d 20 72 61 77 5f 67 gpx)..FROM raw_g
1460: 70 78 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e px;..</verbatim>
1470: 0d 0a 4e 6f 77 20 77 65 27 6c 6c 20 63 72 65 61 ..Now we'll crea
1480: 74 65 20 61 6e 6f 74 68 65 72 20 74 61 62 6c 65 te another table
1490: 20 69 6e 63 6c 75 64 69 6e 67 20 61 20 47 65 6f including a Geo
14a0: 6d 65 74 72 79 20 63 6f 6c 75 6d 6e 20 64 65 63 metry column dec
14b0: 6c 61 72 65 64 20 6f 66 20 74 68 65 20 3c 62 3e lared of the <b>
14c0: 4d 55 4c 54 49 4c 49 4e 45 53 54 52 49 4e 47 3c MULTILINESTRING<
14d0: 2f 62 3e 20 74 79 70 65 20 61 6e 64 20 68 61 76 /b> type and hav
14e0: 69 6e 67 20 3c 62 3e 58 59 5a 4d 3c 2f 62 3e 20 ing <b>XYZM</b>
14f0: 64 69 6d 65 6e 73 69 6f 6e 73 2e 20 54 68 65 20 dimensions. The
1500: 53 52 49 44 20 66 6f 72 20 74 68 69 73 20 47 65 SRID for this Ge
1510: 6f 6d 65 74 72 79 20 3c 62 3e 6d 75 73 74 3c 2f ometry <b>must</
1520: 62 3e 20 62 65 20 3c 62 3e 34 33 32 36 3c 2f 62 b> be <b>4326</b
1530: 3e 20 28 61 6c 69 61 73 20 3c 62 3e 57 47 53 20 > (alias <b>WGS
1540: 38 34 3c 2f 62 3e 29 2c 20 77 68 69 63 68 20 69 84</b>), which i
1550: 73 20 3c 62 3e 61 6c 77 61 79 73 3c 2f 62 3e 20 s <b>always</b>
1560: 75 73 65 64 20 77 69 74 68 20 47 50 53 20 64 61 used with GPS da
1570: 74 61 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 57 69 74 ta.<br><br>..Wit
1580: 68 20 74 68 69 73 2c 20 77 65 20 63 61 6e 20 69 h this, we can i
1590: 6e 76 6f 6b 65 20 74 68 65 20 6e 65 77 20 3c 62 nvoke the new <b
15a0: 3e 58 42 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 >XB_MLineFromGPX
15b0: 28 29 3c 2f 62 3e 20 53 51 4c 20 66 75 6e 63 74 ()</b> SQL funct
15c0: 69 6f 6e 20 77 68 69 63 68 20 77 69 6c 6c 20 70 ion which will p
15d0: 61 72 73 65 20 74 68 65 20 47 50 58 20 69 6e 70 arse the GPX inp
15e0: 75 74 2c 20 70 6f 73 73 69 62 6c 79 20 63 72 65 ut, possibly cre
15f0: 61 74 69 6e 67 20 61 20 4d 75 6c 74 69 4c 69 6e ating a MultiLin
1600: 65 73 74 72 69 6e 67 20 63 6f 72 72 65 73 70 6f estring correspo
1610: 6e 64 69 6e 67 20 74 6f 20 61 6c 6c 20 6f 66 20 nding to all of
1620: 74 68 65 20 54 72 61 63 6b 2d 53 65 67 6d 65 6e the Track-Segmen
1630: 74 73 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 ts defined in th
1640: 65 20 47 50 58 2d 46 69 6c 65 2e 3c 62 72 3e 0d e GPX-File.<br>.
1650: 0a 50 6c 65 61 73 65 20 6e 6f 74 65 3a 0d 0a 3c .Please note:..<
1660: 75 6c 3e 0d 0a 3c 6c 69 3e 58 42 5f 4d 4c 69 6e ul>..<li>XB_MLin
1670: 65 46 72 6f 6d 47 50 58 28 29 20 77 69 6c 6c 20 eFromGPX() will
1680: 72 65 74 75 72 6e 20 3c 62 3e 4e 55 4c 4c 3c 2f return <b>NULL</
1690: 62 3e 20 69 66 20 65 69 74 68 65 72 20 74 68 65 b> if either the
16a0: 20 70 61 73 73 65 64 20 61 72 67 75 6d 65 6e 74 passed argument
16b0: 20 69 73 20 6e 6f 74 20 61 20 76 61 6c 69 64 20 is not a valid
16c0: 42 4c 4f 42 2c 20 6f 72 20 69 74 27 73 20 61 20 BLOB, or it's a
16d0: 76 61 6c 69 64 20 42 4c 4f 42 20 62 75 74 20 6e valid BLOB but n
16e0: 6f 74 20 6f 66 20 74 68 65 20 47 50 58 20 74 79 ot of the GPX ty
16f0: 70 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 42 pe.</li>..<li>XB
1700: 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 28 29 20 _MLineFromGPX()
1710: 77 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 3c 62 will return a <b
1720: 3e 4e 55 4c 4c 3c 2f 62 3e 20 76 61 6c 75 65 2c >NULL</b> value,
1730: 20 69 66 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 if it does not
1740: 63 6f 6e 74 61 69 6e 73 20 61 6e 79 20 54 72 61 contains any Tra
1750: 63 6b 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 77 cks.</li>..<li>w
1760: 68 65 6e 20 73 75 63 63 65 73 73 66 75 6c 2c 20 hen successful,
1770: 74 68 65 20 72 65 74 75 72 6e 65 64 20 47 65 6f the returned Geo
1780: 6d 65 74 72 79 20 77 69 6c 6c 20 61 6c 77 61 79 metry will alway
1790: 73 20 62 65 20 61 20 4d 75 6c 74 69 4c 69 6e 65 s be a MultiLine
17a0: 73 74 72 69 6e 67 2c 20 61 6e 64 20 61 20 64 69 string, and a di
17b0: 73 74 69 6e 63 74 20 4c 69 6e 65 73 74 72 69 6e stinct Linestrin
17c0: 67 20 77 69 6c 6c 20 62 65 20 63 72 65 61 74 65 g will be create
17d0: 64 20 69 6e 73 69 64 65 20 66 6f 72 20 65 76 65 d inside for eve
17e0: 72 79 20 3c 62 3e 54 72 61 63 6b 20 53 65 67 6d ry <b>Track Segm
17f0: 65 6e 74 3c 2f 62 3e 20 66 6f 75 6e 64 20 77 69 ent</b> found wi
1800: 74 68 69 6e 20 74 68 65 20 47 50 58 2d 46 69 6c thin the GPX-Fil
1810: 65 2e 3c 62 72 3e 0d 0a 45 61 63 68 20 3c 62 3e e.<br>..Each <b>
1820: 54 72 61 63 6b 50 6f 69 6e 74 3c 2f 62 3e 20 77 TrackPoint</b> w
1830: 69 6c 6c 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 ill correspond t
1840: 6f 20 61 20 56 65 72 74 65 78 20 6f 66 20 74 68 o a Vertex of th
1850: 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 e corresponding
1860: 4c 69 6e 65 73 74 72 69 6e 67 0d 0a 3c 75 6c 3e Linestring..<ul>
1870: 0d 0a 3c 6c 69 3e 74 68 65 20 3c 62 3e 58 3c 2f ..<li>the <b>X</
1880: 62 3e 20 61 6e 64 20 3c 62 3e 59 3c 2f 62 3e 20 b> and <b>Y</b>
1890: 63 6f 6f 72 64 69 6e 61 74 65 73 20 6f 66 20 74 coordinates of t
18a0: 68 65 20 56 65 72 74 65 78 20 77 69 6c 6c 20 62 he Vertex will b
18b0: 65 20 73 65 74 20 61 63 63 6f 72 64 69 6e 67 6c e set accordingl
18c0: 79 20 74 6f 20 74 68 65 20 64 65 63 6c 61 72 65 y to the declare
18d0: 64 20 3c 62 3e 3c 69 3e 6c 6f 6e 3c 2f 69 3e 3c d <b><i>lon</i><
18e0: 2f 62 3e 20 61 6e 64 20 3c 62 3e 3c 69 3e 6c 61 /b> and <b><i>la
18f0: 74 3c 2f 69 3e 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d t</i></b>.</li>.
1900: 0a 3c 6c 69 3e 69 66 20 61 6e 20 3c 62 3e 3c 69 .<li>if an <b><i
1910: 3e 65 6c 65 3c 2f 69 3e 3c 2f 62 3e 20 74 61 67 >ele</i></b> tag
1920: 20 77 61 73 20 64 65 63 6c 61 72 65 64 20 74 68 was declared th
1930: 65 20 3c 62 3e 5a 3c 2f 62 3e 20 63 6f 6f 72 64 e <b>Z</b> coord
1940: 69 6e 61 74 65 20 77 69 6c 6c 20 62 65 20 73 65 inate will be se
1950: 74 20 74 6f 20 74 68 65 20 63 6f 72 72 65 73 70 t to the corresp
1960: 6f 6e 64 69 6e 67 20 76 61 6c 75 65 2e 3c 62 72 onding value.<br
1970: 3e 0d 0a 4f 74 68 65 72 77 69 73 65 20 74 68 65 >..Otherwise the
1980: 20 3c 62 3e 5a 3c 2f 62 3e 20 63 6f 6f 72 64 69 <b>Z</b> coordi
1990: 6e 61 74 65 20 77 69 6c 6c 20 62 65 20 73 65 74 nate will be set
19a0: 20 74 6f 20 3c 62 3e 30 2e 30 3c 2f 62 3e 20 28 to <b>0.0</b> (
19b0: 64 65 66 61 75 6c 74 20 76 61 6c 75 65 29 2e 3c default value).<
19c0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 66 20 61 20 3c /li>..<li>if a <
19d0: 62 3e 3c 69 3e 74 69 6d 65 3c 2f 69 3e 3c 2f 62 b><i>time</i></b
19e0: 3e 20 74 61 67 20 77 61 73 20 64 65 63 6c 61 72 > tag was declar
19f0: 65 64 2c 20 74 68 65 20 49 53 4f 20 38 36 30 31 ed, the ISO 8601
1a00: 20 74 69 6d 65 73 74 61 6d 70 20 77 69 6c 6c 20 timestamp will
1a10: 62 65 20 74 72 61 6e 73 66 6f 72 6d 65 64 20 69 be transformed i
1a20: 6e 74 6f 20 61 20 3c 61 20 68 72 65 66 3d 22 68 nto a <a href="h
1a30: 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 ttps://en.wikipe
1a40: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4a 75 6c dia.org/wiki/Jul
1a50: 69 61 6e 5f 64 61 79 22 3e 6a 75 6c 69 61 6e 20 ian_day">julian
1a60: 64 61 79 20 6e 75 6d 62 65 72 3c 2f 61 3e 2c 20 day number</a>,
1a70: 61 6e 64 20 74 68 65 20 3c 62 3e 4d 3c 2f 62 3e and the <b>M</b>
1a80: 20 63 6f 6f 72 64 69 6e 61 74 65 20 77 69 6c 6c coordinate will
1a90: 20 62 65 20 73 65 74 20 74 6f 20 74 68 65 20 63 be set to the c
1aa0: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 76 61 6c orresponding val
1ab0: 75 65 2e 3c 62 72 3e 0d 0a 4f 74 68 65 72 77 69 ue.<br>..Otherwi
1ac0: 73 65 20 74 68 65 20 3c 62 3e 4d 3c 2f 62 3e 20 se the <b>M</b>
1ad0: 63 6f 6f 72 64 69 6e 61 74 65 20 77 69 6c 6c 20 coordinate will
1ae0: 62 65 20 73 65 74 20 74 6f 20 3c 62 3e 31 37 32 be set to <b>172
1af0: 31 30 35 39 2e 35 3c 2f 62 3e 2c 20 74 68 69 73 1059.5</b>, this
1b00: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 corresponding t
1b10: 6f 20 3c 62 3e 30 30 30 30 2d 30 31 2d 30 31 54 o <b>0000-01-01T
1b20: 30 30 3a 30 30 3a 30 30 5a 3c 2f 62 3e 20 28 64 00:00:00Z</b> (d
1b30: 65 66 61 75 6c 74 20 76 61 6c 75 65 29 2e 3c 2f efault value).</
1b40: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 6c 69 li>..</ul>..</li
1b50: 3e 20 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 3c > ..</ul><br>..<
1b60: 68 72 3e 0d 0a 3c 68 32 3e 43 68 65 63 6b 69 6e hr>..<h2>Checkin
1b70: 67 20 74 68 65 20 69 6d 70 6f 72 74 65 64 20 54 g the imported T
1b80: 72 61 63 6b 50 6f 69 6e 74 73 3c 2f 68 32 3e 0d rackPoints</h2>.
1b90: 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c .<verbatim>..SEL
1ba0: 45 43 54 20 27 50 6f 69 6e 74 20 23 31 27 20 41 ECT 'Point #1' A
1bb0: 53 20 70 6f 69 6e 74 2c 20 53 54 5f 58 28 61 2e S point, ST_X(a.
1bc0: 70 74 29 20 41 53 20 6c 6f 6e 2c 20 53 54 5f 59 pt) AS lon, ST_Y
1bd0: 28 61 2e 70 74 29 20 41 53 20 6c 61 74 2c 20 53 (a.pt) AS lat, S
1be0: 54 5f 5a 28 61 2e 70 74 29 20 41 53 20 65 6c 65 T_Z(a.pt) AS ele
1bf0: 2c 20 44 61 74 65 54 69 6d 65 28 53 54 5f 4d 28 , DateTime(ST_M(
1c00: 61 2e 70 74 29 29 20 41 53 20 74 69 6d 65 0d 0a a.pt)) AS time..
1c10: 46 52 4f 4d 20 28 53 45 4c 45 43 54 20 53 54 5f FROM (SELECT ST_
1c20: 53 74 61 72 74 50 6f 69 6e 74 28 67 65 6f 6d 29 StartPoint(geom)
1c30: 20 41 53 20 70 74 20 46 52 4f 4d 20 67 70 78 5f AS pt FROM gpx_
1c40: 74 72 61 63 6b 73 29 20 41 53 20 61 0d 0a 55 4e tracks) AS a..UN
1c50: 49 4f 4e 0d 0a 53 45 4c 45 43 54 20 27 50 6f 69 ION..SELECT 'Poi
1c60: 6e 74 20 23 32 27 20 41 53 20 70 6f 69 6e 74 2c nt #2' AS point,
1c70: 20 53 54 5f 58 28 61 2e 70 74 29 20 41 53 20 6c ST_X(a.pt) AS l
1c80: 6f 6e 2c 20 53 54 5f 59 28 61 2e 70 74 29 20 41 on, ST_Y(a.pt) A
1c90: 53 20 6c 61 74 2c 20 53 54 5f 5a 28 61 2e 70 74 S lat, ST_Z(a.pt
1ca0: 29 20 41 53 20 65 6c 65 2c 20 44 61 74 65 54 69 ) AS ele, DateTi
1cb0: 6d 65 28 53 54 5f 4d 28 61 2e 70 74 29 29 20 41 me(ST_M(a.pt)) A
1cc0: 53 20 74 69 6d 65 0d 0a 46 52 4f 4d 20 28 53 45 S time..FROM (SE
1cd0: 4c 45 43 54 20 53 54 5f 50 6f 69 6e 74 4e 28 67 LECT ST_PointN(g
1ce0: 65 6f 6d 2c 20 32 29 20 41 53 20 70 74 20 46 52 eom, 2) AS pt FR
1cf0: 4f 4d 20 67 70 78 5f 74 72 61 63 6b 73 29 20 41 OM gpx_tracks) A
1d00: 53 20 61 0d 0a 55 4e 49 4f 4e 0d 0a 53 45 4c 45 S a..UNION..SELE
1d10: 43 54 20 27 50 6f 69 6e 74 20 23 33 27 20 41 53 CT 'Point #3' AS
1d20: 20 70 6f 69 6e 74 2c 20 53 54 5f 58 28 61 2e 70 point, ST_X(a.p
1d30: 74 29 20 41 53 20 6c 6f 6e 2c 20 53 54 5f 59 28 t) AS lon, ST_Y(
1d40: 61 2e 70 74 29 20 41 53 20 6c 61 74 2c 20 53 54 a.pt) AS lat, ST
1d50: 5f 5a 28 61 2e 70 74 29 20 41 53 20 65 6c 65 2c _Z(a.pt) AS ele,
1d60: 20 44 61 74 65 54 69 6d 65 28 53 54 5f 4d 28 61 DateTime(ST_M(a
1d70: 2e 70 74 29 29 20 41 53 20 74 69 6d 65 0d 0a 46 .pt)) AS time..F
1d80: 52 4f 4d 20 28 53 45 4c 45 43 54 20 53 54 5f 50 ROM (SELECT ST_P
1d90: 6f 69 6e 74 4e 28 67 65 6f 6d 2c 20 33 29 20 41 ointN(geom, 3) A
1da0: 53 20 70 74 20 46 52 4f 4d 20 67 70 78 5f 74 72 S pt FROM gpx_tr
1db0: 61 63 6b 73 29 20 41 53 20 61 0d 0a 55 4e 49 4f acks) AS a..UNIO
1dc0: 4e 0d 0a 53 45 4c 45 43 54 20 27 50 6f 69 6e 74 N..SELECT 'Point
1dd0: 20 23 4e 27 20 41 53 20 70 6f 69 6e 74 2c 20 53 #N' AS point, S
1de0: 54 5f 58 28 61 2e 70 74 29 20 41 53 20 6c 6f 6e T_X(a.pt) AS lon
1df0: 2c 20 53 54 5f 59 28 61 2e 70 74 29 20 41 53 20 , ST_Y(a.pt) AS
1e00: 6c 61 74 2c 20 53 54 5f 5a 28 61 2e 70 74 29 20 lat, ST_Z(a.pt)
1e10: 41 53 20 65 6c 65 2c 20 44 61 74 65 54 69 6d 65 AS ele, DateTime
1e20: 28 53 54 5f 4d 28 61 2e 70 74 29 29 20 41 53 20 (ST_M(a.pt)) AS
1e30: 74 69 6d 65 0d 0a 46 52 4f 4d 20 28 53 45 4c 45 time..FROM (SELE
1e40: 43 54 20 53 54 5f 45 6e 64 50 6f 69 6e 74 28 67 CT ST_EndPoint(g
1e50: 65 6f 6d 29 20 41 53 20 70 74 20 46 52 4f 4d 20 eom) AS pt FROM
1e60: 67 70 78 5f 74 72 61 63 6b 73 29 20 41 53 20 61 gpx_tracks) AS a
1e70: 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a ;..</verbatim>..
1e80: 3c 74 61 62 6c 65 20 62 67 63 6f 6c 6f 72 3d 22 <table bgcolor="
1e90: 23 64 30 66 66 62 30 22 20 63 65 6c 6c 73 70 61 #d0ffb0" cellspa
1ea0: 63 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 cing="4" cellpad
1eb0: 64 69 6e 67 3d 22 34 22 20 62 6f 72 64 65 72 3d ding="4" border=
1ec0: 22 31 22 3e 0d 0a 3c 74 72 3e 3c 74 64 20 62 67 "1">..<tr><td bg
1ed0: 63 6f 6c 6f 72 3d 22 23 63 30 64 64 61 6f 22 3e color="#c0ddao">
1ee0: 3c 62 3e 70 6f 69 6e 74 3c 2f 62 3e 3c 2f 74 64 <b>point</b></td
1ef0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 63 ><td bgcolor="#c
1f00: 30 64 64 61 6f 22 3e 3c 62 3e 6c 6f 6e 3c 2f 62 0ddao"><b>lon</b
1f10: 3e 3c 2f 74 64 3e 3c 74 64 20 62 67 63 6f 6c 6f ></td><td bgcolo
1f20: 72 3d 22 23 63 30 64 64 61 6f 22 3e 3c 62 3e 6c r="#c0ddao"><b>l
1f30: 61 74 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 62 at</b></td><td b
1f40: 67 63 6f 6c 6f 72 3d 22 23 63 30 64 64 61 6f 22 gcolor="#c0ddao"
1f50: 3e 3c 62 3e 65 6c 65 3c 2f 62 3e 3c 2f 74 64 3e ><b>ele</b></td>
1f60: 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 63 30 <td bgcolor="#c0
1f70: 64 64 61 6f 22 3e 3c 62 3e 74 69 6d 65 3c 2f 62 ddao"><b>time</b
1f80: 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 ></td></tr>..<tr
1f90: 3e 3c 74 64 3e 50 6f 69 6e 74 20 23 31 3c 2f 74 ><td>Point #1</t
1fa0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 d><td align="rig
1fb0: 68 74 22 3e 33 37 2e 38 30 38 32 35 30 3c 2f 74 ht">37.808250</t
1fc0: 64 3e 3c 74 64 20 61 6c 6f 67 6e 3d 22 72 69 67 d><td alogn="rig
1fd0: 68 74 22 3e 35 35 2e 37 35 33 35 37 32 3c 2f 74 ht">55.753572</t
1fe0: 64 3e 3c 74 64 3e 31 33 35 2e 30 30 30 30 30 30 d><td>135.000000
1ff0: 3c 2f 74 64 3e 3c 74 64 3e 32 30 30 39 2d 30 35 </td><td>2009-05
2000: 2d 31 39 20 30 34 3a 30 30 3a 33 30 3c 2f 74 64 -19 04:00:30</td
2010: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
2020: 50 6f 69 6e 74 20 23 32 3c 2f 74 64 3e 3c 74 64 Point #2</td><td
2030: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 33 align="right">3
2040: 37 2e 38 30 38 32 35 35 3c 2f 74 64 3e 3c 74 64 7.808255</td><td
2050: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 35 align="right">5
2060: 35 2e 37 35 33 36 32 32 3c 2f 74 64 3e 3c 74 64 5.753622</td><td
2070: 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 3e 31 align="right">1
2080: 33 35 2e 30 30 30 30 30 30 3c 2f 74 64 3e 3c 74 35.000000</td><t
2090: 64 3e 32 30 30 39 2d 30 35 2d 31 39 20 30 34 3a d>2009-05-19 04:
20a0: 30 30 3a 33 31 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 00:31</td></tr>.
20b0: 0a 3c 74 72 3e 3c 74 64 3e 50 6f 69 6e 74 20 23 .<tr><td>Point #
20c0: 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 3</td><td align=
20d0: 22 72 69 67 68 74 22 3e 33 37 2e 38 30 38 31 35 "right">37.80815
20e0: 38 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 8</td><td align=
20f0: 22 72 69 67 68 74 22 3e 35 35 2e 37 35 33 35 39 "right">55.75359
2100: 33 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 3</td><td align=
2110: 22 72 69 67 68 74 22 3e 31 33 35 2e 30 30 30 30 "right">135.0000
2120: 30 30 3c 2f 74 64 3e 3c 74 64 3e 32 30 30 39 2d 00</td><td>2009-
2130: 30 35 2d 31 39 20 30 34 3a 30 30 3a 33 32 3c 2f 05-19 04:00:32</
2140: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
2150: 64 3e 50 6f 69 6e 74 20 23 4e 3c 2f 74 64 3e 3c d>Point #N</td><
2160: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2170: 3e 33 37 2e 36 37 37 38 30 32 3c 2f 74 64 3e 3c >37.677802</td><
2180: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
2190: 3e 35 35 2e 37 35 38 31 37 37 3c 2f 74 64 3e 3c >55.758177</td><
21a0: 74 64 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 td align="right"
21b0: 3e 31 35 32 2e 30 30 30 30 30 30 3c 2f 74 64 3e >152.000000</td>
21c0: 3c 74 64 3e 32 30 30 39 2d 30 35 2d 31 39 20 30 <td>2009-05-19 0
21d0: 34 3a 34 36 3a 32 37 3c 2f 74 64 3e 3c 2f 74 72 4:46:27</td></tr
21e0: 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d >..</table><br>.
21f0: 0a 41 73 20 79 6f 75 20 63 61 6e 20 65 61 73 69 .As you can easi
2200: 6c 79 20 73 65 65 2c 20 74 68 65 20 4d 75 6c 74 ly see, the Mult
2210: 69 4c 69 6e 65 73 74 72 69 6e 67 20 58 59 5a 4d iLinestring XYZM
2220: 20 72 65 74 75 72 6e 65 64 20 62 79 20 3c 62 3e returned by <b>
2230: 58 42 5f 4d 4c 69 6e 65 46 72 6f 6d 47 50 58 28 XB_MLineFromGPX(
2240: 29 3c 2f 62 3e 20 66 61 69 74 68 66 75 6c 6c 79 )</b> faithfully
2250: 20 70 72 65 73 65 72 76 65 73 20 62 6f 74 68 20 preserves both
2260: 74 68 65 20 73 70 61 74 69 61 6c 20 63 6f 6f 72 the spatial coor
2270: 64 69 6e 61 74 65 73 20 61 6e 64 20 74 68 65 20 dinates and the
2280: 74 69 6d 65 73 74 61 6d 70 73 20 6f 72 69 67 69 timestamps origi
2290: 6e 61 6c 6c 79 20 72 65 67 69 73 74 65 72 65 64 nally registered
22a0: 20 62 79 20 74 68 65 20 47 50 53 20 73 65 6e 73 by the GPS sens
22b0: 6f 72 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c or...<br><br>..<
22c0: 74 61 62 6c 65 20 77 69 64 74 68 3d 22 31 30 30 table width="100
22d0: 25 22 3e 3c 74 72 3e 0d 0a 3c 74 64 20 77 69 64 %"><tr>..<td wid
22e0: 74 68 3d 22 33 33 25 22 20 61 6c 69 67 6e 3d 22 th="33%" align="
22f0: 6c 65 66 74 22 3e 3c 2f 74 64 3e 0d 0a 3c 74 64 left"></td>..<td
2300: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
2310: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f <a href="https:/
2320: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 /www.gaia-gis.it
2330: 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 70 61 74 69 /fossil/libspati
2340: 61 6c 69 74 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d alite/wiki?name=
2350: 6d 69 73 63 2d 64 6f 63 73 22 3e 62 61 63 6b 20 misc-docs">back
2360: 74 6f 20 69 6e 64 65 78 3c 2f 61 3e 3c 2f 74 64 to index</a></td
2370: 3e 0d 0a 3c 74 64 20 77 69 64 74 68 3d 22 33 33 >..<td width="33
2380: 25 22 20 61 6c 69 67 6e 3d 22 72 69 67 68 74 22 %" align="right"
2390: 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 ></td>..</tr></t
23a0: 61 62 6c 65 3e 0a 5a 20 63 61 61 30 32 62 35 30 able>.Z caa02b50
23b0: 62 37 32 64 38 62 39 35 39 37 34 32 37 38 32 64 b72d8b959742782d
23c0: 37 37 32 38 32 38 62 36 0a 772828b6.