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
5606af4d
Commit
5606af4d
authored
1 year ago
by
Bock, Andy
Browse files
Options
Downloads
Patches
Plain Diff
MR cleanup, vpu/VPU to vpu_codes
parent
e42149ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!169
Updates through 07_merge
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
workspace/R/config.R
+23
-26
23 additions, 26 deletions
workspace/R/config.R
with
23 additions
and
26 deletions
workspace/R/config.R
+
23
−
26
View file @
5606af4d
...
...
@@ -13,26 +13,23 @@ rpu_vpu_out <- readr::read_csv("cache/rpu_vpu_out.csv",
col_types
=
c
(
"c"
,
"c"
,
"i"
,
"i"
),
show_col_types
=
FALSE
)
if
(
nchar
(
Sys.getenv
(
"HYDREG"
))
>
1
)
{
VPU
<-
Sys.getenv
(
"HYDREG"
)
vpu_codes
<-
Sys.getenv
(
"HYDREG"
)
}
if
(
!
exists
(
"rpu_code"
))
{
if
(
exists
(
"VPU"
))
{
vpu
<-
VPU
rpu_codes
<-
rpu_vpu
[
rpu_vpu
$
vpuid
%in%
vpu
,
]
if
(
exists
(
"vpu_codes"
))
{
rpu_codes
<-
rpu_vpu
[
rpu_vpu
$
vpuid
%in%
vpu_codes
,
]
rpu_code
<-
rpu_codes
$
rpuid
[
1
]
}
else
{
vpu
<-
get_rpu_dependent_vars
()
rpu_code
<-
vpu
$
r
vpu
<-
vpu
$
v
rpu_codes
<-
rpu_vpu
[
rpu_vpu
$
vpuid
%in%
vpu
,
]
vpu_codes
<-
VPU
<-
vpu
vpu_codes
<-
get_rpu_dependent_vars
()
rpu_code
<-
vpu_codes
$
r
vpu_codes
<-
vpu_codes
$
v
rpu_codes
<-
rpu_vpu
[
rpu_vpu
$
vpuid
%in%
vpu_codes
,
]
}
}
if
(
!
exists
(
"vpu"
))
{
vpu
<-
get_rpu_dependent_vars
(
rpu_code
)
$
v
vpu_codes
<-
VPU
<-
vpu
if
(
!
exists
(
"vpu_codes"
))
{
vpu_codes
<-
get_rpu_dependent_vars
(
rpu_code
)
$
v
}
if
(
!
nchar
(
out_agg_gpkg
<-
Sys.getenv
(
"OUT_GPKG"
))
>
5
)
...
...
@@ -48,7 +45,7 @@ if(!nchar(lookup_table_file <- Sys.getenv("LOOKUP_TABLE")) > 5)
lookup_table_file
<-
file.path
(
"cache"
,
paste0
(
rpu_code
,
"_lookup.csv"
))
if
(
!
nchar
(
vpu_lookup_table_file
<-
Sys.getenv
(
"VPU_LOOKUP_TABLE"
))
>
5
)
vpu_lookup_table_file
<-
file.path
(
"cache"
,
paste0
(
"lookup_"
,
vpu
,
".csv"
))
vpu_lookup_table_file
<-
file.path
(
"cache"
,
paste0
(
"lookup_"
,
vpu
_codes
,
".csv"
))
options
(
scipen
=
9999
)
...
...
@@ -89,13 +86,13 @@ poi_dar_move <- .05 # maximum proportional drainage area difference to collapse
# Intermediate layers created during 02_Navigate
xwalk_layer
<-
paste0
(
"HUC12_nhd"
)
# HUC12 - nhdcat crosswalk, built in Nav for VPU 20
nav_poi_layer
<-
paste0
(
"POIs_tmp_"
,
vpu
)
# Rolling Nav POI layer added to/modified througout nav workflow
WBs_layer
<-
paste0
(
"WB_"
,
vpu
)
# Waterbodies within VPU
WB_events_layer
<-
paste0
(
"WB_events_"
,
vpu
)
# inlet and outlet events for NHDArea and HR waterbodies
poi_moved_layer
<-
paste0
(
"POIs_mv_"
,
vpu
)
# POIs moved from original COMID assignment
nsegments_layer
<-
paste0
(
"nsegment_"
,
vpu
)
# Minimally-sufficient network dissolved by POI_ID
pois_all_layer
<-
paste0
(
"POIs_"
,
vpu
)
# All POIs binded together
poi_xwalk_layer
<-
paste0
(
"poi_xwalk_layer_"
,
vpu
)
# POIs that changed COMIDS during the navigate part of the workflow
nav_poi_layer
<-
paste0
(
"POIs_tmp_"
,
vpu
_codes
)
# Rolling Nav POI layer added to/modified througout nav workflow
WBs_layer
<-
paste0
(
"WB_"
,
vpu
_codes
)
# Waterbodies within VPU
WB_events_layer
<-
paste0
(
"WB_events_"
,
vpu
_codes
)
# inlet and outlet events for NHDArea and HR waterbodies
poi_moved_layer
<-
paste0
(
"POIs_mv_"
,
vpu
_codes
)
# POIs moved from original COMID assignment
nsegments_layer
<-
paste0
(
"nsegment_"
,
vpu
_codes
)
# Minimally-sufficient network dissolved by POI_ID
pois_all_layer
<-
paste0
(
"POIs_"
,
vpu
_codes
)
# All POIs binded together
poi_xwalk_layer
<-
paste0
(
"poi_xwalk_layer_"
,
vpu
_codes
)
# POIs that changed COMIDS during the navigate part of the workflow
final_poi_layer
<-
"POIs"
dup_pois
<-
"dup_POIs"
...
...
@@ -135,13 +132,13 @@ catchment_network_table <- "catchment_network"
CAC_thresh
<-
0.66
# Coefficient of areal correspondence threshold
# output geopackage file names
ref_gpkg
<-
file.path
(
data_paths
$
ref_fab_
directory
,
paste0
(
vpu
,
"_reference_features.gpkg"
))
nav_gpkg
<-
file.path
(
"cache"
,
paste0
(
"reference_"
,
vpu
,
".gpkg"
))
temp_gpkg
<-
file.path
(
"cache"
,
paste0
(
"nav_"
,
vpu
,
".gpkg"
))
ref_gpkg
<-
file.path
(
data_paths
$
ref_fab_
path
,
paste0
(
vpu
_codes
,
"_reference_features.gpkg"
))
nav_gpkg
<-
file.path
(
"cache"
,
paste0
(
"reference_"
,
vpu
_codes
,
".gpkg"
))
temp_gpkg
<-
file.path
(
"cache"
,
paste0
(
"nav_"
,
vpu
_codes
,
".gpkg"
))
rfc_gpkg
<-
file.path
(
"cache"
,
paste0
(
"refactor_"
,
vpu
,
".gpkg"
))
rfc_gpkg
<-
file.path
(
"cache"
,
paste0
(
"refactor_"
,
vpu
_codes
,
".gpkg"
))
gf_gpkg
<-
file.path
(
"cache"
,
paste0
(
"GF_"
,
vpu
,
".gpkg"
))
gf_gpkg
<-
file.path
(
"cache"
,
paste0
(
"GF_"
,
vpu
_codes
,
".gpkg"
))
gf_gpkg_conus
<-
"cache/reference_CONUS.gpkg"
gage_info_gpkg
<-
"cache/Gages_info.gpkg"
...
...
@@ -149,7 +146,7 @@ gage_info_csv <- "cache/Gages_info.csv"
gage_info_csvt
<-
"cache/Gages_info.csvt"
# Defined during NonDend.Rmd
ND_gpkg
<-
file.path
(
"temp"
,
paste0
(
"ND_"
,
vpu
,
".gpkg"
))
ND_gpkg
<-
file.path
(
"temp"
,
paste0
(
"ND_"
,
vpu
_codes
,
".gpkg"
))
divides_xwalk
<-
"divides_nhd"
HRU_layer
<-
"all_cats"
...
...
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