# \donttest{
options("rgdal_show_exportToProj4_warnings"="none")
# Beware plot_nhdplus caches data to the default location.
# If you do not want data in "user space" change the default.
old_dir <- nhdplusTools::nhdplusTools_data_dir()
nhdplusTools_data_dir(tempdir())
plot_nhdplus("05428500")
plot_nhdplus("05428500", streamorder = 2)
plot_nhdplus(list(13293970, 13293750))
source(system.file("extdata/sample_data.R", package = "nhdplusTools"))
plot_nhdplus(list(13293970, 13293750), streamorder = 3, nhdplus_data = sample_data)
plot_nhdplus(list(list("comid", "13293970"),
list("nwissite", "USGS-05428500"),
list("huc12pp", "070900020603"),
list("huc12pp", "070900020602")),
streamorder = 2,
nhdplus_data = sample_data)
plot_nhdplus(sf::st_as_sf(data.frame(x = -89.36083,
y = 43.08944),
coords = c("x", "y"), crs = 4326),
streamorder = 2,
nhdplus_data = sample_data)
plot_nhdplus(list(list("comid", "13293970"),
list("nwissite", "USGS-05428500"),
list("huc12pp", "070900020603"),
list("huc12pp", "070900020602")),
streamorder = 2,
nhdplus_data = sample_data,
plot_config = list(basin = list(lwd = 2),
outlets = list(huc12pp = list(cex = 1.5),
comid = list(col = "green"))))
bbox <- sf::st_bbox(c(xmin = -89.43, ymin = 43, xmax = -89.28, ymax = 43.1),
crs = "+proj=longlat +datum=WGS84 +no_defs")
fline <- sf::read_sf(sample_data, "NHDFlowline_Network")
comids <- nhdplusTools::get_UT(fline, 13293970)
plot_nhdplus(comids)
#' # With Local Data
plot_nhdplus(bbox = bbox, nhdplus_data = sample_data)
# With downloaded data
plot_nhdplus(bbox = bbox, streamorder = 3)
# Can also plot on top of the previous!
plot_nhdplus(bbox = bbox, nhdplus_data = sample_data,
plot_config = list(flowline = list(lwd = 0.5)))
plot_nhdplus(comids, nhdplus_data = sample_data, streamorder = 3, add = TRUE,
plot_config = list(flowline = list(col = "darkblue")))
nhdplusTools::nhdplusTools_data_dir(old_dir)
# }
Run the code above in your browser using DataLab