Segments are a great way to see how many times you’ve covered certain sections of road/track, but what if there are no segments set up for the stretch you are interested in? Say hello to the Activity Overlaps tab! OK, probably not the most sexy of names, but what it lacks in title it makes up for in functionality – select any section of any activity and it will search through all your activities and provide a list and map of any that overlap. Neat!
I’ll have to admit, this started life as more of a technical challenge for myself rather than any particular feature request but you can see that this could be the starting point to providing RaceShape style comparisons between your own activities and comparing multiple, similar activities has been an often asked for feature.
Before anyone gets in touch saying that it isn’t matching activity X or it is taking too long to run then please make you’ve read and understood everything in this blog post first! Due to how it works there is a trade off between performance and accuracy and it is never going to be 100% perfect and if you’ve loads of data or running on a low spec device then performance is probably going to be an issue. I probably won’t reply to people asking questions where it is clear they haven’t read this post fully!
What it does
Go to the Activity Details page for any of your activities (or someone else’s if their data is set to public), Swap to the “Overlaps” tab and select a section of the activity (using your mouse or finger on the elevation profile). After a bit of number crunching (see performance section below) it will provide you with a list of the closest matching activities for that selected portion of the activity. Those activities are also displayed in the map along with the selected section of the context activity.
The order of activities on the list is based on how well it matches the selected section of the context activity. Hovering over the items in the list highlights that activity on the map. Potential for the future would then be the ability to navigate to a activity comparison page between the context activity and one of those in the list although I’m not promising anything!
How it works
If you look at your Activities List page and turn on the map you see a kind-of heat map of everything you’ve done. Strava provide a summary view of each activity’s route which is a really simplified view attempting to show the route as well as it can using as few data points as possible. If you zoom right the way in you’ll see trade off of this approach but for what it is designed for this is perfectly understandable (see image where wiggly roads are often represented as straight lines and some large sections are missed entirely).
This summary route of each activity is what I use to compare against to work out which activities best overlap the selected section of the context activity. Seeing as the selected section is using the full, detailed route (I actually simplify it a fair bit it for performance reasons but not as much as these summary routes) then how well each activity overlaps is dictated by how simplified their routes have been in their summary route. So you might well see the context activity itself appearing some way down the list despite the selection being from itself due to how its summary map has been calculated.
In order for this functionality to work at all it requires access to your full list of activities including their maps. Fortunately I already cache this locally in your browser’s local storage whenever you visit your Summary or Activities List page. You will get a message displayed if this cache isn’t available.
Note: For some technical reason that has always defeated me this caching in local storage isn’t enabled on Internet Explorer (it always seems to garble the content when retrieving it) so this overlaps feature, for the time being, isn’t going to be available on IE (and maybe other browsers…)
There is a large amount of number crunching required whenever it goes off to find the overlaps and the amount of time it takes is based primarily on three factors:
- The number of activities you have in the system – obviously the more activities you have in VeloViewer the longer it will take to check through them all. I do attempt to filter out those that will never overlap but if you always log your commutes and pick a section in that same area then expect it to take some time.
- The length of the section you select – the longer the section of route you’ve selected to match then the more data points it will need to check for each activity so the longer it will take.
- The performance of the device – running this on your phone on an iPad 2 will probably struggle. It will work but you’ll need to give it a bit of time. iPad 3s are much faster than 2s.
There is certainly a possibility for me to make this functionality far more accurate by creating my own summary routes which are a bit more detailed but in order to do that requires having the full lat/lng details first. This isn’t something I will be doing in bulk but is certainly a possible improvement for me to bear in mind. The trade off for that (given that I could get hold of that data easily in the first place) would be that with more data points in the summary views, more processing would be required to make those matches.