changed political boundary data

added a way to select state in 03_make_figures.R
This commit is contained in:
Ben Varick 2023-10-18 13:42:54 -05:00
parent 9ded118791
commit d14558b6bf
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
5 changed files with 52 additions and 31 deletions

View File

@ -36,8 +36,9 @@ for (layer in layers){
}
# load political boundaries
political <- list(NULL)
political_boundaries <- list.files(path = paste0(data_dir, "/political_boundaries"))
for (boundary in political_boundaries) {
political[[boundary]] <- st_read(paste0(data_dir, "/political_boundaries/", boundary))
}
political <- st_crop(
st_transform(
st_read(
paste0(data_dir, "/political_boundaries/bound_p/boundaries_p_2021_v3.shp")),
crs=crs),
y = extent_bbox)

View File

@ -17,29 +17,40 @@ units <- "in"
res <- 600
margin <- 0
# set state to highlight
state <- c("Wisconsin")
# plot map
plot_map <- function () {
plot(sf::st_geometry(extent_poly),
plot(sf::st_geometry(extent_poly),
col = colors$lightblue,
border = NA)
plot(sf::st_geometry(political$geometry),
col = colors$lightgrey,
border = "black")
plot(political$Wisconsin_State_Boundary_24K.geojson,
border = NA,
add = TRUE)
plot(sf::st_geometry(political[political$NAME_En %in% state, ]),
col = colors$darkblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDWaterbody),
plot(sf::st_geometry(data$NHDWaterbody),
col = colors$lightblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDArea),
plot(sf::st_geometry(data$NHDArea),
col = colors$lightblue,
border = NA,
add = TRUE)
plot(sf::st_geometry(data$NHDFlowline),
plot(sf::st_geometry(data$NHDFlowline),
col = colors$lightblue,
lwd = data$NHDFlowline$TotDASqKM^0.3204*0.0446,
border = NA,
add = TRUE)
plot(sf::st_geometry(extent_poly),
col = NA,
border = "black",
lwd = 1,
add = TRUE)
}
# save figure

3
extent_olympic.csv Normal file
View File

@ -0,0 +1,3 @@
latitude,longitude
48.50775,-124.91972
46.88398,-122.07015
1 latitude longitude
2 48.50775 -124.91972
3 46.88398 -122.07015

3
extent_wa.csv Normal file
View File

@ -0,0 +1,3 @@
latitude,longitude
49.17657,-125.43151
45.23644,-115.81455
1 latitude longitude
2 49.17657 -125.43151
3 45.23644 -115.81455

3
extent_wi.csv Normal file
View File

@ -0,0 +1,3 @@
latitude,longitude
47.73208,-93.55154
41.49273,-86.64896
1 latitude longitude
2 47.73208 -93.55154
3 41.49273 -86.64896