luka1199 / geo-heatmap
- вторник, 26 ноября 2019 г. в 00:27:55
Python
🗺 Generate an interactive geo heatmap from your Google location data
This is a script that generates an interactive geo heatmap from your Google location history data using Python, Folium and OpenStreetMap.
If you don't already have Python 3+ installed, grab it from https://www.python.org/downloads/. You'll want to download install the latest version of Python 3.x. As of 2019-11-22, that is Version 3.8.
Here you can find out how to download your Google data: https://support.google.com/accounts/answer/3024190?hl=en
Here 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.
On https://github.com/luka1199/geo-heatmap, click the green "Clone or Download" button at the top right of the page. If you want to get started with this script more quickly, click the "Download ZIP" button, and extract the ZIP somewhere on your computer.
In a command prompt or Terminal window, navigate to the directory containing this repository's files. Then, type the following, and press enter:
pip install -r requirements.txt
In the same command prompt or Terminal window, type the following, and press enter:
python geo_heatmap.py <file>
Replace the string <file> from above with the path to the LocationHistory.json JSON file from Google Takeout.
The script will generate a HTML file named heatmap.html. This file will automatically open in your browser once the script completes. Enjoy!
MemoryError error when I try to run the script. What's going on?Your LocationHistory.json file 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: