Learn R Programming

nhdplusTools (version 0.3.8)

get_nhdplushr: Get NHDPlus HiRes as single geopackage

Description

Get NHDPlus HiRes as single geopackage

Usage

get_nhdplushr(hr_dir, out_gpkg = NULL, layers = c("NHDFlowline",
  "NHDPlusCatchment"), pattern = ".*GDB.gdb$")

Arguments

hr_dir

character directory with geodatabases (gdb search is recursive)

out_gpkg

character path to write output geopackage

layers

character vector with desired layers to return. c("NHDFlowline", "NHDPlusCatchment") is default. Choose from: c("NHDFlowline", "NHDPlusCatchment", "NHDWaterbody", "NHDArea", "NHDLine", "NHDPlusSink", "NHDPlusWall", "NHDPoint", "NHDPlusBurnWaterbody", "NHDPlusBurnLineEvent", "HYDRO_NET_Junctions", "WBDHU2", "WBDHU4","WBDHU6", "WBDHU8" "WBDHU10", "WBDHU12", "WBDLine")

pattern

character optional regex to select certain files in hr_dir

Details

NHDFlowline is joined to value added attributes prior to being returned. Names are not modified from the NHDPlusHR geodatabase. Set layers to "NULL" to get all layers.

Examples

Run this code
# NOT RUN {
# Note this will download a lot of data to a temp directory.
# Change 'tempdir()' to your directory of choice.
download_dir <- download_nhdplushr(tempdir(), c("0302", "0303"))
get_nhdplushr(download_dir, file.path(download_dir, "nhdplus_0302-03.gpkg"))
# }

Run the code above in your browser using DataLab