Skip to content

Instantly share code, notes, and snippets.

@leeper
Last active December 4, 2015 10:51
Show Gist options
  • Save leeper/358c41f3a0e36053a62e to your computer and use it in GitHub Desktop.
Save leeper/358c41f3a0e36053a62e to your computer and use it in GitHub Desktop.
Minneapolis license plate tracking data
library("ggmap")
# https://github.com/reureu/Minneapolis-ALPR-Data
# removed 163478: 8b79f42dd1f945d588df16f271cafb54,Latitude,Longitude,Timestamp,Device
d <- read.csv("data.csv", header = FALSE, colClasses = c("factor", "numeric", "numeric", "character", "factor"))
names(d) <- c("id", "lat", "lon", "datetime", "reader")
# create map
map <- get_googlemap("minneapolis", zoom = 12, color = "bw")
# map locations of all readings
ggmap(map) + geom_point(aes(x = lon, y = lat), data = d, alpha = 0.05, size = 1, colour = "blue")
# map locations of all readings, by reader
ggmap(map) + geom_point(aes(x = lon, y = lat, colour = reader), data = d, alpha = 0.05, size = 1) + theme(legend.position="none")
# one vehicle was tracked 1615 times
ggmap(map) + geom_point(aes(x = lon, y = lat), data = d[d$id == "c72b9cfb3d3841e6b8f90f5a44538fbe",], alpha = 0.5, size = 2, colour = "red")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment