Breaks down the national geo database into a collection of quick to access R binary files.

stage_national_data(
  include = c("attribute", "flowline", "catchment"),
  output_path = NULL,
  nhdplus_data = NULL,
  simplified = TRUE
)

Arguments

include

character vector containing one or more of: "attributes", "flowline", "catchment".

output_path

character path to save the output to defaults to the directory of the nhdplus_data.

nhdplus_data

character path to the .gpkg or .gdb containing the national seamless dataset. Not required if nhdplus_path has been set.

simplified

boolean if TRUE (the default) the CatchmentSP layer will be included.

Value

list containing paths to the .rds files.

Details

"attributes" will save `NHDFlowline_Network` attributes as a separate data.frame without the geometry. The others will save the `NHDFlowline_Network` and `Catchment` or `CatchmentSP` (per the `simplified` parameter) as sf data.frames with superfluous Z information dropped.

The returned list of paths is also added to the nhdplusTools_env as "national_data".

Examples


source(system.file("extdata/sample_data.R", package = "nhdplusTools"))

stage_national_data(nhdplus_data = sample_data, output_path = tempdir())
#> $attributes
#> [1] "C:\\Users\\DBLODG~2\\AppData\\Local\\Temp\\1\\RtmpSehW27/nhdplus_flowline_attributes.rds"
#> 
#> $flowline
#> [1] "C:\\Users\\DBLODG~2\\AppData\\Local\\Temp\\1\\RtmpSehW27/nhdplus_flowline.rds"
#> 
#> $catchment
#> [1] "C:\\Users\\DBLODG~2\\AppData\\Local\\Temp\\1\\RtmpSehW27/nhdplus_catchment.rds"
#>