With Barometer not working for gpx files

83 views
Skip to first unread message

Phil

unread,
Nov 17, 2022, 10:31:18 PM11/17/22
to Strava API
Hi All,

I've followed Strava's documentation on how to "force" Strava to use the elevation data in a TCX file and it doesn't work! 

It does work for GPX files, but not TCX files. Does anyone else have this problem?

My app contains the following XML

    <Creator>
        <Name>MyApp - with barometer</Name>
    </Creator>

I've also tried 

    <Creator>
        <Name>MyApp - with Barometer</Name>
    </Creator>

and 

    <Creator>
        <Name>"MyApp - with Barometer"</Name>
    </Creator>

This is frustrating because I need to upload in TCX format to support laps and other data, which isn't supported in the GPX format.

Phil

unread,
Nov 17, 2022, 11:46:29 PM11/17/22
to Strava API
correction: the title should read "With Barometer not working for tcx files"

App 4G

unread,
Nov 23, 2022, 3:48:43 AM11/23/22
to Strava API
For TCX, the "with barometer" is working for my app..

Creator(name: "BreakAway with barometer", 


App 4G

unread,
Nov 23, 2022, 3:50:34 AM11/23/22
to Strava API
These are the tags that I'm using for TCX (but I've since moved away from TCX to FIT)
            <Creator xsi:type="Device_t">
                <Name>BreakAway with barometer</Name>
                <Version>
                    <VersionMajor>1</VersionMajor>
                    <VersionMinor>0</VersionMinor>
                    <BuildMajor>0</BuildMajor>
                    <BuildMinor>0</BuildMinor>
                </Version>
            </Creator>

Phil

unread,
Nov 26, 2022, 4:56:09 PM11/26/22
to Strava API
Unfortunately, this doesn't work for me.

This is what I've coded:

       <Version>

           <VersionMajor>1</VersionMajor>

           <VersionMinor>0</VersionMinor>

           <BuildMajor>0</BuildMajor>

           <BuildMinor>0</BuildMinor>

       </Version>

   </Creator>

   <Activities>


Etc…

Luis Lopez

unread,
Nov 26, 2022, 6:34:15 PM11/26/22
to Strava API
you should be using AltitudeMeters in a tcx as the variable for elevation as like      <AltitudeMeters>3.68</AltitudeMeters>


 <Folders/>
 <Courses>
  <Course>
   <Name>Port Macquarie </Name>
   <Lap>
    <TotalTimeSeconds>25176.69587162291</TotalTimeSeconds>
    <DistanceMeters>180294.12859373883</DistanceMeters>
    <Intensity>Active</Intensity>
   </Lap>
   <Track>
    <Trackpoint>
     <Time>2022-11-23T23:32:39+00:00</Time>
     <Position>
      <LatitudeDegrees>-31.4294400</LatitudeDegrees>
      <LongitudeDegrees>152.8996700</LongitudeDegrees>
     </Position>
     <AltitudeMeters>3.68</AltitudeMeters>
     <DistanceMeters>0.0</DistanceMeters>
    </Trackpoint>
    <Trackpoint>
     <Time>2022-11-23T23:32:47+00:00</Time>
     <Position>
      <LatitudeDegrees>-31.4296300</LatitudeDegrees>
      <LongitudeDegrees>152.8998200</LongitudeDegrees>
     </Position>
     <AltitudeMeters>3.7800000000000002</AltitudeMeters>
     <DistanceMeters>25.49667985258408</DistanceMeters>
    </Trackpoint>
Message has been deleted

Phil

unread,
Nov 27, 2022, 1:14:55 PM11/27/22
to Strava API
I do use the AltitudeMeters tag. Here's more of the code:

<?xml version="1.0" encoding="UTF-8"?>
<TrainingCenterDatabase xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd" xmlns:ns5="http://www.garmin.com/xmlschemas/ActivityGoals/v1" xmlns:ns3="http://www.garmin.com/xmlschemas/ActivityExtension/v2" xmlns:ns2="http://www.garmin.com/xmlschemas/UserProfile/v2" xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="http://www.garmin.com/xmlschemas/ProfileExtension/v1">
    <Creator xsi:type="Device_t">
        <Name>MyApp with barometer</Name>
        <Version>
            <VersionMajor>1</VersionMajor>
            <VersionMinor>0</VersionMinor>
            <BuildMajor>0</BuildMajor>
            <BuildMinor>0</BuildMinor>
        </Version>
    </Creator>
    <Activities>
        <Activity Sport="Biking">
            <Id>2022-11-21T21:37:29.732Z</Id>
            <Lap>
                <Track>
                    <Trackpoint>
                        <Time>2022-11-21T21:37:29.732Z</Time>
                        <Position>
                            <LatitudeDegrees>-36.500000</LatitudeDegrees>
                            <LongitudeDegrees>174.700000</LongitudeDegrees>
                        </Position>
                        <AltitudeMeters>42.20</AltitudeMeters>
                        <DistanceMeters>0.00</DistanceMeters>
                        <Extensions>
                            <ns3:TPX>
                                <ns3:Speed>2.44</ns3:Speed>
                            </ns3:TPX>
                        </Extensions>
                    </Trackpoint>

MyJunk Junk

unread,
Nov 28, 2022, 6:25:20 AM11/28/22
to Strava API
https://www.dropbox.com/s/6b9qa02n137jyvz/20221128-192258_ZZZ-Demo%28TCX%29.tcx?dl=0

Try Uploading this file and/or use this as a reference and see what's the difference w/ what you are doing.

This was created using this Free Indoor Cycling App

Luis Lopez

unread,
Nov 28, 2022, 5:09:27 PM11/28/22
to Strava API
Phil & I have gone through this, 
just to clarify elevation data is in phil file as like in mine and the tcx structure & construction is not the problem !!
Phil has been trying to make point the that uploading a tcx file the elevation data changes for each gps point changes. this is correct based on the initial gps points.

My test to prove Phil claim:
  • this activity was created on a GarminEdge530(mine) and auto upload via garmin.connect and it then passed onto strava. 
  • activity ascending was 602m
  • 6030 points recorded
1. Export an activity from strava using the /export_tcx  (file1)
  • activity was exported
  • tcx edited with only the date being changed in the dataset (start Date/Time is a primary key to define the duplicate activities)  (file2)
2. Import replicated Tcx using Strava Manual file import.
  • activity ascending was 626m
  • elevation values changed changed +/- 1 - 2 metres and in some cases 
  • 6030 points recorded
3. Repeat Step 1 this time using (file2) and then step 2
  • tcx edited again for another different date (file3)
  • activity ascending was 626m
  • 6030 points recorded
  • no difference in elevation in each point.
Summary:
what I believe is happening in the importing of tcx file strava is using an elevation database and method to retrieve elevation data for a specific gps coordinate, there maybe also another set of factors and rules, this is similar to the tools for a activity elevation correction(disappeared) and distance correction.
Ethically this is an issue as like privacy & data, the user(athlete) is the owner of their data and they should have the final say on who can see, alter. my complication is that I have seen poor GPS data being recorded by mobiles, gps watches, from GPS Drifting where I would go off a cliff for a while and hence a different elevation if it was using strava's method, I have tested this on a decent taking a corner at over 50kmh. Just beware some of the newer garmins & apple watches are using gps chipsets that produce lower quality data for longer battery life.

    Sample of my 3 files row for row (29)
    TCX to CSV File(2)                                Orignal TCX to CSV File(1)                        TCX to CSV File(3)                        
    Time    Longitude [deg]    Latitude [deg]    Altitude [m]    Distance [m]        Diff (to file2)        Time    Longitude [deg]    Latitude [deg]    Altitude [m]    Distance [m]        Time    Longitude [deg]    Latitude [deg]    Altitude [m]    Distance [m]        Diff (to file2)
    27/Nov/2022 5:09:34    146.960297    -36.728253    315.1    17        0.1        17/Nov/2022 5:09:34    146.960297    -36.728253    315    17        25/Nov/2022 5:09:34    146.960297    -36.728253    315.1    17        0
    27/Nov/2022 5:09:35    146.960326    -36.728275    315.2    20.8        0.2        17/Nov/2022 5:09:35    146.960326    -36.728275    315    20.8        25/Nov/2022 5:09:35    146.960326    -36.728275    315.2    20.8        0
    27/Nov/2022 5:09:36    146.960361    -36.728297    315.2    24.7        0.4        17/Nov/2022 5:09:36    146.960361    -36.728297    314.8    24.7        25/Nov/2022 5:09:36    146.960361    -36.728297    315.2    24.7        0
    27/Nov/2022 5:09:37    146.960394    -36.728318    315.2    28.9        0.2        17/Nov/2022 5:09:37    146.960394    -36.728318    315    28.9        25/Nov/2022 5:09:37    146.960394    -36.728318    315.2    28.9        0
    27/Nov/2022 5:09:38    146.96043    -36.728338    315.3    33        0.3        17/Nov/2022 5:09:38    146.96043    -36.728338    315    33        25/Nov/2022 5:09:38    146.96043    -36.728338    315.3    33        0
    27/Nov/2022 5:09:39    146.960469    -36.728357    315.3    37.1        0.3        17/Nov/2022 5:09:39    146.960469    -36.728357    315    37.1        25/Nov/2022 5:09:39    146.960469    -36.728357    315.3    37.1        0
    27/Nov/2022 5:09:40    146.960509    -36.728376    315.4    41.1        0.4        17/Nov/2022 5:09:40    146.960509    -36.728376    315    41.1        25/Nov/2022 5:09:40    146.960509    -36.728376    315.4    41.1        0
    27/Nov/2022 5:09:41    146.96055    -36.728396    315.4    45.3        0.2        17/Nov/2022 5:09:41    146.96055    -36.728396    315.2    45.3        25/Nov/2022 5:09:41    146.96055    -36.728396    315.4    45.3        0
    27/Nov/2022 5:09:42    146.960593    -36.728413    315.4    49.8        0.2        17/Nov/2022 5:09:42    146.960593    -36.728413    315.2    49.8        25/Nov/2022 5:09:42    146.960593    -36.728413    315.4    49.8        0
    27/Nov/2022 5:09:43    146.960642    -36.72843    315.5    54.4        0.1        17/Nov/2022 5:09:43    146.960642    -36.72843    315.4    54.4        25/Nov/2022 5:09:43    146.960642    -36.72843    315.5    54.4        0
    27/Nov/2022 5:09:44    146.960696    -36.728439    315.5    59.2        0.1        17/Nov/2022 5:09:44    146.960696    -36.728439    315.4    59.2        25/Nov/2022 5:09:44    146.960696    -36.728439    315.5    59.2        0
    27/Nov/2022 5:09:45    146.960752    -36.728439    315.5    64.4        0.1        17/Nov/2022 5:09:45    146.960752    -36.728439    315.4    64.4        25/Nov/2022 5:09:45    146.960752    -36.728439    315.5    64.4        0
    27/Nov/2022 5:09:46    146.960811    -36.728432    315.5    69.7        -0.1        17/Nov/2022 5:09:46    146.960811    -36.728432    315.6    69.7        25/Nov/2022 5:09:46    146.960811    -36.728432    315.5    69.7        0
    27/Nov/2022 5:09:47    146.960872    -36.728434    315.5    75.2        -0.1        17/Nov/2022 5:09:47    146.960872    -36.728434    315.6    75.2        25/Nov/2022 5:09:47    146.960872    -36.728434    315.5    75.2        0
    27/Nov/2022 5:09:48    146.960931    -36.728442    315.5    80.5        -0.1        17/Nov/2022 5:09:48    146.960931    -36.728442    315.6    80.5        25/Nov/2022 5:09:48    146.960931    -36.728442    315.5    80.5        0
    27/Nov/2022 5:09:49    146.96098    -36.728463    315.5    85.7        -0.3        17/Nov/2022 5:09:49    146.96098    -36.728463    315.8    85.7        25/Nov/2022 5:09:49    146.96098    -36.728463    315.5    85.7        0
    27/Nov/2022 5:09:50    146.961007    -36.728504    315.6    90.9        -0.2        17/Nov/2022 5:09:50    146.961007    -36.728504    315.8    90.9        25/Nov/2022 5:09:50    146.961007    -36.728504    315.6    90.9        0
    27/Nov/2022 5:09:51    146.961016    -36.728549    315.7    96.1        -0.1        17/Nov/2022 5:09:51    146.961016    -36.728549    315.8    96.1        25/Nov/2022 5:09:51    146.961016    -36.728549    315.7    96.1        0
    27/Nov/2022 5:09:52    146.961    -36.728591    315.9    101.2        0.1        17/Nov/2022 5:09:52    146.961    -36.728591    315.8    101.2        25/Nov/2022 5:09:52    146.961    -36.728591    315.9    101.2        0
    27/Nov/2022 5:09:53    146.960959    -36.728616    316.1    106.4        0.3        17/Nov/2022 5:09:53    146.960959    -36.728616    315.8    106.4        25/Nov/2022 5:09:53    146.960959    -36.728616    316.1    106.4        0
    27/Nov/2022 5:09:54    146.9609    -36.728625    316.3    111.8        0.5        17/Nov/2022 5:09:54    146.9609    -36.728625    315.8    111.8        25/Nov/2022 5:09:54    146.9609    -36.728625    316.3    111.8        0
    27/Nov/2022 5:09:55    146.960838    -36.728625    316.3    117.2        0.5        17/Nov/2022 5:09:55    146.960838    -36.728625    315.8    117.2        25/Nov/2022 5:09:55    146.960838    -36.728625    316.3    117.2        0
    27/Nov/2022 5:09:56    146.960781    -36.728624    316.3    122.8        0.5        17/Nov/2022 5:09:56    146.960781    -36.728624    315.8    122.8        25/Nov/2022 5:09:56    146.960781    -36.728624    316.3    122.8        0
    27/Nov/2022 5:09:57    146.960725    -36.728613    316.2    128.6        0.4        17/Nov/2022 5:09:57    146.960725    -36.728613    315.8    128.6        25/Nov/2022 5:09:57    146.960725    -36.728613    316.2    128.6        0
    27/Nov/2022 5:09:58    146.960664    -36.728591    316.1    134.4        0.3        17/Nov/2022 5:09:58    146.960664    -36.728591    315.8    134.4        25/Nov/2022 5:09:58    146.960664    -36.728591    316.1    134.4        0
    27/Nov/2022 5:09:59    146.960611    -36.728557    316    140.3        0.2        17/Nov/2022 5:09:59    146.960611    -36.728557    315.8    140.3        25/Nov/2022 5:09:59    146.960611    -36.728557    316    140.3        0
    27/Nov/2022 5:10:00    146.960563    -36.728516    315.9    146.2        0.1        17/Nov/2022 5:10:00    146.960563    -36.728516    315.8    146.2        25/Nov/2022 5:10:00    146.960563    -36.728516    315.9    146.2        0
    27/Nov/2022 5:10:01    146.960514    -36.728479    315.8    152.1        0        17/Nov/2022 5:10:01    146.960514    -36.728479    315.8    152.1        25/Nov/2022 5:10:01    146.960514    -36.728479    315.8    152.1        0
    27/Nov/2022 5:10:02    146.960461    -36.728445    315.7    158        -0.1        17/Nov/2022 5:10:02    146.960461    -36.728445    315.8    158        25/Nov/2022 5:10:02    146.960461    -36.728445    315.7    158        0


    Message has been deleted

    Phil

    unread,
    Nov 28, 2022, 5:43:45 PM11/28/22
    to Strava API
    @ mjunk. 

    I downloaded your file and it doesn't include the Creator tag. Instead, it uses an Author tag and there is no "with barometer" string in the title. I uploaded a modified version of the tcx that replaces Creator with Author and still no luck. Strava still replaces the elevation data with its own reference data.

    Richard M

    unread,
    Nov 28, 2022, 5:46:30 PM11/28/22
    to Phil, Strava API
    Strava has this support article on what it does with elevation data: https://support.strava.com/hc/en-us/articles/115001294564-Elevation-on-Strava-FAQs

    This probably doesn't help you much but should give some background.

    Thanks,
    Richard 

    --
    You received this message because you are subscribed to the Google Groups "Strava API" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to strava-api+...@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/strava-api/98e1c23a-8a6e-4e3e-a31a-afc793d2e9c1n%40googlegroups.com.

    Phil

    unread,
    Nov 28, 2022, 6:03:06 PM11/28/22
    to Strava API
    Hi All,

    Can anyone on this forum please provide me with a tcx file originating from a device (let's say a Garmin), that they have subsequently uploaded to Strava, and have determined that Strava has NOT replaced the original elevation data? I suspect there is no way of preventing this from happening for tcx files using their documented "with barometer" option.

    MyJunk Junk

    unread,
    Nov 28, 2022, 7:18:49 PM11/28/22
    to Strava API
    The file Uses _both_ a Author and a creator tag

                <Creator xsi:type="Device_t">
                    <Name>BreakAway with barometer</Name>
                    <Version>
                        <VersionMajor>1</VersionMajor>
                        <VersionMinor>0</VersionMinor>
                        <BuildMajor>0</BuildMajor>
                        <BuildMinor>0</BuildMinor>
                    </Version>
                </Creator>
            </Activity>
        </Activities>
        <Author xsi:type="Application_t">
            <Name>BreakAway</Name>
            <Build>
                <Version>
                    <VersionMajor>0</VersionMajor>

                    <VersionMinor>0</VersionMinor>
                    <BuildMajor>0</BuildMajor>
                    <BuildMinor>0</BuildMinor>
                </Version>
                <Type>Alpha</Type>
            </Build>
            <PartNumber>2020-10-14</PartNumber>
        </Author>


    or this specially crafted TCX, you will notice that I've placed all the elevation <AltitudeMeters> as 10 (as it's an indoor ride, I don't want it to have any elevation gain)

    When uploaded to Strava, it will still show 10m altitude and it's entirely flat.
    Screenshot 2022-11-29 at 8.17.53 AM.png

    MyJunk Junk

    unread,
    Nov 28, 2022, 7:28:52 PM11/28/22
    to Strava API
    >> Summary:
    >> what I believe is happening in the importing of tcx file strava is using an elevation database and method to retrieve elevation data for a specific gps >>coordinate, there maybe also another set of factors and rules, this is similar to the tools for a activity elevation correction(disappeared) and distance correction.

    From my understanding anyways, Strava will do 2 things
    1) use it's internal database for elevation when:
    - The uploaded file, the device does not have a barometer built in

    2) It will not use the internal database for elevation when
    - the uploaded file HAVE a barometer built in

    When uploading a TCX file, Strava says to use the "with barometer" (which is what I did) and I am able to get things like a flat altitude for indoor rides (I think I did try using 0m, but something may have happened and I settled w/ 10m)

    When Uploading a FIT file, I found not reference of anyway to do the "with barometer" so I spotted the Device in which the file was created in. Instead of my own app, I just used a Garmin Fenix Watch as the device. 

    Sträva honors this and will then use the Altitude as specified

    @Phil - just thought about changing the Same TCX to use "elevation correction", this is the result. Now we can see there are mountains and valleys in the profile.


    Screenshot 2022-11-29 at 8.26.00 AM.png

    >> Phil has been trying to make point the that uploading a tcx file the elevation data changes for each gps point changes
    I'm sorry I didn't go down this rabbit hole to see exactly how each point differs and my experimentation stopped when Strava honoured my 10m _flat_ profile, so I left it as that.

    Phil

    unread,
    Nov 28, 2022, 7:43:40 PM11/28/22
    to Strava API
    Thanks, @mjunk! It now works when I place the Creator tag within the Activity tag, as you show in your example. 

                        </Trackpoint>

                   </Track>

               </Lap>

               <Creator xsi:type="Device_t">

                   <Name>MyApp with barometer</Name>

                   <Version>

                       <VersionMajor>1</VersionMajor>

                       <VersionMinor>0</VersionMinor>

                       <BuildMajor>0</BuildMajor>

                       <BuildMinor>0</BuildMinor>

                   </Version>

               </Creator>

           </Activity>

       </Activities>

    </TrainingCenterDatabase>  

    MyJunk Junk

    unread,
    Nov 29, 2022, 12:47:11 AM11/29/22
    to Strava API
    Happy Days... 
    Reply all
    Reply to author
    Forward
    0 new messages