Tona Medina

Code bike run... and yeah, swim too.

Posts tagged code

15 notes

Importing GPX from Runkeeper to Strava with correct time start!

I do have mixed feeling writing this. I joined Runkeeper back in 2009, and it did help me a LOT with motivation on my running and even finish some races - it also helped with cycling, and I even posted some swims. So it won’t be fair to say that I’m not glad I joined RK. I am.

RK’s app is solid, and has a some cool of features (like voice queues) that are very important for runners. But it lacks some other features that, as a cyclist, I’d like to have too: “stopped time” vs “moving time” to mention one. And the social features in Runkeeper website are not great (they have StreetTeams, but to me it seems just like just a regular group)

However, I recently discovered Strava, and I have to admit: I’m obsessed with it.

How can I describe Strava? It’s Facebook meets MapMyRide (or Runkeeper), then it meets Garmin Connect, then finally meets FourSquare.

In Strava, you don’t only upload your rides or runs from their app (or Garmin GPS watch), but you can also connect to other local athletes - automagically - covering the same segments within your ride or run.

Strava will find popular segments in your route from their database, and compare you (and ranked) with hundreds of other athletes. You can also explore new segments - It’s so addicting, that I have to confess: I recently took a detour in my Paradise loop with the solely purpose to just see how I ranked in a popular SF/Marin climb. (Hawk Hill)

Ok… so now you also ready to ditch Runkeeper (Sorry Jason!) and move to Strava. And you probably are wondering: What happens to my runs (or rides)?…

Well you can easily import them, however, due to a bug on Runkeeper’s side you will probably end up with the wrong time start as RK will build the GPX file with local times rather than UTC (ie: your runs will seem to start at 3am when imported, when you really ran them at 10am).

So here is how you can modify your GPX timestamps to UTC so they upload to Strava correctly: (Be warned… it’s geeky. I’m gonna try write an quick web ruby app and post it in Heroku leveraging this cool script by  Aron Burell, but for now there is only that script AFAIK)

In your Mac, open the terminal (Spotlight > Terminal - Windows user, you will need to get Ruby separate, but the idea is the same… and if you’re on Ubuntu, I’m sure you don’t even need to read this).

  • Your Mac OSX should come with Ruby, but you might need to install some gems for the script to run)
$ sudo gem install xml-simple
  • Then you need a GPX to fix…. Download your GPX from RK.

  • And remove the spaces on the filename
$ mv RK_gpx\ _2011-10-27_1248PM.gpx RK_gpx_2011-10-27_1248PM.gpx 
  • Then, get script from here. And modify the line with the TZ to yours. ie:
TZ = TZInfo::Timezone.get("America/Edmonton") 

To

TZ = TZInfo::Timezone.get("America/Los_Angeles")
  • Run the script
$ ruby gpxfixer.rb RK_gpx_2011-10-27_1248PM.gpx
  • Your fixed file will be in the same location with a similar name:
$ ls *.gpx 
RK_gpx_2011-10-27_1248PM.gpx fixed-RK_gpx_2011-10-27_1248PM.gpx
  • Finally, upload to Strava the “fixed” file…

happy and safe running/cycling!

Tona

(If you’re geekly impaired, please stay tuned for the website I’m working on to do all this for you).

Filed under Runkeeper Garmin Strava Running Cycling Fitness code