GPS Exchange Format

from Wikipedia, the free encyclopedia
GPS Exchange Format
File extension : .gpx
Developed by: TopoGrafix
Type: Markup language
Extended by: XML
Website : GPX: the GPS Exchange Format

The GPS Exchange Format ( GPX ) is a data format for storing geodata (originally mainly GPS data) that was developed by TopoGrafix . It is based on the general XML standard. An XML schema describes the elements and the structure of the GPS exchange format. The abbreviation .gpx is used as the file extension .

The GPS Exchange Format is an open, license-free format that can be used by anyone free of charge. It can facilitate the exchange of geospatial data between different programs.

Properties of the GPX format

Waypoints, Route and Track

The XML schema for the GPX standard defines a number of data types or tags, the schema is expandable. Most GPS receivers mainly provide data for waypoints , routes and tracks . In the GPX format, this data can be converted to metadata such as B. Author or description can be added.

The geographical coordinates latitude, longitude and altitude of the coordinates in a GPX file refer to the WGS84 reference ellipsoid. A position specification in GPX format takes place in degrees with decimal degrees as decimal places. One meter at the equator corresponds to approx. 0.000009 ° (see the original definition of meter ). As a rule of thumb, the sixth decimal place indicates an accuracy in the decimeter range. Specifications with two decimal places are in the kilometer range. Heights are given in meters.

The GPX format has the advantage that the data is available as text in a form that is easy for humans to read. However, this results in a considerably higher storage requirement. Different types of geometry (points, lines, areas) can be saved in a single GPX file.

A GPX file can be validated. It is checked whether the structure of the file follows the rules defined in the XML schema and is therefore valid. The XML schema of the GPX format is currently in version 1.1.

construction

A GPX file consists of the coordinates and their description. A distinction is made according to type:

Waypoint ( <wpt>)
Individual location points / waypoints.
Route ( <rte>)
A sorted sequence of location points / waypoints ( <rtept>). Describes a planned course or a series of turning points to get to a goal.
Track ( <trk>)
A sorted list of consecutive points ( <trkpt>) that make up a line. For example, a path recorded by a GPS device. The points are again summarized in individual sections (track segment, short <trkseg>).

All three types can be listed in a file (also several times).

The basic structure is set up as follows, with UTF-8 coded data, a byte order mark must be expected at the beginning of the file :

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx version="1.1" creator="Ersteller der Datei">
  <metadata> <!-- Metadaten --> </metadata>
  <wpt lat="xx.xxx" lon="yy.yyy"> <!-- Attribute des Wegpunkts --> </wpt>
  <!-- weitere Wegpunkte -->
  <rte>
    <!-- Attribute der Route -->
    <rtept lat="xx.xxx" lon="yy.yyy"> <!-- Attribute des Routenpunkts --> </rtept>
    <!-- weitere Routenpunkte -->
  </rte>
  <!-- weitere Routen -->
  <trk>
    <!-- Attribute des Tracks -->
    <trkseg>
      <trkpt lat="xx.xxx" lon="yy.yyy"> <!-- Attribute des Trackpunkts --> </trkpt>
      <!-- weitere Trackpunkte -->
    </trkseg>
    <!-- weitere Track-Segmente -->
  </trk>
  <!-- weitere Tracks -->
</gpx>

The possible attributes are the same for waypoints, route points and track points. In addition to lat(latitude) and lon(longitude), the following elements can be used to describe the coordinate further :

<ele> xsd:decimal </ele>                     <!-- Höhe in m -->
<time> xsd:dateTime </time>                  <!-- Datum und Zeit (UTC/Zulu) in ISO 8601 Format: yyyy-mm-ddThh:mm:ssZ -->
<magvar> degreesType </magvar>               <!-- Deklination / magnetische Missweisung vor Ort in Grad -->
<geoidheight> xsd:decimal </geoidheight>     <!-- Höhe bezogen auf Geoid -->
<name> xsd:string </name>                    <!-- Eigenname des Elements -->
<cmt> xsd:string </cmt>                      <!-- Kommentar -->
<desc> xsd:string </desc>                    <!-- Elementbeschreibung -->
<src> xsd:string </src>                      <!-- Datenquelle/Ursprung -->
<link> linkType </link>                      <!-- Link zu weiterführenden Infos -->
<sym> xsd:string </sym>                      <!-- Darstellungssymbol -->
<type> xsd:string </type>                    <!-- Klassifikation -->
<fix> fixType </fix>                         <!-- Art der Positionsfeststellung: none, 2d, 3d, dgps, pps -->
<sat> xsd:nonNegativeInteger </sat>          <!-- Anzahl der zur Positionsberechnung herangezogenen Satelliten -->
<hdop> xsd:decimal </hdop>                   <!-- HDOP: Horizontale Streuung der Positionsangabe -->
<vdop> xsd:decimal </vdop>                   <!-- VDOP: Vertikale Streuung der Positionsangabe -->
<pdop> xsd:decimal </pdop>                   <!-- PDOP: Streuung der Positionsangabe -->
<ageofdgpsdata> xsd:decimal </ageofdgpsdata> <!-- Sekunden zwischen letztem DGPS-Empfang und Positionsberechnung -->
<dgpsid> dgpsStationType:integer </dgpsid>   <!-- ID der verwendeten DGPS Station -->
<extensions> extensionsType </extensions>    <!-- GPX Erweiterung -->

example

The following GPX example shows the most important elements based on the positions of the parliament buildings in Germany, Austria and Switzerland:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="Wikipedia"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
 <!-- Kommentare sehen so aus -->
 <metadata>
  <name>Dateiname</name>
  <desc>Validiertes GPX-Beispiel ohne Sonderzeichen</desc>
  <author>
   <name>Autorenname</name>
  </author>
 </metadata>
 <wpt lat="52.518611" lon="13.376111">
  <ele>35.0</ele>
  <time>2011-12-31T23:59:59Z</time>
  <name>Reichstag (Berlin)</name>
  <sym>City</sym>
 </wpt>
 <wpt lat="48.208031" lon="16.358128">
  <ele>179</ele>
  <time>2011-12-31T23:59:59Z</time>
  <name>Parlament (Wien)</name>
  <sym>City</sym>
 </wpt>
 <wpt lat="46.9466" lon="7.44412">
  <time>2011-12-31T23:59:59Z</time>
  <name>Bundeshaus (Bern)</name>
  <sym>City</sym>
 </wpt>
 <rte>
  <name>Routenname</name>
  <desc>Routenbeschreibung</desc>
  <rtept lat="52.0" lon="13.5">
   <ele>33.0</ele>
   <time>2011-12-13T23:59:59Z</time>
   <name>rtept 1</name>
  </rtept>
  <rtept lat="49" lon="12">
   <name>rtept 2</name>
  </rtept>
  <rtept lat="47.0" lon="7.5">
  </rtept>
 </rte>
 <trk>
  <name>Trackname1</name>
  <desc>Trackbeschreibung</desc>
  <trkseg>
   <trkpt lat="52.520000" lon="13.380000">
    <ele>36.0</ele>
    <time>2011-01-13T01:01:01Z</time>
   </trkpt>
   <trkpt lat="48.200000" lon="16.260000">
    <ele>180</ele>
    <time>2011-01-14T01:59:01Z</time>
   </trkpt>
   <trkpt lat="46.95" lon="7.4">
    <ele>987.654</ele>
    <time>2011-01-15T23:59:01Z</time>
   </trkpt>
  </trkseg>
 </trk>
 <trk>
  <name>Trackname2</name>
  <trkseg>
   <trkpt lat="47.2" lon="7.41">
    <time>2011-01-16T23:59:01Z</time>
   </trkpt>
   <trkpt lat="52.53" lon="13.0">
   </trkpt>
  </trkseg>
 </trk>
</gpx>

The example was validated with the Xerces software , but different display programs (e.g. Google Earth ) may show different representations because the elements were deliberately completely attributed differently.

Extensions

As an XML dialect, the GPX format allows you to embed your own extensions, although these are not part of the GPX schema. One example is the GPX extensions from Garmin .

See also

Web links

Individual evidence

  1. GPX 1.1 Schema Documentation. topografix.com, accessed on November 7, 2017 (English).
  2. Garmin GPX Extensions Format v3. Garmin, accessed May 16, 2017 .