opoto/wtracks

feature request: Preserve extensions node (with gpxtpx:TrackPointExtension, eg.: hearth rate)

Closed this issue · 2 comments

It would be nice to manipulate GPX files with extensions node and preserve that information in the output.

When loading a gpx file with hearth rate information:

...
      <trkpt lat="47.6757193" lon="19.0558327">
        <ele>163</ele>
        <time>2019-05-19T13:12:02.224Z</time>
        <extensions>
          <gpxtpx:TrackPointExtension>
            <gpxtpx:hr>143</gpxtpx:hr>
            <gpxtpx:atemp>24.8</gpxtpx:atemp>
          </gpxtpx:TrackPointExtension>
        </extensions>
      </trkpt>
...

the extensions node is not included in the saved gpx file:

<trkpt lat="47.6757176" lon="19.0552413"><ele>165</ele><time>2019-05-19T08:24:46.016Z</time></trkpt>

Steps to reproduce:

opoto commented

Hi
Your suggestions makes sense, and I wish I could add it. However WTracks uses a 3rd party lib (togeojson.js) to load GPX files, which internally converts GPX to Geojson format, which does not know about GPX extensions. I am not ready to modify togeojson to add this proprietary extension. Maybe I (or you!) can ask the authors to do it.
However, thanks to your request, I noticed togeojson implemented the support of heart rates (which is not standard Geojson neither). So I added it to WTracks: it now reads and saves heart rates values when present in the original file :) However these values are not displayed nor editable in WTracks.
Thanks

opoto commented

Commit af9bf98 adds support for heart rate