Created
February 25, 2021 04:07
-
-
Save MichaelChirico/0c49f6ea73f4d750590547eddb3dc0e3 to your computer and use it in GitHub Desktop.
Generate the travel radius around California Santa Clara County for COVID restrictions
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
library(data.table) | |
library(sp) | |
library(rgdal) | |
library(rgeos) | |
# Via CA GIS Data site | |
ca = readOGR("~/Downloads/CA_Counties", "CA_Counties_TIGER2016") | |
travel_zone = gBuffer( | |
ca[ca$NAME == "Santa Clara", ], | |
width = 150 * 5280 * 12 * 2.54 / 100 | |
) | |
travel_zone = gIntersection(travel_zone, ca) | |
plot(travel_zone, col = "red") | |
plot(ca, col = "#0064007f", add = TRUE) | |
text(coordinates(ca), ca$NAME, cex = .6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment