Package: geo-heatmap
Geo HeatmapThis is a script that generates an interactive geo heatmap from your Google location history data using Python, Folium and OpenStreetMap.Getting Started1. Install Python 3+If you don't already have Python 3+ installed, grab it fromhttps://www.python.org/downloads/. You'll want to download install the latest version ofPython 3.x. As of 2019-11-22, that is Version 3.8.For ease of python version handling, I'd recommend installing it throughpyenv.2. Get Your Location DataHere you can find out how to download your Google data:https://support.google.com/accounts/answer/3024190?hl=enHere you can download all of the data that Google has stored on you:https://takeout.google.com/To use this script, you only need to select and download your "Location History", which Google will provide to you as a JSON file by default. KML is also an output option and is accepted for this program.3. Install the scriptIn acommand prompt or Terminal window,navigate to the directorycontaining the location data files. Then, type the following, and press enter:pipinstallgeo-heatmap4. Run the ScriptIn the same command prompt or Terminal window, type the following, and press enter:geo-heatmap<file>[<file>...]Replace the string<file>from above with the path to any of the following files:TheLocation History.jsonJSON file from Google TakeoutTheLocation History.kmlKML file from Google TakeoutThetakeout-*.zipraw download from Google Takeout that contains either of the above filesExamples:Single file:geo-heatmapC:\Users\Testuser\Desktop\locations.jsongeo-heatmap"C:\Users\Testuser\Desktop\Location History.json"geo-heatmaplocations.jsonMultiple files:geo-heatmaplocations.jsonlocations.kmltakeout.zipUsing the stream option (for users with Memory Errors):geo-heatmap-slocations.jsonSet a date range:geo-heatmap--min-date2017-01-02--max-date2018-12-30locations.jsonUsage:usage: geo-heatmap [-h] [-o] [--min-date YYYY-MM-DD]
                      [--max-date YYYY-MM-DD] [-s] [--map MAP]
                      file [file ...]

positional arguments:
  file                  Any of the following files:
                        1. Your location history JSON file from Google Takeout
                        2. Your location history KML file from Google Takeout
                        3. The takeout-*.zip raw download from Google Takeout
                        that contains either of the above files

optional arguments:
  -h, --help            show this help message and exit
  -o , --output         Path of heatmap HTML output file.
  --min-date YYYY-MM-DD
                        The earliest date from which you want to see data in the heatmap.
  --max-date YYYY-MM-DD
                        The latest date from which you want to see data in the heatmap.
  -s, --stream          Option to iteratively load data.
  --map MAP, -m MAP     The name of the map tiles you want to use.
                        (e.g. 'OpenStreetMap', 'StamenTerrain', 'StamenToner', 'StamenWatercolor')6. Review the ResultsThe script will generate a HTML file namedheatmap.html. This file will automatically open in your browser once the script completes. Enjoy!FAQI'm getting an "Out of Memory" error orMemoryErrorwhen I try to run the script. What's going on?YourLocationHistory.jsonfile is probably huge, and Python is running out of memory when the script tries to parse that file.To fix this, download and install the 64-bit version of Python. To do this:Go topython.org.Click the link corresponding to your OS next to "Looking for Python with a different OS?"Click the "Latest Python 3 Release" link.Scroll down to "Files".Click to download the x64 release. For example, on Windows, that's the "Windows x86-64 executable installer" link.Install!If this does not fix the issue you can use the stream option:geo-heatmap-s<file>This will be slower but will use much less memory to load your location data.I'm getting aSyntaxErrorwhen runningpip install -r requirements.txtorpython geo_heatmap.py <file>. What am I doing wrong?You are probably using the python interpreter to run these commands. Try to run them in cmd.exe or Windows PowerShell (Windows) or the Terminal (Linux, MacOS).I'm getting the error messageTypeError: __init__() got an unexpected keyword argument 'max_value'. What can I do to fix this?Try to run:pipuninstallprogressbar
pipinstallprogressbar2You probably have progressbar installed, which usesmaxvalas an argument for__init__. Progressbar2 usesmax_value.DevelopmentThis project is usingPoetryto manage dependencies. You can install it by following their guide.If you would like to develop on this further, after cloning this repository and navigating into it you can get up and running with the following:poetryinstall
poetryrungeo-heatmap