View source: R/refactor_nhdplus.R
refactor_nhdplus | R Documentation |
A complete network refactor workflow has been packaged into this function. Builds a set of normalized catchment-flowpaths from input flowline features. See details and vignettes for more information.
refactor_nhdplus(
nhdplus_flines,
split_flines_meters,
split_flines_cores,
collapse_flines_meters,
collapse_flines_main_meters,
out_refactored,
out_reconciled,
three_pass = FALSE,
purge_non_dendritic = TRUE,
exclude_cats = NULL,
events = NULL,
warn = TRUE
)
nhdplus_flines |
data.frame raw nhdplus flowline features as derived from the national seamless geodatabase. |
split_flines_meters |
numeric the maximum length flowpath desired in the output. |
split_flines_cores |
numeric the number of processing cores to use while splitting flowlines. |
collapse_flines_meters |
numeric the minimum length of inter-confluence flowpath desired in the output. |
collapse_flines_main_meters |
numeric the minimum length of between-confluence flowpaths. |
out_refactored |
character where to write a geopackage containing the split and collapsed flowlines. |
out_reconciled |
character where to write a geopackage containing the reconciled flowpaths. |
three_pass |
boolean whether to perform a three pass collapse or single pass. |
purge_non_dendritic |
boolean passed on to prepare_nhdplus |
exclude_cats |
integer vector of COMIDs to be excluded from collapse modifications. |
events |
data.frame containing events as generated by nhdplusTools::get_flowline_index() |
warn |
boolean controls whether warning an status messages are printed |
This is a convenient wrapper function that implements three phases
of the network refactor workflow: split, collapse, reconcile. See the
NHDPlus Refactor vignette for details of these three steps by running:
vignette("refactor_nhdplus", package = "hyRefactor")
In addition to 'prepare_nhdplus' from the nhdplusTools package, The following three functions are used in the 'refactor_nhdplus' workflow.
split_flowlines
collapse_flowlines
reconcile_collapsed_flowlines
source(system.file("extdata",
"sample_flines.R",
package = "nhdplusTools"))
nhdplus_flowlines <- sf::st_zm(sample_flines)
refactor_nhdplus(nhdplus_flines = nhdplus_flowlines,
split_flines_meters = 2000,
split_flines_cores = 2,
collapse_flines_meters = 500,
collapse_flines_main_meters = 500,
out_refactored = "temp.gpkg",
out_reconciled = "temp_rec.gpkg",
three_pass = TRUE,
purge_non_dendritic = FALSE,
warn = FALSE)
unlink("temp.gpkg")
unlink("temp_rec.gpkg")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.