Search code examples
gpxgarminstrava

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


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?


Solution

  • 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.