Skip to content

Instantly share code, notes, and snippets.

@mbafford
Created March 18, 2015 01:31
Show Gist options
  • Save mbafford/d32c67fe8b8f56159e99 to your computer and use it in GitHub Desktop.
Save mbafford/d32c67fe8b8f56159e99 to your computer and use it in GitHub Desktop.
Google Location History to Heatmap
Download location history on takeout
https://www.google.com/settings/takeout
Extract and get json file
Convert json file to coordinates
python -c 'import sys, json; e7=10000000.0; locs = json.load(sys.stdin)["locations"]; print("\n".join( "%s %s" % ( loc["latitudeE7"]/e7, loc["longitudeE7"]/e7 ) for loc in locs ))' < LocationHistory.json > locations.lst
Download heatmap.py:
http://www.sethoscope.net/heatmap/
Run heatmap.py:
World:
python heatmap.py -p locations.lst -o google_location_history_all_time_world.png --width 2048 -d 0.5 -r 10 --osm -B 0.8 -e -60,-175,70,175 -v
Continental US:
python heatmap.py -p locations.lst -o google_location_history_all_time_us.png --width 2048 -d 0.5 -r 10 --osm -B 0.8 -e 25,-130,50,-65 -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment