A tool for visualizing your complete, consolidated, collected Google [Location History](https://google.com/locationhistory).
It works directly in your web browser – no software to download, no packages to install. **Everyone deserves to know what data is being collected about them, without having to fiddle with cryptic pieces of software.**
*location-history-visualizer* takes raw Google Takeout output and produces a heatmap of all of your location data over time, overlaid on an interactive map.
## Packages used
*[leaflet.js](http://leafletjs.com/), for rendering the interactive map
*[leaflet.heat](https://github.com/Leaflet/Leaflet.heat), for rendering the heatmap overlay
*[filestream](https://github.com/DamonOehlman/filestream), for dealing with gigantic Google Takeout files
*[oboe.js](http://oboejs.com), for processing said gigantic files
*[browserify](http://browserify.org/), for helping filestream work properly in the browser
<aid="forkme"href="https://github.com/theopolisme/location-history-visualizer"target="_blank"><imgstyle="position: absolute; top: 0; right: 0; border: 0;"src="https://camo.githubusercontent.com/52760788cde945287fbb584134c4cbc2bc36f904/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67"alt="Fork me on GitHub"data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>
<!-- Shown before the heatmap is displayed -->
<divclass="container">
<divclass="content">
<!-- Intro, before data has been uploaded -->
<divid="intro"class="content-box">
<h2>Location History Visualizer</h2>
<divclass="note">
<strong>Note:</strong> This tool only generates heatmaps. If you're looking for minute-by-minute analysis of your Location History, including accuracy information, location-based search, advanced filtering and measurement tools, and more, check out <strong><ahref="https://theopatt.com/lhv-pro">Location History Visualizer Pro</a></strong>.
</div>
<p>Welcome to <b>location-history-visualizer</b>, a tool for visualizing your collected Google <ahref="https://google.com/locationhistory"target="_blank">Location History</a> data with heatmaps. <i>Don't worry—all processing and visualization happens directly on your computer, so rest assured that nobody is able to access your Location History but you... and Google, of course.</i> ^.^</p>
<p>To start off, you'll need to go to <ahref="https://google.com/takeout"target="_blank">Google Takeout</a> to download your Location History data: on that page, deselect everything except Location History by clicking "Select none" and then reselecting "Location History". Then hit "Next" and, finally, click "Create archive". Once the archive has been created, click "Download". Unzip the downloaded file, and open the "Location History" folder within. <b>Then, drag and drop <i>LocationHistory.json</i> from inside that folder onto this page.</b> Let the visualization begin!</p>
<pclass="fallback">Alternatively, select your <b>LocationHistory.json</b> file directly: <inputname="file"type="file"id="file"></input></p>
<hr>
<p><i>Experimental (even faster!) import method:</i> Instead of going through Google Takeout, simply browse to the <ahref="https://maps.google.com/locationhistory/kml?startTime=0&endTime=9000000000000"target="_blank">Google Location History KML API endpoint</a>. A file (<b>history-12-31-1969.kml</b>) will be downloaded – just drag and drop it onto this page, and we're off! <i>Note:</i> This uses a non-public Google API and as such may cease to work at any point. Your mileage may vary.</p>
<pclass="credit">A project by <ahref="https://theopolis.me"target="_blank">@theopolisme</a>. Made in 2014 in Memphis, Tennessee (updated 2015).</p>
</div>
<!-- Shown in interim while processing is in progress -->
<p>This will take a while... sit back, get a cup of tea or something.</p>
<p><i>Why does it take so long?</i> Depending on how long Google's been tracking your location, you may have hundreds of thousands of [latitude, longitude] pairs, every one of which must be loaded, analyzed, and plotted. That's a lot of dots.</p>
</div>
<!-- Content displayed once processing complete -->
<divid="done"class="content-box hidden">
<h2>Render complete!</h2>
<p>Successfully processed <spanid="numberProcessed"></span> data points to generate the heatmap. Click inside this box to dismiss it and start exploring...</p>
<p><i>Zoom</i> by scrolling, double-clicking, or using the buttons in the upper lefthand corner. <i>Navigate</i> by clicking and dragging. Hover over the menu in the lower lefthand corner to customize the heatmap rendering.</p>
<pclass="credit">A project by <ahref="http://theopolis.me"target="_blank">@theopolisme</a>. Made in 2014 in Memphis, Tennessee.</p>
<inputtype="image"src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif"border="0"name="submit"alt="PayPal - The safer, easier way to pay online!">
status(percentLoaded+'% of '+fileSize+' loaded...');
};
reader.onload=function (e){
varlatlngs;
status('Generating map...');
try{
if (/\.kml$/i.test(file.name)){
latlngs=getLocationDataFromKml(e.target.result);
}else{
latlngs=getLocationDataFromJson(e.target.result);
}
}catch (ex){
status('Something went wrong generating your map. Ensure you\'re uploading a Google Takeout JSON file that contains location data and try again, or create an issue on GitHub if the problem persists. (error: '+ex.message+')');
return;
}
heat._latlngs=latlngs;
heat.redraw();
stageThree(/* numberProcessed */latlngs.length);
};
reader.onerror=function (){
status('Something went wrong reading your JSON file. Ensure you\'re uploading a "direct-from-Google" JSON file and try again, or create an issue on GitHub if the problem persists. (error: '+reader.error+')');