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

Fixed RC issues, added conversion factor for sq mi to sq km

parent d7df188a
No related branches found
No related tags found
1 merge request!182Bock
...@@ -44,7 +44,6 @@ nhd <- read_sf(data_paths$ref_fl) ...@@ -44,7 +44,6 @@ nhd <- read_sf(data_paths$ref_fl)
if(file.exists("cache/dropped_gages.csv")){ if(file.exists("cache/dropped_gages.csv")){
file.remove("cache/dropped_gages.csv") file.remove("cache/dropped_gages.csv")
} }
# gages II # gages II
gages_ii <- read_sf(data_paths$gagesii_lyr) gages_ii <- read_sf(data_paths$gagesii_lyr)
ref_gages <- read_sf("data/nldi/usgs_nldi_gages.geojson") ref_gages <- read_sf("data/nldi/usgs_nldi_gages.geojson")
...@@ -124,7 +123,7 @@ if(!file.exists("temp/GagestoCheck_GAGESIII.csv")){ ...@@ -124,7 +123,7 @@ if(!file.exists("temp/GagestoCheck_GAGESIII.csv")){
# Subset further by streamgages below the minimum drainage area critera # Subset further by streamgages below the minimum drainage area critera
gagesIII_db_fin <- gagesIII_db %>% gagesIII_db_fin <- gagesIII_db %>%
filter(!site_no %in% potCanalsIII$site_no, drain_area > min_da_km_gages) filter(!site_no %in% potCanalsIII$site_no, drain_area > (min_da_km_gages * sqkm_sqmi))
# Write out gages that dropped to document. # Write out gages that dropped to document.
gage_document(select(potCanalsIII, site_no), "GAGES-III", "ST; Pot. Canal") gage_document(select(potCanalsIII, site_no), "GAGES-III", "ST; Pot. Canal")
...@@ -176,7 +175,7 @@ gageloc_sf_full <- read_sf(data_paths$nhdplus_gdb, "Gage") %>% ...@@ -176,7 +175,7 @@ gageloc_sf_full <- read_sf(data_paths$nhdplus_gdb, "Gage") %>%
filter(!site_no %in% gagesIII_sf_full$site_no) %>% filter(!site_no %in% gagesIII_sf_full$site_no) %>%
# Update index information with NLDI gages # Update index information with NLDI gages
left_join(select(st_drop_geometry(ref_gages), site_no = id, left_join(select(st_drop_geometry(ref_gages), site_no = id,
comid = nhdpv2_COMID, reachcode = nhdpv2_COMID, comid = nhdpv2_COMID, reachcode = nhdpv2_REACHCODE,
reach_meas = nhdpv2_REACH_measure ), by = "site_no") reach_meas = nhdpv2_REACH_measure ), by = "site_no")
# Subset to locations with streamflow # Subset to locations with streamflow
...@@ -224,7 +223,8 @@ if(!file.exists("temp/GagestoCheck_GageLoc.csv")){ ...@@ -224,7 +223,8 @@ if(!file.exists("temp/GagestoCheck_GageLoc.csv")){
} }
gageloc_db_fin <- gageloc_db %>% gageloc_db_fin <- gageloc_db %>%
filter(!site_no %in% potCanals_gageloc$site_no, drain_area > min_da_km_gages) filter(!site_no %in% potCanals_gageloc$site_no, drain_area >
(min_da_km_gages * sqkm_sqmi))
# Gages that are ST site types, but reside on canals, artificial waterbodies. # Gages that are ST site types, but reside on canals, artificial waterbodies.
gage_document(select(potCanals_gageloc, site_no), "GageLoc", "ST; Pot. Canal") gage_document(select(potCanals_gageloc, site_no), "GageLoc", "ST; Pot. Canal")
......
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