Gpx file format, what is the correct format?

1.7k Views Asked by At

My iOS program will create a gpx file. What is the correct format between these two? Is it:

<?xml version="1.0" encoding="UTF-8"?>
<gpx>
    <wpt lat="52.373" lon="4.871"></wpt>
    <wpt lat="52.374" lon="4.872"></wpt>
    <wpt lat="52.375" lon="4.871"></wpt>
</gpx>

Or

<?xml version="1.0" encoding="UTF-8"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="GPSLogger">
    <trk>
        <name>New Track</name>

        <trkseg>    
            <trkpt lat="52.373" lon="4.871"></trkpt>
            <trkpt lat="52.374" lon="4.872"></trkpt>
            <trkptt lat="52.375" lon="4.871"></trkpt>
        </trkseg>
    </trk>

</gpx>
1

There are 1 best solutions below

0
On

Both are correct, so it depends on your intention what you want to use.

wpt represents a waypoint, point of interest, or named feature on a map.

(see wptType)

trk represents a track - an ordered list of points describing a path.

(see trkType)

For a more verbose description between those two type you could also have a look at the wikipedia-article.