Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
reference-hydrofabric
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Water Mission Area
nhgf
reference-hydrofabric
Commits
1471f583
Commit
1471f583
authored
5 years ago
by
Bock, Andy
Browse files
Options
Downloads
Patches
Plain Diff
Removed hard-coded file reference
parent
e4b68c56
No related branches found
No related tags found
1 merge request
!19
Bock
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
workspace/R/utils.R
+8
-8
8 additions, 8 deletions
workspace/R/utils.R
with
8 additions
and
8 deletions
workspace/R/utils.R
+
8
−
8
View file @
1471f583
...
...
@@ -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_
POI
s
$
COMID
)
TE_fac
<-
st_read
(
file.path
(
data_paths
$
TE_points_path
,
"/2015_TE_Model_Estimates_lat.long_COMIDs.shp"
))
%>%
filter
(
COMID
%in%
TE_
poi
s
$
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_
POI
s
$
COMID
)
NID_fac
<-
read.csv
(
file.path
(
data_paths
$
NID_points_path
,
"/NID_attributes_20170612.txt"
),
stringsAsFactors
=
F
)
%>%
filter
(
FlowLcomid
%in%
NID_
poi
s
$
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"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment