Skip to main content
Question

Upload via api skips elevation computation


Forum|alt.badge.img+2

Good morning,
I have a question about activity upload via api.

I have a TCX file built manually, thus not coming from a device like Garmin. This file contains elevation data (<AltitudeMeters>...</AltitudeMeters>).

If I try to upload this activity via api (https://www.strava.com/api/v3/uploads), the activity appears among my activities (https://www.strava.com/athlete/training), but shows an elevation of 0.

Using the web interface (+ >> Upload activity >> Choose file):
1) before clicking Save & View, the activity appears among my activities, without elevation
2) after clicking Save & View, the elevation appears and is correct.

It seems like the api call stops at step 1, and the elevation is missing. Is it possible to obtain the same result (steps 1 and 2) using apis? 

ibooij
Forum|alt.badge.img+8
  • Hub Rookie
  • April 21, 2023

You can force/suggest Strava to use your elevation data by setting the right device type in the TCX file. See the section Device and Elevation Data on https://developers.strava.com/docs/uploads/


ibooij
Forum|alt.badge.img+8
  • Hub Rookie
  • April 21, 2023

You might need to add a namespaced attribute to the Creator

<Creator xsi:type="Device_t"> <Name>something with Barometer</Name> </Creator>

Otherwise somebody from Strava might want to give their 2 cents.


Forum|alt.badge.img
  • Hub Starter
  • April 21, 2023

I've the same problem, tried:

<Creator> <Name>My Awesome Device with barometer</Name> </Creator>

And:

<Creator xsi:type="Device_t"> <Name>something with Barometer</Name> </Creator>

And: (which is the correct way according to https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd)

<Creator xsi:type="Device_t"> <Name>something with barometer</Name> <UnitId>1234567890</UnitId> <ProductID>123</ProductID> <Version> <VersionMajor>0</VersionMajor> <VersionMinor>1</VersionMinor> <BuildMajor>1</BuildMajor> <BuildMinor>0</BuildMinor> </Version> </Creator>

The activity gets uploaded but with no elevation. Same TCX uploaded from the web interface shows the correct elevation.


ibooij
Forum|alt.badge.img+8
  • Hub Rookie
  • April 21, 2023

Sorry, then I'm out of options. Hopefully somebody from Strava can give an answer then.


ActivityFix
Superuser
Forum|alt.badge.img+24

There was a similar thread to this in the Strava API google group. Maybe something in there would be useful?

https://groups.google.com/g/strava-api/c/3QreDD1EWjQ/m/rCxRQ1ghAwAJ


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept, you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings