Created
June 15, 2019 20:18
-
-
Save denniskawurek/7f2852c75a00dcc5ca2daf9a29c4117d to your computer and use it in GitHub Desktop.
Visualize all collected data points of your Google Maps location history
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Visualizes your Google Maps location history on a Map using OpenStreetMap | |
# If you want more information (e.g. number of collected points per day), consider this post https://shiring.github.io/maps/2016/12/30/Standortverlauf_post | |
library(mapview) | |
library(jsonlite) | |
x <- fromJSON("") # Add here the path to your .json | |
loc = x$locations | |
# converting time column from posix milliseconds into a readable time scale | |
loc$time = as.POSIXct(as.numeric(x$locations$timestampMs)/1000, origin = "1970-01-01") | |
# converting longitude and latitude from E7 to GPS coordinates | |
loc$lat = loc$latitudeE7 / 1e7 | |
loc$lon = loc$longitudeE7 / 1e7 | |
dots <- data.frame(x=loc$lon, | |
y=loc$lat) | |
coordinates(dots) <- ~ x + y | |
proj4string(dots) <- "+init=epsg:4326" | |
mapview(dots, label=loc$time, cex=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment