Showing posts with label Strava. Show all posts
Showing posts with label Strava. Show all posts

Wednesday, July 2, 2014

Merging Activities

It happens to the best of us; for whatever reason you have an issue with your ride data.  Whether you hit the reset button on your favorite bike computer at a bad time, or you end up running out of juice on your smartphone, there are times that you end up with multiple data files for a single event.  This can be immensely important if you are looking to track efforts, or have a data issue while completing an online Challenge.  For these types of scenarios, it is very easy to "stitch" two rides together.  For these examples I am going to reference a notepad utility and online activity site.  I personally use Notepad++ for Windows for editing, and Strava for my data management.

Obtaining the Data

The first thing you need is the GPS data to be merged.  While Strava has a built-in export command, the data that it will export will be in GPX (GPS Exchange) format.  While GPX is an open standard, it has been extended by several manufactures to include customized data.  Thus when exporting a ride using GPX some data, such as  Heart Rate information, can be lost.  The alternative is to export the data using the TCX (Garmin Training Center XML) file format.  In order to export the data using TCX format, you have to use a hidden feature on Strava.  Instead of using the export button, you add "/export_tcx" to the end of the URL string for your ride.  After you hit enter the ride data in TCX format will be saved to your local downloads directory.  As a general rule, you will need to download all activities in the same format.  





If you upload your rides to Garmin Connect, you can also easily export them in TCX format.  In both their Modern and Classic modes, there is an export button with multiple options available.  Once you select TCX the activity download will start.

Classic InterfaceModern Interface
Merging the Segments

Once you have downloaded the activities you wish to merge, you need a text editor. Because both GPX and TCX files are in a standardized text format (XML), it is relatively easy to find the sections that you are looking for. TCX files are a little easier to read than GPX files, but they both have a similar layout. For those that have done much HTML design, XML markings should look familiar. What you are looking for is the starting section for event. In TCX files this is the <Lap ...> tag. For GPX files you are looking for the <trkseg> tag. At the end of the file should be a corresponding closing tag ( </Lap> for TCX, </trkseg> for GPX) that marks the end of the event.  The information between the opening tag and closing tag is your actual activity data, so be careful to not delete or change the format of that section of the file.

To merge the two activities copy everything between the event segments, including the opening tag and closing tag, from the later of the two activities to the earlier of the two activities. You should be pasting the newer data at the bottom, in between the closing tag of the original activity (</Lap> for TCX, </trkseg> for GPX) and the closing of the activity itself ( </Activity> for TCX, < /trk> for GPX). After pasting the second activity into the first save the file as a new name (typically File, Save As), remembering the name and location.

Select everything between and
Save As a new filename, using the same .tcx extension


Uploading the Results

Once the new file is created, it is time to upload the combined data.  In Strava, there is an option to upload files as well as importing directly from your chosen fitness device.  Once you click the upload button, select File from the left menu.  From there you can choose the new combined file.



The new file will now upload.  If you are replacing a previously uploaded activity, you may get an error saying that your activity is a duplicate, specifically of the earlier of the two activities.  It should be best practice to delete the original activities, if previously uploaded, from your feed.   




Errata

Since the end result is two files that are merged together, there may be some errata.  This should be expected, as the data set is most likely not complete.  The most common issue is that you are going to have a straight line that connects the end of the first activity to the beginning of the second.  Currently Strava will also add this distance into your total as the crow flies, and take the timestamp difference between the two activities and use it for your average speeds.  If there is a large difference in location and/or time, it may create a rather large amount of data error.  


Data Errata
This seems to be the most common issue I've encountered in the rare occasion that I've had to stitch two activities together.  If you do not delete any previously uploaded data, you may also have data duplication.  Depending on the terms of use on the website, this can also be considered a breach of the Terms of Use, as you could be using this strategy to upload data that is not accurately depicting the efforts put out.  Be sure to know what the fitness site that you are using says about modification of data prior to using these methods.  Currently Strava does not explicitly state that this method is disallowed, but that could change over time depending on continual abuse.

For the rare time times that I have ended up with data issues that have resulted in multiple activity files, this method has shown to be useful.  For those that track data using device files and fitness sites, having a method to accurately display fitness data is helpful.  

Monday, May 19, 2014

16hours, 250mi, 5 days

With 2 months left to go before the Ride to Remember, I've been refocusing my efforts on making sure that I can complete and enjoy the 3 day trip.  With back to back to back days of riding across South Carolina, it's going to be a completely different level of challenge to what I've trained for in the past.  For rides like the Assault on  Mt Mitchell, the effort is contained in a single day.  The concept I used was the train to be prepared for that one huge day of effort, and then take 2 or 3 days off afterwards to recover.  Now I need to be able to put out large efforts multiple days in a row, conserving and refueling appropriately to be able to complete mile 250 over 48 hours after I start mile 1.

Thus when I saw that Strava had a riding challenge sponsored by Scratch Labs that was designed to be done as a multi-day effort, I figured it was a good opportunity to test out my current fitness level prior to the Ride to Remember.  The Scratch Labs Stage Race Challenge was set around the 8 days of the Amgen Tour of California, and required you to log 16 hours of moving time during the event.  Doing some quick napkin math, I realized that if I averaged at least 15 miles per hour during the time period, I would also end up riding a cumulative total of miles as I would experience on the Ride to Remember.  It was going to take efforts every day to finish with enough time (and miles) logged.




Monday - with the first day lost to a mechanical issue, I decided that I needed to ride on what is typically a rest day for me.  With my new Garmin 800 in hand, I decided to try out a different route than I typically take.  It would give me a chance to learn more about the bike computer, and give me some time on the bike.  The ride was very successful, and I logged in my first solid ride of the week.  2 hours down, 14 to go.


Tuesday - looking ahead on weather sites indicated that I was going to have to compensate for at least 1 rain day during the week, which meant figuring out when I could get in more and/or longer rides.  With a 20% chance of rain Tuesday afternoon, I had to make the decision to ride at lunch to make sure I got in time, or decide to risk riding in the afternoon.  What I decided to do was make it a potential "2 a day" scenario:  get in an easy ride during lunch, and if the weather held out go out again to SCTAC for additional time/mileage in an easier group than I'm used to.  The lunch ride went without a hitch, and I let my cycling clothes dry during the afternoon in preparation for the evening ride.


Evening came around, and the weather looked favorable.  After a ride around the SCTAC airport known as the "Perimeter Road Loop", I went out with the 16mph group.  I just wanted to sit in and have a somewhat easy ride, although very early on I could tell that the group wasn't going to end up being a pace that I'd really enjoy.  Thus about a quarter of the way out I decided to go out on my own ahead of the main group, and bridged over to another group ahead of us.  With Tuesday in the books, I was at 6 hours and 92mi completed.


Wednesday - originally on Monday when I decided to ride, I scheduled this to be a recovery ride day, knowing that Tuesday evening was probably going to be difficult.  When the forecast started showing an extremely high chance of rain on Thursday, I knew I had to move up my timetables and use Thursday as an off the bike recovery day, just in case of bad weather.  Thus instead of just a single extremely easy ride, I ended up completing yet another "2 a day" workout.  Ride #1 was another 30mi long loop, using the same route that I had taken Monday.  


The evening ride ended up being the original intended recovery ride.  At this point I had to say that my legs were extremely tired, but I was happy about my ability to set an effort level and keep to it given additional efforts ahead.  At the halfway point of the week I was just under the 10 hour mark.  The goal was in sight!


Thursday - the weatherman didn't disappoint.  With rain pretty much all day, many of the group rides were canceled.  I kept looking at the after work forecasts to determine if there was a glimmer of hope of getting in a quick ride, but the wet roads and radar reports didn't make it look very promising.  By about 7pm the roads were looking relatively clear, but the sky still looked threatening.  I wasn't too concerned with 3 days of riding left that I could get the time in.  

Friday - I had already been figuring out what I wanted to do for rides over the weekend, and I came across an older 80mi route that I had been really wanting to try out all spring.  Looking at the forecast, it was going to be cool but nice, and it would give me over 4 hours of time in the saddle.  For the ride on Friday what it meant was that I had to make sure to get in time Friday, but definitely not overdo it.  While longer than the recovery ride Thursday evening, it was a shorter effort than I had been doing most lunchtimes thus far.  I was now just over 4 hours left to finish the challenge, with a big 80mi ride the next day!


Saturday - I have to say that building up an epic week of riding like this has a way of really testing if you are able to stick to your game plan, as well as keep each workout within reason so you can maintain your effort.  With a seemingly monsterous route ahead of me, especially solo, it was going to be a good dry run of my ability to keep to my game plan.  Without the distractions of keeping with a group, it was up to me to make good sound choices on fueling and pace.  After a good breakfast, and a little bit of a late start, I got underway.  I ended up needing arm warmers, as the weather was cooler than expected at the start of the ride, and I packed enough water and food for at least 2/3 of the ride.  I already knew in my head that I'd probably be stretching that to be for the entire ride, but I had made this route with at least 2 known good rest stops along the way.  Of the 80 miles that I was going to ride, there was probably only about 10 or 15 miles of it that were new roads to me.   That meant that at any point I could decide to change the route up if I felt that things were not going well.


During the route I did extremely well at making sure to have fuel, and taking my time when I needed to.  The hardest parts to deal with really were the climbs.  Up until this week, the largest effort week I had done was 171miles and 11 hours.  This meant that by Satuday I was into uncharted territory for how much energy I'd have left.  I was having to make sure to conserve energy whenever possible, allowing myself the chance to recover on downhills and setting an easy pace on the uphills.  The goal wasn't to set any personal records, but rather to get a solid effort in and have good time in the saddle.  

What I wasn't expecting was that the weather was going to show signs of turning.  The weather reports had said a 30% chance of rain on Sunday, and clouds in the afternoon Saturday.  By the time I was just about home on the route, the winds started to pick up, and if I was back Florida I would have expected a severe thunderstorm within the hour.  I worked my way back to the house, and completed the course in just over 5 hours of moving time.  16 hours completed, and 252miles traveled.  This turned out to be a good strategy, as Sunday ended up being washed out all day long.  The weather finally cleared late in the afternoon.  For me it ended up being a great afternoon to catch up on some rest and spend some time with the family.

In the end I feel like my training is in a good place as the time draws nearer for the Ride to Remember.  My goal for the ride isn't to go with the A group and ride like crazy each day, but rather to enjoy the experience and ride with friends and teammates.  The ride profile should work well to my personality type on the bike, as the majority of the non-flat riding ends up being late on Day 1 and early on Day 2.  As long as I am able to "ride my ride" during the event, and force myself to stop when I know it's appropriate, I should do fine.