Invalid GPX 1.1 export

Pole shared this problem 5 years ago
Solved

So since Garmin start validate files i can't upload to GarminConnect or use it in Garmin VIRB


  1. <trkpt lat="30.964341" lon="10.293287">
  2. <ele>82.99</ele>
  3. <time>2014-08-15T19:04:52Z</time>
  4. <pdop>30.00</pdop>
  5. <extensions>
  6. <gpxtpx:TrackPointExtension>
  7. <gpxtpx:cad>46</gpxtpx:cad>
  8. <gpxtpx:course>37.5</gpxtpx:course>
  9. <gpxtpx:hr>105</gpxtpx:hr>
  10. <gpxtpx:speed>4.132248</gpxtpx:speed>
  11. </gpxtpx:TrackPointExtension>
  12. </extensions>
  13. </trkpt>


http://www8.garmin.com/xmlschemas/TrackPointExtensionv1.xsd

As you can see the TrackPointExtension type has another sequence and elements like course, speed are absent, they only allowed in Extensions.


  1. <trkpt lat="30.964341" lon="10.293287">
  2. <ele>82.99</ele>
  3. <time>2014-08-15T19:04:52Z</time>
  4. <pdop>30.00</pdop>
  5. <extensions>
  6. <gpxtpx:TrackPointExtension>
  7. <gpxtpx:hr>105</gpxtpx:hr>
  8. <gpxtpx:cad>46</gpxtpx:cad>
  9. <gpxtpx:Extensions>
  10. <course>37.5</course>
  11. <speed>4.132248</speed>
  12. </gpxtpx:Extensions>
  13. </gpxtpx:TrackPointExtension>
  14. </extensions>
  15. </trkpt>



Comments (4)

photo
1

Please don't ignore this, it's simple to fix.

1) Locus using 1st version of TrackPointExtension xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1";

but the elements speed, cource was added only in 2nd version

"http://www.garmin.com/xmlschemas/TrackPointExtension/v2";

2) TrackPointExtension is a sequence, so the order of elements is significant

  1. <xsd:sequence>

    <xsd:element name="atemp" type="DegreesCelsius_t" minOccurs="0"/><xsd:element name="wtemp" type="DegreesCelsius_t" minOccurs="0"/><xsd:element name="depth" type="Meters_t" minOccurs="0"/><xsd:element name="hr" type="BeatsPerMinute_t" minOccurs="0"/><xsd:element name="cad" type="RevolutionsPerMinute_t" minOccurs="0"/><xsd:element name="speed" type="MetersPerSecond_t" minOccurs="0"/><xsd:element name="course" type="DegreesTrue_t" minOccurs="0"/><xsd:element name="bearing" type="DegreesTrue_t" minOccurs="0"/><xsd:element name="Extensions" type="Extensions_t" minOccurs="0"/>

    </xsd:sequence>

photo
2

And is battery temp. is available to save as atemp ?

photo
1

Hello Pole,


so best solution for me, seems to be change of TrackPointExtension to version 2 in header and adding atemp (only from external sensors), hr, cad, speed and course in this order to <gpxtpx:TrackPointExtension> tags, right? Oki, done.

photo
1

thnx