gpx.rng 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <grammar ns="http://www.topografix.com/GPX/1/1" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  3. <start combine="choice">
  4. <a:documentation>GPX schema version 1.1 - For more information on GPX and this schema, visit http://www.topografix.com/gpx.asp
  5. GPX uses the following conventions: all coordinates are relative to the WGS84 datum. All measurements are in metric units.</a:documentation>
  6. <ref name="gpx"/>
  7. </start>
  8. <define name="gpx">
  9. <element name="gpx">
  10. <a:documentation>GPX is the root element in the XML file.</a:documentation>
  11. <ref name="gpxType"/>
  12. </element>
  13. </define>
  14. <define name="gpxType">
  15. <a:documentation>GPX documents contain a metadata header, followed by waypoints, routes, and tracks. You can add your own elements
  16. to the extensions section of the GPX document.</a:documentation>
  17. <optional>
  18. <element name="metadata">
  19. <a:documentation>Metadata about the file.</a:documentation>
  20. <ref name="metadataType"/>
  21. </element>
  22. </optional>
  23. <zeroOrMore>
  24. <element name="wpt">
  25. <a:documentation>A list of waypoints.</a:documentation>
  26. <ref name="wptType"/>
  27. </element>
  28. </zeroOrMore>
  29. <zeroOrMore>
  30. <element name="rte">
  31. <a:documentation>A list of routes.</a:documentation>
  32. <ref name="rteType"/>
  33. </element>
  34. </zeroOrMore>
  35. <zeroOrMore>
  36. <element name="trk">
  37. <a:documentation>A list of tracks.</a:documentation>
  38. <ref name="trkType"/>
  39. </element>
  40. </zeroOrMore>
  41. <optional>
  42. <element name="extensions">
  43. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  44. <ref name="extensionsType"/>
  45. </element>
  46. </optional>
  47. <attribute name="version">
  48. <a:documentation>You must include the version number in your GPX document.</a:documentation>
  49. <data type="string"/>
  50. </attribute>
  51. <attribute name="creator">
  52. <a:documentation>You must include the name or URL of the software that created your GPX document. This allows others to
  53. inform the creator of a GPX instance document that fails to validate.</a:documentation>
  54. <data type="string"/>
  55. </attribute>
  56. </define>
  57. <define name="metadataType">
  58. <a:documentation>Information about the GPX file, author, and copyright restrictions goes in the metadata section. Providing rich,
  59. meaningful information about your GPX files allows others to search for and use your GPS data.
  60. elements must appear in this order</a:documentation>
  61. <optional>
  62. <element name="name">
  63. <a:documentation>The name of the GPX file.</a:documentation>
  64. <data type="string"/>
  65. </element>
  66. </optional>
  67. <optional>
  68. <element name="desc">
  69. <a:documentation>A description of the contents of the GPX file.</a:documentation>
  70. <data type="string"/>
  71. </element>
  72. </optional>
  73. <optional>
  74. <element name="author">
  75. <a:documentation>The person or organization who created the GPX file.</a:documentation>
  76. <ref name="personType"/>
  77. </element>
  78. </optional>
  79. <optional>
  80. <element name="copyright">
  81. <a:documentation>Copyright and license information governing use of the file.</a:documentation>
  82. <ref name="copyrightType"/>
  83. </element>
  84. </optional>
  85. <zeroOrMore>
  86. <element name="link">
  87. <a:documentation>URLs associated with the location described in the file.</a:documentation>
  88. <ref name="linkType"/>
  89. </element>
  90. </zeroOrMore>
  91. <optional>
  92. <element name="time">
  93. <a:documentation>The creation date of the file.</a:documentation>
  94. <data type="dateTime"/>
  95. </element>
  96. </optional>
  97. <optional>
  98. <element name="keywords">
  99. <a:documentation>Keywords associated with the file. Search engines or databases can use this information to classify the data.</a:documentation>
  100. <data type="string"/>
  101. </element>
  102. </optional>
  103. <optional>
  104. <element name="bounds">
  105. <a:documentation>Minimum and maximum coordinates which describe the extent of the coordinates in the file.</a:documentation>
  106. <ref name="boundsType"/>
  107. </element>
  108. </optional>
  109. <optional>
  110. <element name="extensions">
  111. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  112. <ref name="extensionsType"/>
  113. </element>
  114. </optional>
  115. </define>
  116. <!-- elements must appear in this order -->
  117. <define name="wptType">
  118. <a:documentation>wpt represents a waypoint, point of interest, or named feature on a map.</a:documentation>
  119. <optional>
  120. <!-- Position info -->
  121. <element name="ele">
  122. <a:documentation>Elevation (in meters) of the point.</a:documentation>
  123. <data type="decimal"/>
  124. </element>
  125. </optional>
  126. <optional>
  127. <element name="time">
  128. <a:documentation>Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs.</a:documentation>
  129. <data type="dateTime"/>
  130. </element>
  131. </optional>
  132. <optional>
  133. <element name="magvar">
  134. <a:documentation>Magnetic variation (in degrees) at the point</a:documentation>
  135. <ref name="degreesType"/>
  136. </element>
  137. </optional>
  138. <optional>
  139. <element name="geoidheight">
  140. <a:documentation>Height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.</a:documentation>
  141. <data type="decimal"/>
  142. </element>
  143. </optional>
  144. <optional>
  145. <!-- Description info -->
  146. <element name="name">
  147. <a:documentation>The GPS name of the waypoint. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS.</a:documentation>
  148. <data type="string"/>
  149. </element>
  150. </optional>
  151. <optional>
  152. <element name="cmt">
  153. <a:documentation>GPS waypoint comment. Sent to GPS as comment.</a:documentation>
  154. <data type="string"/>
  155. </element>
  156. </optional>
  157. <optional>
  158. <element name="desc">
  159. <a:documentation>A text description of the element. Holds additional information about the element intended for the user, not the GPS.</a:documentation>
  160. <data type="string"/>
  161. </element>
  162. </optional>
  163. <optional>
  164. <element name="src">
  165. <a:documentation>Source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g.</a:documentation>
  166. <data type="string"/>
  167. </element>
  168. </optional>
  169. <zeroOrMore>
  170. <element name="link">
  171. <a:documentation>Link to additional information about the waypoint.</a:documentation>
  172. <ref name="linkType"/>
  173. </element>
  174. </zeroOrMore>
  175. <optional>
  176. <element name="sym">
  177. <a:documentation>Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out.</a:documentation>
  178. <data type="string"/>
  179. </element>
  180. </optional>
  181. <optional>
  182. <element name="type">
  183. <a:documentation>Type (classification) of the waypoint.</a:documentation>
  184. <data type="string"/>
  185. </element>
  186. </optional>
  187. <optional>
  188. <!-- Accuracy info -->
  189. <element name="fix">
  190. <a:documentation>Type of GPX fix."</a:documentation>
  191. <ref name="fixType"/>
  192. </element>
  193. </optional>
  194. <optional>
  195. <element name="sat">
  196. <a:documentation>Number of satellites used to calculate the GPX fix.</a:documentation>
  197. <data type="nonNegativeInteger"/>
  198. </element>
  199. </optional>
  200. <optional>
  201. <element name="hdop">
  202. <a:documentation>Horizontal dilution of precision.</a:documentation>
  203. <data type="decimal"/>
  204. </element>
  205. </optional>
  206. <optional>
  207. <element name="vdop">
  208. <a:documentation>Vertical dilution of precision.</a:documentation>
  209. <data type="decimal"/>
  210. </element>
  211. </optional>
  212. <optional>
  213. <element name="pdop">
  214. <a:documentation>Position dilution of precision.</a:documentation>
  215. <data type="decimal"/>
  216. </element>
  217. </optional>
  218. <optional>
  219. <element name="ageofdgpsdata">
  220. <a:documentation>Number of seconds since last DGPS update.</a:documentation>
  221. <data type="decimal"/>
  222. </element>
  223. </optional>
  224. <optional>
  225. <element name="dgpsid">
  226. <a:documentation>ID of DGPS station used in differential correction.</a:documentation>
  227. <ref name="dgpsStationType"/>
  228. </element>
  229. </optional>
  230. <optional>
  231. <element name="extensions">
  232. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  233. <ref name="extensionsType"/>
  234. </element>
  235. </optional>
  236. <attribute name="lat">
  237. <a:documentation>The latitude of the point. This is always in decimal degrees, and always in WGS84 datum.</a:documentation>
  238. <ref name="latitudeType"/>
  239. </attribute>
  240. <attribute name="lon">
  241. <a:documentation>The longitude of the point. This is always in decimal degrees, and always in WGS84 datum.</a:documentation>
  242. <ref name="longitudeType"/>
  243. </attribute>
  244. </define>
  245. <define name="rteType">
  246. <a:documentation>rte represents route - an ordered list of waypoints representing a series of turn points leading to a destination.</a:documentation>
  247. <optional>
  248. <element name="name">
  249. <a:documentation>GPS name of route.</a:documentation>
  250. <data type="string"/>
  251. </element>
  252. </optional>
  253. <optional>
  254. <element name="cmt">
  255. <a:documentation>GPS comment for route.</a:documentation>
  256. <data type="string"/>
  257. </element>
  258. </optional>
  259. <optional>
  260. <element name="desc">
  261. <a:documentation>Text description of route for user. Not sent to GPS.</a:documentation>
  262. <data type="string"/>
  263. </element>
  264. </optional>
  265. <optional>
  266. <element name="src">
  267. <a:documentation>Source of data. Included to give user some idea of reliability and accuracy of data.</a:documentation>
  268. <data type="string"/>
  269. </element>
  270. </optional>
  271. <zeroOrMore>
  272. <element name="link">
  273. <a:documentation>Links to external information about the route.</a:documentation>
  274. <ref name="linkType"/>
  275. </element>
  276. </zeroOrMore>
  277. <optional>
  278. <element name="number">
  279. <a:documentation>GPS route number.</a:documentation>
  280. <data type="nonNegativeInteger"/>
  281. </element>
  282. </optional>
  283. <optional>
  284. <element name="type">
  285. <a:documentation>Type (classification) of route.</a:documentation>
  286. <data type="string"/>
  287. </element>
  288. </optional>
  289. <optional>
  290. <element name="extensions">
  291. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  292. <ref name="extensionsType"/>
  293. </element>
  294. </optional>
  295. <zeroOrMore>
  296. <element name="rtept">
  297. <a:documentation>A list of route points.</a:documentation>
  298. <ref name="wptType"/>
  299. </element>
  300. </zeroOrMore>
  301. </define>
  302. <define name="trkType">
  303. <a:documentation>trk represents a track - an ordered list of points describing a path.</a:documentation>
  304. <optional>
  305. <element name="name">
  306. <a:documentation>GPS name of track.</a:documentation>
  307. <data type="string"/>
  308. </element>
  309. </optional>
  310. <optional>
  311. <element name="cmt">
  312. <a:documentation>GPS comment for track.</a:documentation>
  313. <data type="string"/>
  314. </element>
  315. </optional>
  316. <optional>
  317. <element name="desc">
  318. <a:documentation>User description of track.</a:documentation>
  319. <data type="string"/>
  320. </element>
  321. </optional>
  322. <optional>
  323. <element name="src">
  324. <a:documentation>Source of data. Included to give user some idea of reliability and accuracy of data.</a:documentation>
  325. <data type="string"/>
  326. </element>
  327. </optional>
  328. <zeroOrMore>
  329. <element name="link">
  330. <a:documentation>Links to external information about track.</a:documentation>
  331. <ref name="linkType"/>
  332. </element>
  333. </zeroOrMore>
  334. <optional>
  335. <element name="number">
  336. <a:documentation>GPS track number.</a:documentation>
  337. <data type="nonNegativeInteger"/>
  338. </element>
  339. </optional>
  340. <optional>
  341. <element name="type">
  342. <a:documentation>Type (classification) of track.</a:documentation>
  343. <data type="string"/>
  344. </element>
  345. </optional>
  346. <optional>
  347. <element name="extensions">
  348. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  349. <ref name="extensionsType"/>
  350. </element>
  351. </optional>
  352. <zeroOrMore>
  353. <element name="trkseg">
  354. <a:documentation>A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.</a:documentation>
  355. <ref name="trksegType"/>
  356. </element>
  357. </zeroOrMore>
  358. </define>
  359. <define name="extensionsType">
  360. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  361. <zeroOrMore>
  362. <element>
  363. <anyName/>
  364. <text/>
  365. </element>
  366. </zeroOrMore>
  367. </define>
  368. <define name="trksegType">
  369. <a:documentation>A Track Segment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.</a:documentation>
  370. <zeroOrMore>
  371. <!-- elements must appear in this order -->
  372. <element name="trkpt">
  373. <a:documentation>A Track Point holds the coordinates, elevation, timestamp, and metadata for a single point in a track.</a:documentation>
  374. <ref name="wptType"/>
  375. </element>
  376. </zeroOrMore>
  377. <optional>
  378. <element name="extensions">
  379. <a:documentation>You can add extend GPX by adding your own elements from another schema here.</a:documentation>
  380. <ref name="extensionsType"/>
  381. </element>
  382. </optional>
  383. </define>
  384. <define name="copyrightType">
  385. <a:documentation>Information about the copyright holder and any license governing use of this file. By linking to an appropriate license,
  386. you may place your data into the public domain or grant additional usage rights.</a:documentation>
  387. <optional>
  388. <!-- elements must appear in this order -->
  389. <element name="year">
  390. <a:documentation>Year of copyright.</a:documentation>
  391. <data type="gYear"/>
  392. </element>
  393. </optional>
  394. <optional>
  395. <element name="license">
  396. <a:documentation>Link to external file containing license text.</a:documentation>
  397. <data type="anyURI"/>
  398. </element>
  399. </optional>
  400. <attribute name="author">
  401. <a:documentation>Copyright holder (TopoSoft, Inc.)</a:documentation>
  402. <data type="string"/>
  403. </attribute>
  404. </define>
  405. <define name="linkType">
  406. <a:documentation>A link to an external resource (Web page, digital photo, video clip, etc) with additional information.</a:documentation>
  407. <optional>
  408. <!-- elements must appear in this order -->
  409. <element name="text">
  410. <a:documentation>Text of hyperlink.</a:documentation>
  411. <data type="string"/>
  412. </element>
  413. </optional>
  414. <optional>
  415. <element name="type">
  416. <a:documentation>Mime type of content (image/jpeg)</a:documentation>
  417. <data type="string"/>
  418. </element>
  419. </optional>
  420. <attribute name="href">
  421. <a:documentation>URL of hyperlink.</a:documentation>
  422. <data type="anyURI"/>
  423. </attribute>
  424. </define>
  425. <define name="emailType">
  426. <a:documentation>An email address. Broken into two parts (id and domain) to help prevent email harvesting.</a:documentation>
  427. <attribute name="id">
  428. <a:documentation>id half of email address (billgates2004)</a:documentation>
  429. <data type="string"/>
  430. </attribute>
  431. <attribute name="domain">
  432. <a:documentation>domain half of email address (hotmail.com)</a:documentation>
  433. <data type="string"/>
  434. </attribute>
  435. </define>
  436. <define name="personType">
  437. <a:documentation>A person or organization.</a:documentation>
  438. <optional>
  439. <!-- elements must appear in this order -->
  440. <element name="name">
  441. <a:documentation>Name of person or organization.</a:documentation>
  442. <data type="string"/>
  443. </element>
  444. </optional>
  445. <optional>
  446. <element name="email">
  447. <a:documentation>Email address.</a:documentation>
  448. <ref name="emailType"/>
  449. </element>
  450. </optional>
  451. <optional>
  452. <element name="link">
  453. <a:documentation>Link to Web site or other external information about person.</a:documentation>
  454. <ref name="linkType"/>
  455. </element>
  456. </optional>
  457. </define>
  458. <define name="ptType">
  459. <a:documentation>A geographic point with optional elevation and time. Available for use by other schemas.</a:documentation>
  460. <optional>
  461. <!-- elements must appear in this order -->
  462. <element name="ele">
  463. <a:documentation>The elevation (in meters) of the point.</a:documentation>
  464. <data type="decimal"/>
  465. </element>
  466. </optional>
  467. <optional>
  468. <element name="time">
  469. <a:documentation>The time that the point was recorded.</a:documentation>
  470. <data type="dateTime"/>
  471. </element>
  472. </optional>
  473. <attribute name="lat">
  474. <a:documentation>The latitude of the point. Decimal degrees, WGS84 datum.</a:documentation>
  475. <ref name="latitudeType"/>
  476. </attribute>
  477. <attribute name="lon">
  478. <a:documentation>The latitude of the point. Decimal degrees, WGS84 datum.</a:documentation>
  479. <ref name="longitudeType"/>
  480. </attribute>
  481. </define>
  482. <define name="ptsegType">
  483. <a:documentation>An ordered sequence of points. (for polygons or polylines, e.g.)</a:documentation>
  484. <zeroOrMore>
  485. <!-- elements must appear in this order -->
  486. <element name="pt">
  487. <a:documentation>Ordered list of geographic points.</a:documentation>
  488. <ref name="ptType"/>
  489. </element>
  490. </zeroOrMore>
  491. </define>
  492. <define name="boundsType">
  493. <a:documentation>Two lat/lon pairs defining the extent of an element.</a:documentation>
  494. <attribute name="minlat">
  495. <a:documentation> The minimum latitude. </a:documentation>
  496. <ref name="latitudeType"/>
  497. </attribute>
  498. <attribute name="minlon">
  499. <a:documentation>The minimum longitude. </a:documentation>
  500. <ref name="longitudeType"/>
  501. </attribute>
  502. <attribute name="maxlat">
  503. <a:documentation>The maximum latitude.</a:documentation>
  504. <ref name="latitudeType"/>
  505. </attribute>
  506. <attribute name="maxlon">
  507. <a:documentation>The maximum longitude.</a:documentation>
  508. <ref name="longitudeType"/>
  509. </attribute>
  510. </define>
  511. <define name="latitudeType">
  512. <a:documentation>The latitude of the point. Decimal degrees, WGS84 datum.</a:documentation>
  513. <data type="decimal">
  514. <param name="minInclusive">-90.0</param>
  515. <param name="maxInclusive">90.0</param>
  516. </data>
  517. </define>
  518. <define name="longitudeType">
  519. <a:documentation>The longitude of the point. Decimal degrees, WGS84 datum.</a:documentation>
  520. <data type="decimal">
  521. <param name="minInclusive">-180.0</param>
  522. <param name="maxExclusive">180.0</param>
  523. </data>
  524. </define>
  525. <define name="degreesType">
  526. <a:documentation>Used for bearing, heading, course. Units are decimal degrees, true (not magnetic).</a:documentation>
  527. <data type="decimal">
  528. <param name="minInclusive">0.0</param>
  529. <param name="maxExclusive">360.0</param>
  530. </data>
  531. </define>
  532. <define name="fixType">
  533. <a:documentation>Type of GPS fix. none means GPS had no fix. To signify "the fix info is unknown, leave out fixType entirely. pps = military signal used</a:documentation>
  534. <choice>
  535. <value>none</value>
  536. <value>2d</value>
  537. <value>3d</value>
  538. <value>dgps</value>
  539. <value>pps</value>
  540. </choice>
  541. </define>
  542. <define name="dgpsStationType">
  543. <a:documentation>Represents a differential GPS station.</a:documentation>
  544. <data type="integer">
  545. <param name="minInclusive">0</param>
  546. <param name="maxInclusive">1023</param>
  547. </data>
  548. </define>
  549. </grammar>