Since around 2012, I've had a phone that keeps track of my location whenever it's on, using Google's Location History. When I first started writing this software, I wanted to see where I had visited in the UK and where I most frequently was. I decided that the best way to represent this was to use a heat-map. I then turned this into a web service so that I can more easily update the images.
Data Facets:
You can find the code in its repository on GitHub,
location-history
.
Here's a quick (relatively high level) how-to on turning your data into a heatmap:
- Retrieve your data from Google
- Load the data from the file
- Strip out the most inaccurate points
- Convert the data to a more useable coordinate system
- Convert the data to a more efficient data structure, like a Quadtree - perhaps the most fun part of the process
- Create a heatmap array (number of points within each (x,y) of the viewport) from a viewport (scale, center point, and dimensions of the projection) - another fun part
- Create a painter for the heatmap (defines color, pixel size and writes the data to some sort of canvas)
- Save the image to file