Tracking runners without draining their phone battery

Running a GPS unit on a phone drains your battery quickly with all the work it has to do (measurement reports, transmission alongside your normal apps), when you are going to be running for a LONG time you need to think outside the box!

I run, and over last year have graduated from Couch to 5k, through 10km and on to half marathon distances. This means I have friends that run, some of them run A LOT further than me….

Some good friends are running Race To The Stones soon, it’s a 100km race (62 miles) along the Ridgeway, Britain’s oldest path – that’s a LONG way!

We looked at ways to track the team for friends and family to come along and support them along the route, or even run part of the route with them (yes, I’ll be one of them!). We didn’t want to take over their personal tracking they’ll be using Strava and Garmin devices for that and there is of course an official tracking system which you can pay for but, but we wanted something a little different.

Something that was manual, that they could check in on without having to message 25 people with a conversation looking like this:

  • “I’m in a field, it’s pretty”,
  • “Where are you?”,
  • “In a field!”

I sat down and plotted the Race to the Stones route with a polyline over the top of Open Street Map using Leaflet.js, and added the mile markers to it, this allowed us to see where exactly good points to meet them might be in their journey.

See, it is a very long way!

Then I created a hidden page where they could hit a very large button (UX for runners sweaty fingers) and have it track their location (note: location permissions demand a secure page now), I ajax their current latitude and longitude off to server side script and store it.

Next I needed a marker of where they are, but crucially what happens if they don’t run EXACTLY on the polyline that I’ve plotted?

This is where GeometryUtil came in, I was able to snap them on to their nearest point on the polyline making sure we matched them to the route.

This is the closest point on the route to our offices in Swindon!

Once we got to this point I had a couple of pieces of data:

  • The time of the last update
  • The distance travelled

Using this I could show their average speed to allow friends and family to predict when they might be somewhere along the route.

It’s basic really at the moment, but it will do the job when the event is less than 72 hours away!

It’s not live tracking, but it’s free, and as long as they remember to hit the big green button they’ll get lots of support along the route!

Future extensions:

  • We would like to add the pit stops along the route, I’ve asked Race to the Stones for the latitude and longitude of these as they’ve just been given as distance along the route for the runners – I’ll work them out if I have time but this would be easier to plot.
  • Notifications, it would be relatively simple to add notifications (Twitter, Email, SMS) every time they updated their location.
  • Make it into an app, that you can set the interval with which it pushes the location up.

Leave a Reply

Your email address will not be published. Required fields are marked *