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
be8bfc1e
Commit
be8bfc1e
authored
3 years ago
by
Bock, Andy
Browse files
Options
Downloads
Patches
Plain Diff
Changed field name from 'HUC_12.1' to 'HUC_12_int'
parent
eac9c02b
No related branches found
No related tags found
1 merge request
!107
Non-dendritic work and outlet mapping, SWIM in get data
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
workspace/R/utils.R
+7
-5
7 additions, 5 deletions
workspace/R/utils.R
with
7 additions
and
5 deletions
workspace/R/utils.R
+
7
−
5
View file @
be8bfc1e
...
@@ -88,12 +88,12 @@ fix_headwaters <- function(nhd_rds, out_rds, new_atts = NULL,
...
@@ -88,12 +88,12 @@ fix_headwaters <- function(nhd_rds, out_rds, new_atts = NULL,
#' @param sbitem (character) ScienceBase item ID
#' @param sbitem (character) ScienceBase item ID
#' @param out_dir (directory) directory where files are downloaded
#' @param out_dir (directory) directory where files are downloaded
#'
#'
# Retrieve files from SB if files
in facet-organization
# Retrieve files from SB if files
not listed under sbtools
facet
_sb
<-
function
(
sbitem
,
out_dir
){
retrieve
_sb
<-
function
(
sbitem
,
out_dir
){
item
<-
item_get
(
sbitem
)
item
<-
item_get
(
sbitem
)
facet
_files
<-
linked
_files
<-
lapply
(
item
$
facets
,
function
(
x
)
lapply
(
item
$
facets
,
function
(
x
)
{
{
list
(
name
=
x
$
name
,
list
(
name
=
x
$
name
,
...
@@ -263,12 +263,14 @@ get_HUC12_Xwalk <- function(VPU, full_cats = FALSE, divides = FALSE, wbd = FALSE
...
@@ -263,12 +263,14 @@ get_HUC12_Xwalk <- function(VPU, full_cats = FALSE, divides = FALSE, wbd = FALSE
cats_HUC12
<-
sf
::
st_intersection
(
reg_cats
,
HUC12_lyr
)
%>%
cats_HUC12
<-
sf
::
st_intersection
(
reg_cats
,
HUC12_lyr
)
%>%
# Convert area to squaker kilometers
# Convert area to squaker kilometers
mutate
(
intArea
=
as.numeric
(
st_area
(
.
))
*
0.000001
,
mutate
(
intArea
=
as.numeric
(
st_area
(
.
))
*
0.000001
,
AreaHUC12
=
ACRES
*
.00404686
)
AreaHUC12
=
ACRES
*
.00404686
)
%>%
rename
(
HUC_12_int
=
HUC_12.1
)
divides_HUC12
<-
sf
::
st_intersection
(
divides
,
HUC12_lyr
)
%>%
divides_HUC12
<-
sf
::
st_intersection
(
divides
,
HUC12_lyr
)
%>%
# Convert area to squaker kilometers
# Convert area to squaker kilometers
mutate
(
intArea
=
as.numeric
(
st_area
(
.
))
*
0.000001
,
mutate
(
intArea
=
as.numeric
(
st_area
(
.
))
*
0.000001
,
AreaHUC12
=
ACRES
*
.00404686
)
AreaHUC12
=
ACRES
*
.00404686
)
%>%
rename
(
HUC_12_int
=
HUC_12.1
)
return
(
list
(
cats_HUC12
=
cats_HUC12
,
divides_HUC12
=
divides_HUC12
))
return
(
list
(
cats_HUC12
=
cats_HUC12
,
divides_HUC12
=
divides_HUC12
))
...
...
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