Skip to content

Instantly share code, notes, and snippets.

@vigevenoj
Created April 5, 2016 02:49
Show Gist options
  • Save vigevenoj/792f3feb0715e28d180fd7b83e7967a8 to your computer and use it in GitHub Desktop.
Save vigevenoj/792f3feb0715e28d180fd7b83e7967a8 to your computer and use it in GitHub Desktop.
trim Google Location History to points during a specified time window and view them as a heatmap
Go to https://takeout.google.com/settings/takeout
"Select None"
Scroll down to "Location History" and select that
Scroll to the bottom, click next, and download the file
Extract the LocationHistory.json
Convert the start and end times that you're interested in to milliseconds since epoch (epoch * 1000) and use them in the comparisons below
Use this jq filter pipeline to match only the timestamps that are within the selected time range, and export that to a file
jq '{"locations" : .locations | map(select(.timestampMs | tonumber >= 1458889200000)) | map(select(.timestampMs | tonumber <= 1459796400000)) }' Takeout/Location\ History/LocationHistory.json > trip.json
Use https://theopolis.me/location-history-visualizer/ to see the heatmap from the trip.json file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment