changed spacing/formatting of scripts

This commit is contained in:
Ben Varick 2023-10-16 16:59:19 -05:00
parent 85998c5c12
commit f755308d14
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
2 changed files with 13 additions and 14 deletions

View File

@ -30,7 +30,6 @@ extent <- list(longitude_max = max(extent$longitude),
latitude_max = max(extent$latitude), latitude_max = max(extent$latitude),
latitude_min = min(extent$latitude)) latitude_min = min(extent$latitude))
# get watershed areas # get watershed areas
extent_huc <- get_huc(AOI = extent_poly, buffer = 0, type = "huc04") extent_huc <- get_huc(AOI = extent_poly, buffer = 0, type = "huc04")

View File

@ -10,11 +10,11 @@ extent <- read.csv(file = "extent.csv")
crs <- 4269 crs <- 4269
extent_poly <- st_polygon( extent_poly <- st_polygon(
x = list( x = list(
cbind( cbind(
extent$longitude[c(1,2,2,1,1)], extent$longitude[c(1,2,2,1,1)],
extent$latitude[c(1,1,2,2,1)]) extent$latitude[c(1,1,2,2,1)])
) )
) )
extent_poly <- st_sfc(extent_poly, crs=4326) extent_poly <- st_sfc(extent_poly, crs=4326)
@ -32,12 +32,12 @@ layers <- c("NHDArea",
"NHDWaterbody", "NHDWaterbody",
"NHDPlusLandSea") "NHDPlusLandSea")
for (layer in layers){ for (layer in layers){
data[[layer]] <- st_crop(st_read(paste0(nhdplusTools_data_dir(),"/data.gpkg"), layer = layer), y = extent_bbox) data[[layer]] <- st_crop(st_read(paste0(nhdplusTools_data_dir(),"/data.gpkg"), layer = layer), y = extent_bbox)
} }
# load political boundaries # load political boundaries
political <- list(NULL) political <- list(NULL)
political_boundaries <- list.files(path = paste0(data_dir, "/political_boundaries")) political_boundaries <- list.files(path = paste0(data_dir, "/political_boundaries"))
for (boundary in political_boundaries) { for (boundary in political_boundaries) {
political[[boundary]] <- st_read(paste0(data_dir, "/political_boundaries/", boundary)) political[[boundary]] <- st_read(paste0(data_dir, "/political_boundaries/", boundary))
} }