March 3, 2018

Creating Runkeeper Tile Maps with Alteryx & Tableau

A couple weeks ago, I demoed how to create tile maps of Runkeeper runs using Alteryx and Tableau. You can watch the recording here; I was the final speaker if you need to fast forward.

In this post, I'll detail how I created the tile maps and share the workflow and visualizations. The inspiration for this project comes from Marcus Volz and his great github tutorial on how to create small multiple visualizations of your Strava runs, which I wrote about here. This was the viz that I created based on his R code:

When I visited The Information Lab France in January, we decided that we would try to replicate Marcus' process with Alteryx and Tableau because we wanted it to be an interactive visualisation, whereas Marcus' creates a static image. This process should work for Runkeeper, Strava or any fitness app that uses GPX files.

To get all of your routes from Runkeeper:

Login to Runkeeper

Go to "Account Settings" from the gear at top right of the screen

Choose the Export Data option on the left

Select the date range

Click on Export Data

Unzip the files

To get all of your routes from Strava:

Login to Strava

Select "Settings" from the main drop-down menu at top right of the screen

I actually don't follow either of these methods. I pay a small yearly fee for a service called Tapiriik that allows you to sync your fitness data with Dropbox.

ALTERYX WORKFLOW

Since all of my files are in one place, this makes getting them all into Alteryx with a single input easy using a wildcard input. I've documented my workflow and you can download it here.

Steps

Input all of the files using a wildcard match for 2018 runs only.

Assign a unique number to every row. In these files there's a GPS reading every second. Having a unique number makes creating the routes easier because you know the sequence.

The next few steps are the magic part. These essentially give every route the same size as a square. We need them all to be the same size regardless of the actual geographical area covered.

Create points for each GPS points and connect them to create a polyline. Do this for both the route itself and the boundary

Calculate some summary stats for each run.

Bring them all back together.

Export as a SHP file.

TABLEAU VISUALIZATION

Once the shapefile is done, all you need to do is connect to it in Tableau. I created two visualizations. Click on the images for the interactive versions and to download the workbook.

1. Small Multiples

Like Marcus' viz, I created a view that spaces the runs based on the number of runs in the view. For example, in February, I recorded 22 runs, so I get a view with 5 rows and 5 columns. Each square has a route from the first run on the upper left to the most recent run in a Z pattern. There are additional details about each individual runs available on hover.

This view uses table calculations to determine the spacing.

2. Calendar View

The calendar is much simpler to create since it doesn't need any table calcs.

Double click the Geometry field to get a map

Filter to a single month

Place Weekday on the Columns

Week on the Rows

Add information for tooltips

Add total monthly mileage to the caption

Resize the rows and columns to fit the window

LESSONS LEARNED

I'm nowhere near an expert in Alteryx. I know I can improve if I practice more. Here are five lessons learned I learned that I will be taking forward:

Leverage the strength of your team to help you solve a problem and to help you learn.

Alteryx makes creating and working with spatial objects incredibly simple.

Prepping the data exactly as you need it in Tableau will make the visualization process much faster.

Data prep processes in R and Python make for great data prep exercises in Alteryx.