Skip to content
Snippets Groups Projects
Commit aecd38d2 authored by Blodgett, David L.'s avatar Blodgett, David L.
Browse files

incorporate new catchments

parent 695b4466
No related branches found
No related tags found
1 merge request!129updates to use new catchments
......@@ -39,7 +39,10 @@ out_rpu <- rep(list(list()), length(all_rpu_codes))
names(out_rpu) <- all_rpu_codes
fline <- sf::read_sf(data_paths$ref_flowline)
catchment <- readRDS(staged_nhd$catchment)
fline <- sf::st_cast(fline, "LINESTRING")
catchment <- sf::read_sf(file.path(data_paths$nhdplus_dir, "reference_catchments.gpkg"))
for(VPU in vpu_codes) {
......@@ -77,6 +80,10 @@ for(VPU in vpu_codes) {
filter(RPUID %in% rpu_codes$rpuid)
cats <- catchment %>%
rename(FEATUREID = featureid,
AREASQKM = areasqkm,
RPUID = rpuid,
VPUID = vpuid) %>%
filter(FEATUREID %in%
unique(c(nhd$COMID,
full_cat_table$FEATUREID[full_cat_table$RPUID %in% rpu_codes$rpuid]))) %>%
......
......@@ -36,9 +36,6 @@ Load and filter source NHD Flowline network.
cats <- read_sf(out_refac_gpkg, nhd_catchment)
```
Read POIs and add nhd outlets. Save to a non-spatial table.
```{r refactor}
POIs <- read_sf(nav_gpkg, final_poi_layer) %>%
......
......@@ -45,14 +45,6 @@ if(needs_layer(out_refac_gpkg, divide_layer)) {
distinct(.keep_all = T)
cats <- st_transform(read_sf(out_refac_gpkg, nhd_catchment), crs)
st_precision(cats) <- 30 # meters
cats <- sf::st_simplify(cats, dTolerance = 0) %>%
st_cast("MULTIPOLYGON")
cats <- nhdplusTools:::check_valid(cats)
# Write out catchments to use in 06_non_dend
write_sf(cats, out_refac_gpkg, nhd_catchment)
divides <- reconcile_catchment_divides(catchment = cats,
fline_ref = refactored,
......
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