TransWikia.com

File format for specifying GPS motion as a function of time?

Geographic Information Systems Asked by Marc Compere on September 25, 2021

What file format can specify GPS lat/lon/elev time history?

If I want to specify vehicle or pedestrian motion along a waypoint path, what is a compact way of specifying this?

.kml has waypoints but no time.

.gpx might work, but how?

This seems to be a glaring omission in file formats.

3 Answers

.gpx might work, but how?

The how for me, is my GPS writes it out like that, like:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1"
    xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
    xmlns:gpxtrkx="http://www.garmin.com/xmlschemas/TrackStatsExtension/v1"
    xmlns:wptx1="http://www.garmin.com/xmlschemas/WaypointExtension/v1"
    xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" creator="GPSMAP 64s"
    version="1.1" 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 http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackStatsExtension/v1 http://www8.garmin.com/xmlschemas/TrackStatsExtension.xsd http://www.garmin.com/xmlschemas/WaypointExtension/v1 http://www8.garmin.com/xmlschemas/WaypointExtensionv1.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd">
    <metadata>
        <link href="http://www.garmin.com">
            <text>Garmin International</text>
        </link>
        <time>2020-07-27T09:24:50Z</time>
    </metadata>
    <trk>
        <name>2020-07-26 11:38:20 Day</name>
        <extensions>
            <gpxx:TrackExtension>
                <gpxx:DisplayColor>Red</gpxx:DisplayColor>
            </gpxx:TrackExtension>
        </extensions>
        <trkseg>
            <trkpt lat="53.0974245630" lon="-1.5002002381">
                <ele>245.63</ele>
                <time>2020-07-26T10:38:20Z</time>
            </trkpt>
            <trkpt lat="53.0974645447" lon="-1.5003266372">
                <ele>241.92</ele>
                <time>2020-07-26T10:38:33Z</time>
            </trkpt>
            <trkpt lat="53.0974570848" lon="-1.5003373660">
                <ele>238.82</ele>
                <time>2020-07-26T10:38:35Z</time>
            </trkpt>
            <trkpt lat="53.0974551570" lon="-1.5003438201">
                <ele>234.75</ele>
                <time>2020-07-26T10:38:38Z</time>
            </trkpt>
            <trkpt lat="53.0974393990" lon="-1.5003442392">
                <ele>231.27</ele>
                <time>2020-07-26T10:38:41Z</time>
            </trkpt>
...

From me walking around yesterday.

More specifically, on what the structure of the GPX format is, you can refer to the schema (http://www.topografix.com/GPX/1/1/gpx.xsd).

Answered by nmtoken on September 25, 2021

  1. Microsoft Asia posts an impressive data set using GeoLife .plt files that use GPS + timstamps. Three academic references are helpful but it appears they are only GPS+timestamps with no formal format specification. (https://www.topografix.com/gpx_manual.asp#time)
  2. KML (.kml) files have a <when></when> field for waypoint time (https://developers.google.com/kml/documentation/time#gps)
  3. GPX (.gpx) files have a <time></time> field for location time (https://www.topografix.com/gpx_manual.asp#time)
  4. ROS bags (.bag) have timestamps built into the file format and if the ROS topic contains GPS coordinates, that'll work (http://wiki.ros.org/Bags)

Answered by Marc Compere on September 25, 2021

GPX is a good standard for saving GPS data, recording in a single file:

  • Un-ordered waypoints, with XYZ (lat, lon, elevation) - however the TIME field is often not filled (i.e. Garmin 60, 64 models), while a time string is recorded in the CMT (comment) or DESC (description) fields - however those latter two can get overwritten easily by the user.
  • Track lines;
  • Track points which are ordered points along a track, and record XYZ and a timestamp information;
  • Routes (lines) and route points used for navigation.

Track points normally don't encode any other information, but they can be extended with 'GPX Extensions' (creation option GPX_USE_EXTENSIONS=yes in some software) and then you can add any kind of data to every trackpoint (height above ground level (AGL) for example):

<trkpt lat="-3.39164866" lon="36.58644752">
    <ele>1439.5</ele>
    <speed>0.0</speed>
    <time>2016-04-08T09:39:36.419Z</time>
    <extensions>
        <ogr:agl>0</ogr:agl></extensions>
</trkpt>

BEWARE opening a GPX file with extensions in an app that doesn't 'understand' them - if you re-save often the extension data will disappear!

Answered by Simbamangu on September 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP