GPSBabel / gpsbabel

GPSBabel: convert, manipulate, and transfer data from GPS programs or GPS receivers. Open Source and supported on MacOS, Windows, Linux, and more. Pointy clicky GUI or a command line version...
https://www.gpsbabel.org
GNU General Public License v2.0
477 stars 127 forks source link

garminextensions option (-o gpx,...) removes <speed> from output file #1188

Closed jan-gerard closed 1 year ago

jan-gerard commented 1 year ago

I noticed that when converting to a gpx file from a .fit file (for example) that contains speed data, it is correctly parsed to the output file. But when I specify the garminextensions option in the -o gpx option, the speed data is omitted. Meanwhile, other data, like heartrate, is included, but still speed is missing. I cannot found any combination of parameters that seems to work, so I assume this is a small bug.

.\gpsbabel.exe -t -i garmin_fit -f run.fit -o gpx,garminextensions -F run2.gpx

In the first case, I get as output for example

<trkpt lat="53.350419521" lon="5.616662057">
      <ele>29.8</ele>
      <time>2023-01-01T19:32:58Z</time>
      <speed>1.53</speed>
</trkpt>

and in the second case, I get more data, but no speed field.

      <trkpt lat="53.350419545" lon="5.616662060">
        <ele>29.800</ele>
        <time>2023-01-01T19:32:58Z</time>
        <extensions>
          <gpxtpx:TrackPointExtension>
            <gpxtpx:atemp>28.000000</gpxtpx:atemp>
            <gpxtpx:hr>104</gpxtpx:hr>
            <gpxtpx:cad>56</gpxtpx:cad>
          </gpxtpx:TrackPointExtension>
        </extensions>
      </trkpt>

Or is there a way to fix this easily?

robertlipe commented 1 year ago

GPX 1.1 does not have a speed tag and the extensions you're using force 1.1

Yes, this is widely acknowledged as an oversight in the GPX spec, but those are the rules we have to play by.

The good news is that for the huge majority of devices, "speed" as a distinct tag is almost never actually necessary'useful as it's computed via successive timestamped location points.

On Wed, Oct 4, 2023 at 3:33 PM Jan-Gerard van der Toorn < @.***> wrote:

I noticed that when converting to a gpx file from a .fit file (for example) that contains speed data, it is correctly parsed to the output file. But when I specify the garminextensions option in the -o gpx option, the speed data is omitted. Meanwhile, other data, like heartrate, is included, but still speed is missing. I cannot found any combination of parameters that seems to work, so I assume this is a small bug.

.\gpsbabel.exe -t -i garmin_fit -f run.fit -o gpx,garminextensions -F run2.gpx

In the first case, I get as output for example

29.8 1.53

and in the second case, I get more data, but no speed field.

  <trkpt lat="53.350419545" lon="5.616662060">
    <ele>29.800</ele>
    <time>2023-01-01T19:32:58Z</time>
    <extensions>
      <gpxtpx:TrackPointExtension>
        <gpxtpx:atemp>28.000000</gpxtpx:atemp>
        <gpxtpx:hr>104</gpxtpx:hr>
        <gpxtpx:cad>56</gpxtpx:cad>
      </gpxtpx:TrackPointExtension>
    </extensions>
  </trkpt>

Or is there a way to fix this easily?

— Reply to this email directly, view it on GitHub https://github.com/GPSBabel/gpsbabel/issues/1188, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCSD36IYFETXEWFNX4TDTTX5XB2TAVCNFSM6AAAAAA5TGLMHKVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZDMOJTG43TIMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

tsteven4 commented 1 year ago

Note that we will write the speed element for gpx 1.0. You can force gpx 1.0: .\gpsbabel.exe -t -i garmin_fit -f run.fit -o gpx,garminextensions,gpxver=1.0 -F run2.gpx