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

fixes #74

parent 5d9b32e0
No related branches found
No related tags found
1 merge request!134csv to gz
......@@ -49,10 +49,6 @@ RNetCDF::close.nc(nwm_nc)
nhd_net <- nhdplusTools::get_vaa()
degen_networks <- nhd_net[nhd_net$totdasqkm == 0 & nhd_net$terminalfl == 1, ]$terminalpa
nhd_net <- filter(nhd_net, !terminalpa %in% degen_networks)
names(nhd_net) <- tolower(names(nhd_net))
names(enhd) <- tolower(names(enhd))
......
......@@ -44,6 +44,18 @@ fline <- sf::st_cast(fline, "LINESTRING")
catchment <- sf::read_sf(file.path(data_paths$nhdplus_dir, "reference_catchments.gpkg"))
# we can remove truely degenerate COMIDs
# for 0 upstream area and no catchment area
degen_comid <- fline[fline$TotDASqKM == 0 &
!fline$COMID %in% catchment$featureid, ]$COMID
# need to make sure we don't disconnect anything.
keep_tocomid <- fline$toCOMID[!fline$COMID %in% degen_comid]
if(length(degen_comid[degen_comid %in% keep_tocomid]) > 0) stop("this will break the network")
fline <- fline[!fline$COMID %in% degen_comid, ]
for(VPU in vpu_codes) {
rm(rpu_code)
......
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