Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do the Strava (GPX) <type></type> elements mean?

Tags:

garmin

gpx

strava

Kia ora,

I exported all my GPX files from Strava so I could do some analysis on them and am stuck trying to figure out what type of activity each file is for.

My file looks like this, for example, where the <type> element seems to define the activity type.

<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="StravaGPX iPhone" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1">
 <metadata>
  <time>2014-03-21T22:44:39Z</time>
 </metadata>
 <trk>
  <name>Sugar Loaf</name>
  <type>9</type>
  <trkseg>
    ...

I know (in my head) that the activity was a run, but I cannot find any documentation of all the numbers and their corresponding activity types.

Strava says:

Strava strives to comply with the FIT Activity File (FIT_FILE_TYPE = 4) spec as defined in the official FIT SDK.

That is great, but if I interrogate the FIT SDK I can find the following in the fit_profile.hpp file:

typedef FIT_ENUM FIT_SPORT;
#define FIT_SPORT_INVALID                             FIT_ENUM_INVALID
#define FIT_SPORT_GENERIC                             ((FIT_SPORT)0)
#define FIT_SPORT_RUNNING                             ((FIT_SPORT)1)
#define FIT_SPORT_CYCLING                             ((FIT_SPORT)2)
#define FIT_SPORT_TRANSITION                          ((FIT_SPORT)3) // Mulitsport transition
#define FIT_SPORT_FITNESS_EQUIPMENT                   ((FIT_SPORT)4)
#define FIT_SPORT_SWIMMING                            ((FIT_SPORT)5)
#define FIT_SPORT_BASKETBALL                          ((FIT_SPORT)6)
#define FIT_SPORT_SOCCER                              ((FIT_SPORT)7)
#define FIT_SPORT_TENNIS                              ((FIT_SPORT)8)
#define FIT_SPORT_AMERICAN_FOOTBALL                   ((FIT_SPORT)9)
#define FIT_SPORT_TRAINING                            ((FIT_SPORT)10)
#define FIT_SPORT_WALKING                             ((FIT_SPORT)11)
...

I can also find in that same fit_profile.hpp file:

#define FIT_FILE_ACTIVITY                             ((FIT_FILE)4) // Read/erase, multiple files. Directory=Activities

Which would confirm to me that it is indeed an activity file.

Does anyone know where I can find a reference for these integers?

like image 551
Finn LeSueur Avatar asked May 20 '20 01:05

Finn LeSueur


People also ask

What is the best file type to upload to Strava?

GPX - GPS Exchange Format As a result, extensions to GPX were created and Strava supports the two most popular plus a general format.

What is GPX in Strava?

Export an Activity as a GPX file The file will then download to your computer with the file extension ". gpx". This file will contain your GPS coordinates, timestamps and accessory data like Heart Rate, Cadence, and temperature. This feature does not export Power data.

Can I import a GPX file to Strava?

You can create a Strava route from a GPX file by selecting Dashboard from the top navigation menu on the Strava website > My Routes > Create New Route. Click the upload button highlighted below and choose the GPX file you would like to use to create a route.

How do I extract data from Strava?

Step 3: Export Strava Data Click the first request in the list. This is the request/response for the first 20 workouts in your list. On the right side, you can see a preview of the response for the data. Above that data on the right side, click on "Response" to see the raw data.


1 Answers

By experimentation, I’ve produced this list.

 1: Ride
 2: Alpine Ski
 3: Backcountry Ski
 4: Hike
 5: Ice Skate
 6: Inline Skate
 7: Nordic Ski
 8: Roller Ski
 9: Run
10: Walk
11: Workout
12: Snowboard
13: Snowshoe
14: Kitesurf
15: Windsurf
16: Swim
17: Virtual Ride
18: E-Bike Ride
19: Velomobile
21: Canoe
22: Kayaking
23: Rowing
24: Stand Up Paddling
25: Surfing
26: Crossfit
27: Elliptical
28: Rock Climb
29: Stair-Stepper
30: Weight Training
31: Yoga
51: Handcycle
52: Wheelchair
53: Virtual Run

I suspect 20 is for sailing, but Strava won’t let me set any of my activities to sailing to check.

like image 148
LeopardShark Avatar answered Oct 24 '22 05:10

LeopardShark