I use strava.com (https://strava.com) for my activity tracking. From time to time, I need to combine multiple activities into one for a better data management. Here is how I do it.
-
First, in the page of the individual activity, download the data in GPX format by choosing the "Export GPX" menu. (GPX, or GPS exchange format, is an XML file format for storing coordinate data.) Order the downloaded activity data in time sequence. Suppose we now have three files, "1.gpx", "2.gpx", and "3.gpx" to join, where "1.gpx" is the earlist activity, and "3.gpx" is the latest activity.
-
Open "*.gpx" with a text editor. Look for the XML tag ''. This is the parent of all the '' GPS coordinate samples (points). We need to extract all '' from all the GPX files to combine, and put them, in order, under the '' section. Do this by appending all the '' entries from "2.gpx" and "3.gpx" to that of "1.gpx", under the '' tag. Save the combined file as "combined.gpx".
-
Delete the activities corresponding to "1/2/3.gpx" on Strava (otherwise it will report error "duplicated activity"). Upload the file "combined.gpx" manually to Strava. Edit the title and other meta information.
For the sake of completeness, this is the structure of Strava's GPX XML:
<gpx>
<metadata>
...
</metadata>
<trk>
<name>Activity Name</name>
<trkseg>
<trkpt ...>
...
</trkpt>
...
<trkpt ...>
...
</trkpt>
</trkseg>
</trk>
</gpx>