nhd_plus_load: Load NHDplus layers into current session

Description Usage Arguments Details Value Examples

View source: R/load.R

Description

Load NHDplus layers into current session

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
nhd_plus_load(
  vpu,
  component = "NHDSnapshot",
  dsn,
  file_ext = NA,
  approve_all_dl = FALSE,
  force_dl = FALSE,
  pretty = FALSE,
  wkt_filter = NA,
  ...
)

Arguments

vpu

numeric vector processing unit

component

character component name

dsn

data source name

file_ext

character choice of "shp" for spatial data and "dbf" for non-spatial. optional

approve_all_dl

logical blanket approval to download all missing data. Defaults to TRUE if session is non-interactive

force_dl

logical force a re-download of the requested data

pretty

more minimal pretty printing st_read relative to "quiet"

wkt_filter

character. WKT spatial filter for selection. See sf::st_read

...

parameters passed on to sf::st_read

Details

This function will ask the user to approve downloading missing data unless approve_all_dl is set to TRUE. Output of this function is saved in active memory (memoized) to speed up repeated function calls.

Value

spatial object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# Spatial
dt <- nhd_plus_load(4, "NHDSnapshot", "NHDWaterbody")
dt <- nhd_plus_load(c(1,2), "NHDSnapshot", "NHDWaterbody")
dt <- nhd_plus_load(4, "NHDSnapshot", "NHDFlowline")
dt <- nhd_plus_load(4, "NHDPlusCatchment", "Catchment")

# Quieter printing
dt <- nhd_plus_load(4, "NHDSnapshot", "NHDWaterbody", pretty = TRUE)
# Quietest printing
dt <- nhd_plus_load(4, "NHDSnapshot", "NHDWaterbody", quiet = TRUE)

# Non-spatial
dt <- nhd_plus_load(1, "NHDPlusAttributes", "PlusFlow")
dt <- nhd_plus_load("National", "V1_To_V2_Crosswalk",
 "NHDPlusV1Network_V2Network_Crosswalk")
gridcode      <- nhd_plus_load(1, "NHDPlusCatchment", "featuregridcode")
flowline_vaa  <- nhd_plus_load(1, "NHDPlusAttributes", "PlusFlowlineVAA")
eromflow      <- nhd_plus_load(4, "EROMExtension", "EROM_010001")

# Character VPU
plusflow <- nhd_plus_load(vpu = "10L", "NHDPlusAttributes", "PlusFlow")

# Spatial filtering via wkt_filter
dt <- nhd_plus_load(4, "NHDSnapshot", "NHDWaterbody", wkt_filter = "POINT (-85.411 42.399)")


## End(Not run)

nhdR documentation built on July 17, 2021, 5:06 p.m.