TCX import help

This may or may not be a bug report. I have a few thousand workouts exported from Mapmyrun/mapmyfitness in TCX format. When I try to import them into Intervals there are various issues:

  1. Most troubling is that the pace is a flat line at my average pace. (see image)

  2. Heart rate data doesn’t play well with dropouts (the image is with reprocessed and interpolated Heartrates -fixed from the original export)

The TCX is structured as interleaved trackpoints: Some have position, some have heartrate, some have Distancemeters. I wrote some code to interpolate heartrate data so that all track points have GPS position and Heartrate. When I save as a GPX file things intervals imports nicely (but you lose some metadata, e.g. Calories). When I save as a TCX file it fixes all HR issues but the position oddness remains.

Can the TCX file be structured as below, with GPS position?

<Trackpoint>
<Time>2023-08-25T11:11:12.910000+00:00</Time>
<Position>
<LatitudeDegrees>38.950507078932574</LatitudeDegrees>
<LongitudeDegrees>-77.02327503981778</LongitudeDegrees>
</Position>
<AltitudeMeters>44.4461</AltitudeMeters>
<HeartRateBpm>
<Value>89</Value>
</HeartRateBpm>
</Trackpoint>

Or does it need to be of the form:

 <Trackpoint>
        <Time>2023-01-22T20:49:16Z</Time>
        <DistanceMeters>57.07</DistanceMeters>
        <HeartRateBpm>
         <Value>106</Value>
        </HeartRateBpm>
</Trackpoint>

Thanks! FWIW Strava handles the original correctly. It may or may not be worth adding code to Intervals to handle various TCX permutations. But if someone could point me toward the preferred format or offer an example of one that Intervals likes I’d appreciate it!

Can you please mail me (david@intervals.icu) one of the unmodified TCX files and I will see what I can do. Generally if Strava is happy with a file then people expect Intervals.icu to be happy with it :slight_smile: This is what Intervals.icu currently expects:

     <Trackpoint>
      <Time>2021-06-20T07:07:52Z</Time>
      <Position>
       <LatitudeDegrees>-33.9362080</LatitudeDegrees>
       <LongitudeDegrees>18.4268260</LongitudeDegrees>
      </Position>
      <AltitudeMeters>85.4</AltitudeMeters>
      <DistanceMeters>3.0</DistanceMeters>
      <HeartRateBpm>
       <Value>94</Value>
      </HeartRateBpm>
      <Cadence>20</Cadence>
      <Extensions>
       <TPX xmlns="http://www.garmin.com/xmlschemas/ActivityExtension/v2">
        <Speed>0.6</Speed>
        <Watts>68</Watts>
       </TPX>
      </Extensions>
     </Trackpoint>

Thanks David. Sent the file. The format you expect is sensible IMHO. I debugged this a bit. If I compute a DistanceMeters (cumulative) for each trackpoint things look as expected after import.

However, doing that from GPS coordinates has proved less accurate than I would have hoped (at least, it disagrees with the activity-level summary DistanceMeters in the original file).

With your comment and knowing this I can solve my problem. I will interpolate both Heartrate and DistanceMeters so that each lat / long position trackpoint has all the available data, as in your example.

Happy to post my code, but I expect you will see how to do that faster than you could integrate my code!

You may find this a helpful dialogue on various options on distances and TCX files: FAQ : Distance Doesn't Match sum of individual files. - GOTOES Strava Tools Forum

Also potentially useful: Strava uses embedded distance on my TCX, not point-to-point calculations. This also gives agreement with the original software.

Tx for sending that file. It has very sparse points, many with only a date and time. I updated the TCX import to merge points with the same time in seconds, keeping any duplicate data from the most recent point. Velocity is calculated from the distance data.

You can use the activity list view to reprocess existing uploads in bulk:

Thanks. Tried one file and it looks as expected. Will try others later. Cheers!

1 Like