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

Removed hard-coded file reference

parent e4b68c56
No related branches found
No related tags found
1 merge request!19Bock
......@@ -131,7 +131,7 @@ Merge_hydReg <- function(feat){
}
}
siteAtt <- function(hydReg){
siteAtt <- function(out_gpkg, hydReg){
data_paths <- jsonlite::read_json(file.path("cache", "data_paths.json"))
......@@ -187,8 +187,8 @@ siteAtt <- function(hydReg){
#************************************************************************
# Read in TE shapefile
TE_fac <- st_read(paste0(data_paths$TE_points_path, "/2015_TE_Model_Estimates_lat.long_COMIDs.shp")) %>%
filter(COMID %in% TE_POIs$COMID)
TE_fac <- st_read(file.path(data_paths$TE_points_path, "/2015_TE_Model_Estimates_lat.long_COMIDs.shp")) %>%
filter(COMID %in% TE_pois$COMID)
# Cast TE as points and project to USGS albers
TE_fac_alb <- TE_fac %>% st_cast('POINT') %>% st_transform(., 6703)
......@@ -230,8 +230,8 @@ siteAtt <- function(hydReg){
if (file.exists("data/TE_points/TE_adj.rds")){
# open file and bind to it
curRDS_TE <- readRDS("data/TE_points/TE_adj.rds") #%>% filter(VPU != hydReg) %>%
bind_rows(TE_data_final)
curRDS_TE <- readRDS("data/TE_points/TE_adj.rds") %>% filter(VPU != hydReg) %>%
bind_rows(TE_data_final)
saveRDS(curRDS_TE, "data/TE_points/TE_adj.rds")
} else {
saveRDS(TE_data_final, "data/TE_points/TE_adj.rds")
......@@ -240,10 +240,10 @@ siteAtt <- function(hydReg){
#************************************************************************
# Read in NID shapefile
NID_fac <- read.csv(paste0(data_paths$NID_points_path,"/NID_attributes_20170612.txt"), stringsAsFactors = F) %>%
filter(FlowLcomid %in% NID_POIs$COMID)
NID_fac <- read.csv(file.path(data_paths$NID_points_path,"/NID_attributes_20170612.txt"), stringsAsFactors = F) %>%
filter(FlowLcomid %in% NID_pois$COMID)
NID_snap_alb <- readRDS("D:/NHM_FY20/gfv2.0/workspace/data/NID_points/NAWQA_NID_snap.rds") %>%
NID_snap_alb <- readRDS(file.path(data_paths$NID_points_path,"/NAWQA_NID_snap.rds")) %>%
filter(Source_FeatureID %in% NID_fac$Source_FeatureID) %>% st_transform(., 6703) %>%
inner_join(NID_fac, by = "Source_FeatureID")
......
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