A while back I was looking to track how fast Oscar, my dog, runs while playing fetch. At roughly the same time I was also reading 'Where the Animals Go' and was seeing some other really neat dog tracking experiments. These sources of inspiration set me on a course to dive into how Oscar plays fetch and how I might explore that data using some visualizations.
In my mind I knew a few things I wanted to accomplish with the final visualizations based on elements from my sources of inspiration (much of these criteria came from an Esri UC plenary presentation on Albatross travel):
I knew I wanted the visualization to appear as a 'ribbon'.
I wanted my visual element to be encoded with both a size and a colour that could be used to depict one or two variables.
Data collection was rather simple, I have a Garmin Edge GPS for cycling and I attached it to Oscar's collar with Velcro (we tested it in an open grass field so there was no threat of losing it in the woods). After that we grabbed a tennis ball and let it rip! After a half hour of enthusiastic fetch I retrieved the tracker and downloaded the data as a GPX file.
Then came the data-processing. Obviously, there's no perfect tool that already exists to visualize the data in the way that I wanted to so I had to write one. I wrote the script in Python and set out to create a polygon between each pair of points in the dataset that varied the end widths based on the variable of the point (below). I realize this is incredibly similar to setting the width of a line between the two points based on a variable however, lines may not always join nicely depending on the vertices and the lines would be a consistent width (maybe an opportunity for tapered polygon effect in ArcGIS Pro).
Essentially, what I aimed to calculate for each vertex was a polygon edge that was perpendicular to the preceding datapoint and the following datapoint. This line would be scaled in length based on the selected variable of that datapoint. This calculation would be repeated for the other edge of the polygon and then the polygon would be closed using the 4 coordinates that were calculated. Easier said than done right?
I managed to sort out most of the logic and encode that in my tool, but I ended up hitting a few snags. The calculations I was using to scale the polygon edges didn't always work out as expected. This is where I ended up shouting into the void of the internet hoping someone eager reader might find it interesting enough to provide some insights. I also posted on Geonet with my problem and some context. At this point I can't stress enough how great the geospatial community can be, we're all using such a variety of tools and we're all working in such a vast spectrum of industries but generally someone is usually working on a similar problem or is at least willing to help. Thanks, to someone replying to my Geonet post I was able to resolve my mistakes in my code and get the results I expected!
With the code all sorted, I processed the GPX points from our session of fetch and got some really neat, albeit it messy looking, results.
I've tested the tool on other datasets as well for interest, here's one using data from Move Bank of Albatross travel.
Here's a large collection of GPS points from bike ride. It is encoded with 2 variables in the width and colour.
I also processed transit ridership in the form of a flow map and encoded stations in sequence with ridership as the width.
If you'd like to dig into the code or try out the tool with some samples, here are some resources:
Thanks for reading and good luck mapping!
Warren
Comments