For this final, I wanted to visualize my Google Maps location history. I’ve been using different android devices since I acquired my first in December 2012, less than three months after I moved to NYC. Being a creature of habit/obsessive compulsions, I figured my location history had captured the passing fancies and preoccupations that shaped my development into an independent adult, and my (reluctantly assumed) identity as a New Yorker.
So I downloaded this history from takeout.google.com as a 325MB json file (lol):
Here’s what I got when I logged the data in the console:
So that wasn’t going to happen. To make it easier on the browser, I ended up filtering out coordinates outside of (approximately calculated) NY bounds. I also divided the data into six arrays, one for each year:
Apparently, the period from 2013-present accounts for 982,154 locations out of a total of 1,170,453— which means 188,299 locations (16% of the total) were filtered out for being beyond NYC. The reason why array, array and array contain less than half of what array and array do is precisely that—I spent the majority of those years traveling. Array is even smaller because it contains 2018 data.
Okay, so the next challenge was injecting this data into a mapbox source layer. Since mapbox expects geojson formatting, I had to hack it a little (ie, steal someone else’s hack from stackoverflow):
Then, I adapted the filtering legend from this mapbox demo to my page. Here’s what I ended up with:
Here’s the breakdown by year: