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.

  • Not an omission, just not open source. What GPS do you have and what software came with it? SBET files contain X, Y, Z and time, as well as others that aren't so useful generally. Jul 27, 2020 at 1:55
  • 2
    Google Earth KML does time developers.google.com/kml/documentation/time
    – Mapperz
    Jul 27, 2020 at 1:55
  • @MichaelStimson, I'm using custom generated GPS points from simulation and data logging from Android and iPhone apps. There's no software to export. It's all custom. Jul 27, 2020 at 3:00
  • @Mapperz, indeed, indeed, the kml specification includes time. this would be an excellent answer if you post as an answer. I'm aware Google Earth has fly thru animation but wasn't aware it was part of the kml format specification Jul 27, 2020 at 3:02
  • @MarcCompere you can provide your own answer, if you think say that KML can do it
    – nmtoken
    Jul 27, 2020 at 9:25

3 Answers 3


.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: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">
        <link href="http://www.garmin.com">
            <text>Garmin International</text>
        <name>2020-07-26 11:38:20 Day</name>
            <trkpt lat="53.0974245630" lon="-1.5002002381">
            <trkpt lat="53.0974645447" lon="-1.5003266372">
            <trkpt lat="53.0974570848" lon="-1.5003373660">
            <trkpt lat="53.0974551570" lon="-1.5003438201">
            <trkpt lat="53.0974393990" lon="-1.5003442392">

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).

  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)

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">

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.