cpfair / tapiriik

tapiriik keeps your fitness in sync
https://tapiriik.com
Apache License 2.0
1.72k stars 295 forks source link

Missing type in GPX saved to Dropbox? #574

Open mackuba opened 1 year ago

mackuba commented 1 year ago

I'm wondering why the GPX exported from Runkeeper/Strava into Dropbox does not include activity type information inside the file. Is this on purpose or just because it wasn't needed?

This is how a GPX saved in Strava and downloaded from Strava starts - includes type "9" meaning run:

<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 http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3">
 <metadata>
  <time>2016-11-21T07:25:02Z</time>
 </metadata>
 <trk>
  <name>Morning Run</name>
  <type>9</type>
  <trkseg>

And this is how it looks in Dropbox saved by Tapiriik - name is there but the type isn't:

<gpx xmlns:gpxdata="http://www.cluetrust.com/XML/GPXDATA/1/0" xmlns:gpxext="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns="http://www.topografix.com/GPX/1/1" creator="tapiriik-sync">
  <metadata>
    <name>Morning Run</name>
  </metadata>
  <trk>
    <name>Morning Run</name>
    <trkseg>

This also means that if an activity is saved to Dropbox with a filename template that doesn't include the type in the pattern, then it can't be imported back into another service from there, because the type information was lost…

I'm mostly asking because I'm thinking about building some kind of app that lets me browse all past workouts by parsing GPX files, and getting the type info from a tag inside the GPX file seems like a much safer method than trying to guess it from the filename.