Home

Loc­a­tion His­tory

Since around 2012, I've had a phone that keeps track of my loc­a­tion whenev­er it's on, us­ing Google's Loc­a­tion His­tory. When I first star­ted writ­ing this soft­ware, I wanted to see where I had vis­ited in the UK and where I most fre­quently was. I de­cided that the best way to rep­res­ent this was to use a heat-map. I then turned this into a web ser­vice so that I can more eas­ily up­date the im­ages.

Data Fa­cets:

You can find the code in its re­pos­it­ory on Git­Hub, loc­a­tion-his­tory.

Here's a quick (re­l­at­ively high level) how-to on turn­ing your data into a heat­map:

  1. Re­trieve your data from Google
  2. Load the data from the file
  3. Strip out the most in­ac­cur­ate points
  4. Con­vert the data to a more useable co­ordin­ate sys­tem
  5. Con­vert the data to a more ef­fi­cient data struc­ture, like a Quadtree - per­haps the most fun part of the pro­cess
  6. Cre­ate a heat­map ar­ray (num­ber of points with­in each (x,y) of the view­port) from a view­port (scale, cen­ter point, and di­men­sions of the pro­jec­tion) - an­oth­er fun part
  7. Cre­ate a paint­er for the heat­map (defines col­or, pixel size and writes the data to some sort of can­vas)
  8. Save the im­age to file