Skip to content
Snippets Groups Projects
Commit 038928ef authored by Bock, Andy's avatar Bock, Andy
Browse files

VPU/vpu to vpu_codes

parent 36c90e71
No related branches found
No related tags found
1 merge request!169Updates through 07_merge
...@@ -18,7 +18,7 @@ library(readxl) ...@@ -18,7 +18,7 @@ library(readxl)
library(rgdal) library(rgdal)
# Numeric code for HI VPU # Numeric code for HI VPU
vpu <- "20" vpu_code <- "20"
# directory of data # directory of data
data_dir <- "data" data_dir <- "data"
...@@ -39,7 +39,7 @@ if(needs_layer(data_paths$hi_source, nhd_flowline)) { ...@@ -39,7 +39,7 @@ if(needs_layer(data_paths$hi_source, nhd_flowline)) {
# subset by VPU # subset by VPU
nhd <- readRDS(file.path(data_paths$islands_dir, "NHDPlusNationalData", "nhdplus_flowline.rds")) %>% nhd <- readRDS(file.path(data_paths$islands_dir, "NHDPlusNationalData", "nhdplus_flowline.rds")) %>%
filter(VPUID == vpu) %>% filter(VPUID == vpu_code) %>%
# transform to UTM Zone 4N # transform to UTM Zone 4N
st_transform(crs) st_transform(crs)
...@@ -60,7 +60,7 @@ if(needs_layer(data_paths$hi_source, raw_wbd)) { ...@@ -60,7 +60,7 @@ if(needs_layer(data_paths$hi_source, raw_wbd)) {
# Use HUC12 layer in the HI_PR GDB # Use HUC12 layer in the HI_PR GDB
huc12 <- read_sf(data_paths$islands_gdb, layer = "HUC12") %>% huc12 <- read_sf(data_paths$islands_gdb, layer = "HUC12") %>%
filter(grepl(paste0("^", vpu, ".*"), .data$HUC_12)) %>% filter(grepl(paste0("^", vpu_code, ".*"), .data$HUC_12)) %>%
st_transform(., crs = st_crs(nhd)) st_transform(., crs = st_crs(nhd))
# write to gpkg # write to gpkg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment