diff --git a/DESCRIPTION b/DESCRIPTION index 1b6301e2..a0c93f19 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,7 +32,7 @@ Imports: hydroloom, dataRetrieval, dplyr, sf, units, magrittr, jsonlite, httr, x Suggests: testthat, knitr, rmarkdown, ggmap, ggplot2, lwgeom, gifski, leaflet, httptest, future, future.apply License: CC0 Encoding: UTF-8 -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 VignetteBuilder: knitr Config/testthat/parallel: true Config/testthat/edition: 3 diff --git a/R/A_nhdplusTools.R b/R/A_nhdplusTools.R index d1ad9cdb..1e47edf4 100644 --- a/R/A_nhdplusTools.R +++ b/R/A_nhdplusTools.R @@ -92,7 +92,7 @@ nhdplus_attributes <- list( assign("nhdplus_attributes", nhdplus_attributes, envir = nhdplusTools_env) -assign("geoserver_root", "https://labs.waterdata.usgs.gov/geoserver/", +assign("geoserver_root", "https://api.water.usgs.gov/geoserver/", envir = nhdplusTools_env) assign("arcrest_root", "https://hydro.nationalmap.gov/arcgis/rest/services/", @@ -276,10 +276,16 @@ nhdplus_debug <- function() { #' @noRd get_nldi_url <- function() { - tier <- get("nldi_tier", envir = nhdplusTools_env) + tier_env <- Sys.getenv("NLDI_TIER") + + tier <- if(tier_env != "") { + tier_env + } else { + get("nldi_tier", envir = nhdplusTools_env) + } if (tier == "prod") { - "https://labs.waterdata.usgs.gov/api/nldi" + "https://api.water.usgs.gov/nldi" } else if (tier == "test") { "https://labs-beta.waterdata.usgs.gov/api/nldi" } else { diff --git a/R/discover_nhdplus.R b/R/discover_nhdplus.R index 52d53c51..74c61c8c 100644 --- a/R/discover_nhdplus.R +++ b/R/discover_nhdplus.R @@ -35,8 +35,19 @@ discover_nhdplus_id <- function(point = NULL, nldi_feature = NULL, raindrop = FA coords = sf::st_coordinates(point) comid <- tryCatch({ - as.integer(dataRetrieval::findNLDI(location = c(X = coords[1], - Y = coords[2]))$origin$identifier) + + URL <- paste0(get("geoserver_root", envir = nhdplusTools_env), + "wmadata", + "/ows", + "?service=WFS&request=GetFeature&version=1.0.0", # axis order switched in 1.1.0 + "&typeName=catchmentsp&outputFormat=application/json", + "&CQL_FILTER=INTERSECTS(the_geom, POINT (", + coords[1], " ", coords[2], "))", + "&propertyName=featureid") + + d <- jsonlite::fromJSON(rawToChar(RETRY("GET", utils::URLencode(URL))$content)) + + as.integer(d$features$properties$featureid) }, error = function(e) NULL) diff --git a/R/geoserver_tools.R b/R/geoserver_tools.R index b2fbf685..74f48330 100644 --- a/R/geoserver_tools.R +++ b/R/geoserver_tools.R @@ -107,7 +107,7 @@ query_usgs_geoserver <- function(AOI = NULL, ids = NULL, version="1.1.0" outputFormat="application/json"', ' xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">', - ' - +
- +
@@ -122,16 +122,16 @@

Page not found (404)

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/DISCLAIMER.html b/docs/DISCLAIMER.html index 97546607..1c3ddcad 100644 --- a/docs/DISCLAIMER.html +++ b/docs/DISCLAIMER.html @@ -3,7 +3,7 @@ - +
- +
@@ -93,15 +93,15 @@

Disclaimer

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 0d73979a..5bd3c7db 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -3,7 +3,7 @@ - +
- +
@@ -110,15 +110,15 @@

NA

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/articles/get_3dhp_data.html b/docs/articles/get_3dhp_data.html index 60ca90ee..fa8d34da 100644 --- a/docs/articles/get_3dhp_data.html +++ b/docs/articles/get_3dhp_data.html @@ -18,15 +18,13 @@ - - - +
- +
@@ -147,14 +145,7 @@

pc <- function(x) sf::st_geometry(sf::st_transform(x, 3857)) plot_nhdplus(bbox = sf::st_bbox(flowline), plot_config = list(flowline = list(col = NULL)), zoom = 14) -#> Warning in par(old_par): graphical parameter "cin" cannot be set -#> Warning in par(old_par): graphical parameter "cra" cannot be set -#> Warning in par(old_par): graphical parameter "csi" cannot be set -#> Warning in par(old_par): graphical parameter "cxy" cannot be set -#> Warning in par(old_par): graphical parameter "din" cannot be set -#> Warning in par(old_par): graphical parameter "page" cannot be set

-
-  plot(pc(flowline), add = TRUE, col = "darkblue", lwd = 2)
+  plot(pc(flowline), add = TRUE, col = "darkblue", lwd = 2)
   plot(pc(point), pch = "O", add = TRUE)

Now, we can use dataRetrieval @@ -166,7 +157,7 @@

+
-
-  
+#> features found in area of interest.
+  
   down_mains <- get_3dhp(ids = dm, type = "flowline")
   
   old_par <- par(mar = c(0, 0, 0, 0))
   plot_nhdplus(bbox = sf::st_bbox(basin$basin), flowline_only = TRUE,
                plot_config = list(flowline = list(col = NULL)), zoom = 10)
-#> Warning in par(old_par): graphical parameter "cin" cannot be set
-#> Warning in par(old_par): graphical parameter "cra" cannot be set
-#> Warning in par(old_par): graphical parameter "csi" cannot be set
-#> Warning in par(old_par): graphical parameter "cxy" cannot be set
-#> Warning in par(old_par): graphical parameter "din" cannot be set
-#> Warning in par(old_par): graphical parameter "page" cannot be set
-
-  plot(pc(basin$basin), lwd = 2, add = TRUE)
+  plot(pc(basin$basin), lwd = 2, add = TRUE)
   plot(pc(network), lwd = 0.5, add = TRUE)
   plot(pc(water), lwd = 0.5, border = "skyblue", col = "lightblue", add = TRUE)
   plot(pc(hydrolocation), pch = "o", col = "#80808026", add = TRUE)
   plot(pc(down_mains), lwd = 3, col = "blue", add = TRUE)

-
+
   par(old_par)
 
   old_par <- par(mar = c(0, 0, 0, 0))
   plot(pc(down_mains))
   plot(pc(basin$basin), add = TRUE)

-
+
   par(old_par)

Neat. Now we have flowlines, waterbodies, hydrologic locations, a basin boundary, and major rivers downstream to work with. These could be @@ -216,7 +199,7 @@

+
-
-
+#> 2        <NA>       <NA> POINT (-89.43904 43.48568)
+
   mainstem_points <- get_3dhp(ids = hydrolocation$mainstemid, type = "reach code, external connection")
   mainstem_lines <- get_3dhp(ids = hydrolocation$mainstemid, type = "flowline")
 
@@ -247,24 +229,21 @@ 

plot(pc(hydrolocation), pch = "o", col = "#808080BF") plot(pc(mainstem_lines), lwd = 2, col = "blue", add = TRUE)

-
+
   par(old_par)
   
   old_par <- par(mar = c(0, 0, 0, 0))
   plot_nhdplus(bbox = sf::st_bbox(basin$basin), flowline_only = TRUE,
                plot_config = list(flowline = list(col = NULL)), zoom = 10)
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
 #> Zoom set to: 10
-#> Warning in par(old_par): graphical parameter "cin" cannot be set
-#> Warning in par(old_par): graphical parameter "cra" cannot be set
-#> Warning in par(old_par): graphical parameter "csi" cannot be set
-#> Warning in par(old_par): graphical parameter "cxy" cannot be set
-#> Warning in par(old_par): graphical parameter "din" cannot be set
-#> Warning in par(old_par): graphical parameter "page" cannot be set
-
-  plot(pc(mainstem_lines), lwd = 2, col = "blue", add = TRUE)
+  plot(pc(mainstem_lines), lwd = 2, col = "blue", add = TRUE)
   plot(pc(mainstem_points), pch = "o", col = "#808080BF", add = TRUE)

-
+
   par(old_par)

With this functionality, we have what we need to inter operate between older NHD data and newly released 3DHP data. This service is @@ -288,16 +267,16 @@

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-1-1.png index 8e71062d..56a2867c 100644 Binary files a/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-1-1.png and b/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-1-1.png differ diff --git a/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-2-1.png b/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-2-1.png index 7d180c1e..b9874cde 100644 Binary files a/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-2-1.png and b/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-2-1.png differ diff --git a/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-3-2.png b/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-3-2.png index 3fa3ef39..a10dd660 100644 Binary files a/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-3-2.png and b/docs/articles/get_3dhp_data_files/figure-html/unnamed-chunk-3-2.png differ diff --git a/docs/articles/get_data_overview_files/figure-html/unnamed-chunk-1-1.png b/docs/articles/get_data_overview_files/figure-html/unnamed-chunk-1-1.png index 38e0f1de..37cc782d 100644 Binary files a/docs/articles/get_data_overview_files/figure-html/unnamed-chunk-1-1.png and b/docs/articles/get_data_overview_files/figure-html/unnamed-chunk-1-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index 9b4c9e21..c6652b5e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -3,7 +3,7 @@ - +

- +
@@ -97,15 +97,15 @@

All vignettes

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/articles/nhdplusTools.html b/docs/articles/nhdplusTools.html index 4b0a7e21..d2963492 100644 --- a/docs/articles/nhdplusTools.html +++ b/docs/articles/nhdplusTools.html @@ -18,15 +18,13 @@ - - - +
- +
@@ -121,6 +119,7 @@

TL;DR library(nhdplusTools) library(sf) +#> Linking to GEOS 3.12.2, GDAL 3.9.3, PROJ 9.4.1; sf_use_s2() is TRUE start_point <- st_sfc(st_point(c(-89.362239, 43.090266)), crs = 4269) start_comid <- discover_nhdplus_id(start_point) @@ -144,9 +143,20 @@

TL;DR #> Reading CatchmentSP #> Spherical geometry (s2) switched off #> Spherical geometry (s2) switched on -#> Writing CatchmentSP

-
-
+#> Writing CatchmentSP
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
+
 flowline <- subset$NHDFlowline_Network
 catchment <- subset$CatchmentSP
 waterbody <- subset$NHDWaterbody
@@ -164,18 +174,16 @@ 

TL;DR

Or fetch NWIS an site as the starting point and generate a plot. Data is returned and/or stored in a local file for later use.

-
+
 # ?plot_nhdplus for more
 plot_data <- plot_nhdplus(
   outlets = list(featureSource = "nwissite", featureID = "USGS-05428500"), 
   gpkg = subset_file, overwrite = TRUE)
-#> Zoom set to: 11
-#> Warning in par(old_par): graphical parameter "cin" cannot be set
-#> Warning in par(old_par): graphical parameter "cra" cannot be set
-#> Warning in par(old_par): graphical parameter "csi" cannot be set
-#> Warning in par(old_par): graphical parameter "cxy" cannot be set
-#> Warning in par(old_par): graphical parameter "din" cannot be set
-#> Warning in par(old_par): graphical parameter "page" cannot be set
+#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on +#> Zoom set to: 11

This vignette covers a range of utilities the nhdplusTools package offers for working with data in a U.S. context.

@@ -189,7 +197,7 @@

TL;DR aware of. Once you have it downloaded and extracted, you can tell the nhdplusTools package where it is with the nhdplus_path() function.

-
+
 nhdplus_path(file.path(work_dir, "natseamless.gpkg"))
 
 basename(nhdplus_path())
@@ -199,7 +207,7 @@ 

TL;DR specific NHDPlus attributes with very little overhead. It also supports access to an updated set of network attributes that incorporate numerous network updates from national hydrologic modeling projects.

-
+
 vaa <- get_vaa()
 names(vaa)
 #>  [1] "comid"      "streamleve" "streamorde" "streamcalc" "fromnode"  
@@ -210,9 +218,8 @@ 

TL;DR #> [26] "lengthkm" "fcode" "vpuin" "vpuout" "areasqkm" #> [31] "totdasqkm" "divdasqkm" "totma" "wbareatype" "pathtimema" #> [36] "slope" "slopelenkm" "ftype" "gnis_name" "gnis_id" -#> [41] "wbareacomi" "hwnodesqkm" "rpuid" "vpuid" "roughness"

-
-nrow(vaa)
+#> [41] "wbareacomi" "hwnodesqkm" "rpuid"      "vpuid"      "roughness"
+nrow(vaa)
 #> [1] 2691339

NHDPlus HiRes @@ -229,13 +236,12 @@

NHDPlus HiRes
+
 download_nhdplushr(nhd_dir = "download_dir", 
                    hu_list = c("0101"), # can mix hu02 and hu04 codes.
                    download_files = FALSE) # TRUE will download files.
-#> [1] "https://prd-tnm.s3.amazonaws.com/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_0101_HU4_20220901_GDB.zip"
- -
-names(hr_data)
-#> [1] "NHDFlowline"      "NHDPlusCatchment"
- -
-names(hr_data)
+#> 7         NHDPoint      3D Point        7     10 GRS 1980(IUGG, 1980)
+names(hr_data)
 #> [1] "NHDFlowline"      "NHDPlusCatchment" "NHDWaterbody"     "NHDArea"         
 #> [5] "NHDLine"          "NHDPlusSink"      "NHDPoint"

@@ -291,7 +289,7 @@

Discovery and Subsettingdiscover_nhdplus_id() First, let’s look at a given point location. Then see where it is relative to our flowlines.

-
+
 lon <- -89.36
 lat <- 43.09
 
@@ -310,7 +308,7 @@ 

Discovery and Subsettingget_raindrop_trace() for more on this functionality.

-
+
-
-
+#> # ℹ 1 more variable: geometry <LINESTRING [°]>
+
 plot(sf::st_geometry(start_comid))
 plot(sf::st_geometry(flowline), add = TRUE, col = "blue", lwd = 2)
 plot(start_point, cex = 1.5, lwd = 2, col = "red", add = TRUE)
@@ -338,7 +335,7 @@

Web Service Data SubsettingNetwork Linked Data -Index (NLDI) and the National Water Census +Index (NLDI) and the Water Mission Area Geoserver. The code below shows how to use the NLDI functions to build a dataset upstream of our start_comid that we found above.

@@ -347,16 +344,15 @@

Web Service Data Subsetting
+
 dataRetrieval::get_nldi_sources()$source
 #>  [1] "ca_gages"          "census2020-nhdpv2" "epa_nrsa"         
 #>  [4] "geoconnex-demo"    "gfv11_pois"        "huc12pp"          
 #>  [7] "huc12pp_102020"    "nmwdi-st"          "npdes"            
 #> [10] "nwisgw"            "nwissite"          "ref_dams"         
 #> [13] "ref_gage"          "vigil"             "wade"             
-#> [16] "WQP"               "comid"
-
-
+#> [16] "WQP"               "comid"
+
 nldi_feature <- list(featureSource = "comid", 
                      featureID = as.integer(start_comid$comid)[1])
 
@@ -375,7 +371,7 @@ 

Web Service Data Subsetting
+
 flowline_nldi <- navigate_nldi(nldi_feature, 
                                mode = "upstreamTributaries", 
                                distance_km = 1000)
@@ -390,7 +386,7 @@ 

Web Service Data Subsettingnavigate_network() function that will replace navigate_nldi() and subset_nhdplus() for many use cases.

-
+
 output_file_download <- file.path(work_dir, "subset_download.gpkg")
 
 output_file_download <-subset_nhdplus(comids = as.integer(flowline_nldi$UT$nhdplus_comid),
@@ -399,16 +395,16 @@ 

Web Service Data Subsetting= TRUE) #> All intersections performed in latitude/longitude. #> Reading NHDFlowline_Network -#> Writing NHDFlowline_Network

-
-
+#> Spherical geometry (s2) switched off
+#> Spherical geometry (s2) switched on
+#> Writing NHDFlowline_Network
+
 sf::st_layers(output_file_download)
 #> Driver: GPKG 
 #> Available layers:
 #>            layer_name geometry_type features fields crs_name
-#> 1 NHDFlowline_Network   Line String      168    137    NAD83
-
-
+#> 1 NHDFlowline_Network   Line String      168    137    NAD83
+
 flowline_download <- sf::read_sf(file.path(work_dir, "subset_download.gpkg"), 
                                  "NHDFlowline_Network")
 
@@ -425,7 +421,7 @@ 

Web Service Data Subsetting
+
-
-
+#> Spherical geometry (s2) switched off
+#> Spherical geometry (s2) switched on
+#> Writing NHDFlowline_Network
+
 sf::st_layers(output_file_download)
 #> Driver: GPKG 
 #> Available layers:
 #>            layer_name geometry_type features fields crs_name
-#> 1 NHDFlowline_Network   Line String      168    137    NAD83
-
-
+#> 1 NHDFlowline_Network   Line String      168    137    NAD83
+
 flowline_nwis <- sf::read_sf(output_file_nwis, 
                                  "NHDFlowline_Network")
 
@@ -479,7 +475,7 @@ 

Local Data Subsetting -
+
 UT_comids <- get_UT(flowline, start_comid$comid[1])
 UT_comids
 #>   [1]  13293380  13293384  13293388  13293392  13293398  13293424  13293430
@@ -511,7 +507,7 @@ 

Local Data Subsettingfline sf data.frame and plot it with our other layers.

-
+
 plot(sf::st_geometry(flowline))
 plot(start_point, cex = 1.5, lwd = 2, col = "red", add = TRUE)
 plot(sf::st_geometry(dplyr::filter(flowline, comid %in% UT_comids)),
@@ -524,7 +520,7 @@ 

Local Data Subsetting -
+
 output_file <- file.path(work_dir, "subset.gpkg")
 
 output_file <-subset_nhdplus(comids = UT_comids,
@@ -547,9 +543,8 @@ 

Local Data Subsetting#> Reading Gage #> Writing Gage #> Reading Sink -#> No features to write in Sink

-
-
+#> No features to write in Sink
+
 sf::st_layers(output_file)
 #> Driver: GPKG 
 #> Available layers:
@@ -564,7 +559,7 @@ 

Local Data Subsetting -
+
 catchment <- sf::read_sf(output_file, "CatchmentSP")
 waterbody <- sf::read_sf(output_file, "NHDWaterbody")
 
@@ -586,14 +581,14 @@ 

IndexingUsing the data above, we can use the get_flowline_index() function to get the comid, reachcode, and measure of our starting point like this.

-
+
 get_flowline_index(flowline, start_point)
 #>   id    COMID      REACHCODE REACH_meas       offset
 #> 1  1 13293750 07090002007373       41.8 0.0009619865

get_flowline_index() will work with a list of points too. For demonstration purposes, we can use the gages in our subset from above.

-
+
 gage <- sf::read_sf(output_file, "Gage")
 
 get_flowline_index(flowline, sf::st_geometry(gage), precision = 10)
@@ -628,9 +623,7 @@ 

Indexing - -

+
@@ -643,16 +636,16 @@

Indexing

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/articles/nhdplusTools_files/figure-html/discover_nhdplus_id-1.png b/docs/articles/nhdplusTools_files/figure-html/discover_nhdplus_id-1.png index b859a3db..e84ad5bf 100644 Binary files a/docs/articles/nhdplusTools_files/figure-html/discover_nhdplus_id-1.png and b/docs/articles/nhdplusTools_files/figure-html/discover_nhdplus_id-1.png differ diff --git a/docs/articles/nhdplusTools_files/figure-html/nldi_nwissite-1.png b/docs/articles/nhdplusTools_files/figure-html/nldi_nwissite-1.png index 590cfed3..56e1eded 100644 Binary files a/docs/articles/nhdplusTools_files/figure-html/nldi_nwissite-1.png and b/docs/articles/nhdplusTools_files/figure-html/nldi_nwissite-1.png differ diff --git a/docs/articles/nhdplusTools_files/figure-html/tldr2-1.png b/docs/articles/nhdplusTools_files/figure-html/tldr2-1.png index 6536bb57..f85e0a65 100644 Binary files a/docs/articles/nhdplusTools_files/figure-html/tldr2-1.png and b/docs/articles/nhdplusTools_files/figure-html/tldr2-1.png differ diff --git a/docs/authors.html b/docs/authors.html index 577fc103..30ddf960 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -3,7 +3,7 @@ - +

- +
@@ -72,7 +72,7 @@

Authors and Citation

- +
  • David Blodgett. Author, maintainer.

    @@ -86,7 +86,7 @@

    Authors and Citation

  • -

    Josh Erickson. Contributor. +

    Josh Erickson. Contributor.

  • @@ -125,15 +125,15 @@

    Citation

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/index.html b/docs/index.html index 60afb67c..88c2d696 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@ - +
- +
@@ -318,16 +318,16 @@

Developers

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/news/index.html b/docs/news/index.html index de9ee4c5..88759a53 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -3,7 +3,7 @@ - +
- +
@@ -72,6 +72,10 @@

Changelog

Source: NEWS.md
+
+ +
  • no longer check ring direction in get_nhdplushr() to avoid very slow run time on some polygon layers.
  • +
-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index a535a3b3..2075993c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,5 @@ -pandoc: '3.2' -pkgdown: 2.0.9 +pandoc: '3.5' +pkgdown: 2.1.1 pkgdown_sha: ~ articles: get_3dhp_data: get_3dhp_data.html @@ -8,8 +8,7 @@ articles: nhdplushr: nhdplushr.html nhdplusTools: nhdplusTools.html plot_nhdplus: plot_nhdplus.html -last_built: 2024-08-01T15:01Z +last_built: 2024-12-17T14:04Z urls: reference: https://doi-usgs.github.io/nhdplusTools/reference article: https://doi-usgs.github.io/nhdplusTools/articles - diff --git a/docs/reference/add_plus_network_attributes.html b/docs/reference/add_plus_network_attributes.html index 4fade4d0..e24b0fc2 100644 --- a/docs/reference/add_plus_network_attributes.html +++ b/docs/reference/add_plus_network_attributes.html @@ -7,7 +7,7 @@ - +
- +
@@ -97,7 +97,9 @@

Add NHDPlus Network Attributes to a provided network.

Arguments

-
net
+ + +
net

data.frame containing comid, tocomid, nameID, lengthkm, and areasqkm. Additional attributes will be passed through unchanged. tocomid == 0 is the convention used for outlets. @@ -105,29 +107,27 @@

Arguments

otherwise, arbolate sum is calculated for the network and used as the weight.

-
override
+
override

numeric factor to be passed to get_levelpaths

-
cores
+
cores

integer number of processes to spawn if run in parallel.

-
split_temp
+
split_temp

character path to optional temporary copy of the network split into independent sub-networks. If it exists, it will be read from disk rather than recreated.

-
status
+
status

logical should progress be printed?

Value

- - -

data.frame with added attributes

+

data.frame with added attributes

@@ -149,10 +149,22 @@

Examples

areasqkm = walker_flowline$AreaSqKM) add_plus_network_attributes(test_flowline) -#> Loading required namespace: future -#> Loading required namespace: future.apply -#> Warning: Unknown or uninitialised column: `lengthkm`. -#> Error in pathlength_km[i] <- length_km[toids[i]] + pathlength_km[toids[i]]: replacement has length zero +#> # A tibble: 62 × 14 +#> comid tocomid nameID lengthkm areasqkm weight terminalpa hydroseq levelpathi +#> <int> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 5.33e6 0 255208 1.20 0.868 137. 1 1 1 +#> 2 5.33e6 5329303 255208 0.582 0.260 133. 1 3 1 +#> 3 5.33e6 5329293 255208 4.02 3.76 127. 1 5 1 +#> 4 5.33e6 5329305 255208 4.44 4.51 120. 1 8 1 +#> 5 5.33e6 5329317 255208 2.68 3.64 112. 1 10 1 +#> 6 5.33e6 5329315 255208 4.79 5.96 75.3 1 27 1 +#> 7 5.33e6 5329339 255208 1.03 1.27 67.4 1 29 1 +#> 8 5.33e6 5329343 255208 3.60 6.94 61.9 1 31 1 +#> 9 5.33e6 5329357 255208 3.14 5.13 51.1 1 37 1 +#> 10 5.33e6 5329365 254577 1.46 1.69 37.8 1 42 1 +#> # ℹ 52 more rows +#> # ℹ 5 more variables: pathlength <dbl>, dnlevelpat <dbl>, dnhydroseq <dbl>, +#> # totdasqkm <dbl>, terminalfl <dbl>

@@ -167,15 +179,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/align_nhdplus_names.html b/docs/reference/align_nhdplus_names.html index d64bb186..f775803c 100644 --- a/docs/reference/align_nhdplus_names.html +++ b/docs/reference/align_nhdplus_names.html @@ -3,7 +3,7 @@ - +

- +
@@ -83,15 +83,15 @@

Align NHD Dataset Names

Arguments

-
x
+ + +
x

a sf object of nhdplus flowlines

Value

- - -

data.frame renamed sf object

+

data.frame renamed sf object

@@ -176,15 +176,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/calculate_arbolate_sum.html b/docs/reference/calculate_arbolate_sum.html index afe9aa03..c0d4fb3a 100644 --- a/docs/reference/calculate_arbolate_sum.html +++ b/docs/reference/calculate_arbolate_sum.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,15 +87,15 @@

Calculate Arbolate Sum

Arguments

-
x
+ + +
x

data.frame with ID, toID, and length columns.

Value

- - -

numeric with arbolate sum.

+

numeric with arbolate sum.

@@ -139,15 +139,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/calculate_total_drainage_area.html b/docs/reference/calculate_total_drainage_area.html index 6c5062b4..fe95852f 100644 --- a/docs/reference/calculate_total_drainage_area.html +++ b/docs/reference/calculate_total_drainage_area.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,15 +85,15 @@

Total Drainage Area

Arguments

-
x
+ + +
x

data.frame with ID, toID, and area columns.

Value

- - -

numeric with total area.

+

numeric with total area.

@@ -129,15 +129,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/disambiguate_flowline_indexes.html b/docs/reference/disambiguate_flowline_indexes.html index dd90dc17..021ea3bd 100644 --- a/docs/reference/disambiguate_flowline_indexes.html +++ b/docs/reference/disambiguate_flowline_indexes.html @@ -7,7 +7,7 @@ - +
- +
@@ -91,18 +91,20 @@

Disambiguate Flowline Indexes

Arguments

-
indexes
+ + +
indexes

data.frame as output from get_flowline_index with more than one hydrologic location per indexed point.

-
flowpath
+
flowpath

data.frame with two columns. The first should join to the COMID field of the indexes and the second should be the numeric or ascii metric such as drainage area or GNIS Name. Names of this data.frame are not used.

-
hydro_location
+
hydro_location

data.frame with two columns. The first should join to the id field of the indexes and the second should be the numeric or ascii metric such as drainage area or GNIS Name.. Names of this data,frame are not used.

@@ -110,9 +112,7 @@

Arguments

Value

- - -

data.frame indexes deduplicated according to the minimum difference +

data.frame indexes deduplicated according to the minimum difference between the values in the metric columns. If two or more result in the same "minimum" value, duplicates will be returned.

@@ -201,15 +201,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/discover_geoconnex_reference.html b/docs/reference/discover_geoconnex_reference.html index 1031eecf..4880bd03 100644 --- a/docs/reference/discover_geoconnex_reference.html +++ b/docs/reference/discover_geoconnex_reference.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,16 +85,14 @@

discover geoconnex reference feature layers

Value

- - -

data.frame containing layers available and fields that are available to query.

+

data.frame containing layers available and fields that are available to query.

Examples

# \donttest{
   discover_geoconnex_reference()
-#> # A tibble: 205 × 6
+#> # A tibble: 210 × 6
 #>    id    title description                                 url   attribute type 
 #>    <chr> <chr> <chr>                                       <chr> <chr>     <chr>
 #>  1 hu02  HU02  Two-digit Hydrologic Regions from USGS NHD… http… fid       inte…
@@ -107,7 +105,7 @@ 

Examples

#> 8 hu04 HU04 Four-digit Hydrologic Subregion from USGS … http… fid inte… #> 9 hu04 HU04 Four-digit Hydrologic Subregion from USGS … http… uri stri… #> 10 hu04 HU04 Four-digit Hydrologic Subregion from USGS … http… name stri… -#> # ℹ 195 more rows +#> # ℹ 200 more rows # }
@@ -124,15 +122,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/discover_nhdplus_id.html b/docs/reference/discover_nhdplus_id.html index f802e35d..90bc109f 100644 --- a/docs/reference/discover_nhdplus_id.html +++ b/docs/reference/discover_nhdplus_id.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,28 +83,28 @@

Discover NHDPlus ID

Arguments

-
point
+ + +
point

sfc POINT including crs as created by: sf::st_sfc(sf::st_point(.. ,..), crs)

-
nldi_feature
+
nldi_feature

list with names `featureSource` and `featureID` where `featureSource` is derived from the "source" column of the response of get_nldi_sources and the `featureSource` is a known identifier from the specified `featureSource`.

-
raindrop
+
raindrop

logical if TRUE will call a raindrop trace web service and return will be the same as get_raindrop_trace with direction "none".

Value

- - -

integer COMID or list containing COMID and raindrop trace.

+

integer COMID or list containing COMID and raindrop trace.

@@ -123,7 +123,7 @@

Examples

#> # A tibble: 2 × 8 #> id gnis_name comid reachcode raindrop_pathDist measure intersection_point #> <chr> <chr> <int> <chr> <dbl> <dbl> <list> -#> 1 nhdF… North Br… 1.17e7 02060003… 62.6 53.9 <dbl [2]> +#> 1 nhdF… North Br… 1.17e7 02060003… 93.3 53.0 <dbl [2]> #> 2 rain… NA NA NA NA NA <dbl [0]> #> # ℹ 1 more variable: geometry <LINESTRING [°]> @@ -146,15 +146,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/discover_nldi_characteristics.html b/docs/reference/discover_nldi_characteristics.html index 37aabc52..4549212b 100644 --- a/docs/reference/discover_nldi_characteristics.html +++ b/docs/reference/discover_nldi_characteristics.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,15 +85,15 @@

(DEPRECATED) Discover Characteristics Metadata

Arguments

-
type
+ + +
type

character "all", "local", "total", or "divergence_routed".

Value

- - -

data.frame containing available characteristics

+

data.frame containing available characteristics

@@ -108,15 +108,15 @@

Value

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/download_nhd.html b/docs/reference/download_nhd.html index ef989a4a..fadad90c 100644 --- a/docs/reference/download_nhd.html +++ b/docs/reference/download_nhd.html @@ -3,7 +3,7 @@ - +

- +
@@ -83,26 +83,26 @@

Download NHD

Arguments

-
nhd_dir
+ + +
nhd_dir

character directory to save output into

-
hu_list
+
hu_list

character vector of hydrologic region(s) to download. Use get_huc to find HU codes of interest. Accepts two digit and four digit codes.

-
download_files
+
download_files

boolean if FALSE, only URLs to files will be returned can be hu02s and/or hu04s

Value

- - -

character Paths to geodatabases created.

+

character Paths to geodatabases created.

@@ -110,6 +110,10 @@

Examples

# \donttest{
 hu <- get_huc(sf::st_sfc(sf::st_point(c(-73, 42)), crs = 4326),
                             type = "huc08")
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
 
 (hu <- substr(hu$huc8, 1, 2))
 #> [1] "01"
@@ -141,15 +145,15 @@ 

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/download_nhdplushr.html b/docs/reference/download_nhdplushr.html index bebffa24..52185890 100644 --- a/docs/reference/download_nhdplushr.html +++ b/docs/reference/download_nhdplushr.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,22 +83,24 @@

Download NHDPlus HiRes

Arguments

-
nhd_dir
+ + +
nhd_dir

character directory to save output into

-
hu_list
+
hu_list

character vector of hydrologic region(s) to download. Use get_huc to find HU codes of interest. Accepts two digit and four digit codes.

-
download_files
+
download_files

boolean if FALSE, only URLs to files will be returned can be hu02s and/or hu04s

-
archive
+
archive

pull data from the "archive" folder rather than "current". The archive contains the original releases of NHDPlusHR data that were updated in subsequent processing. Not all subsets of NHDPlusHR were updated. See: @@ -108,9 +110,7 @@

Arguments

Value

- - -

character Paths to geodatabases created.

+

character Paths to geodatabases created.

@@ -118,6 +118,10 @@

Examples

# \donttest{
 hu <- get_huc(sf::st_sfc(sf::st_point(c(-73, 42)), crs = 4326),
                             type = "huc08")
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
 
 (hu <- substr(hu$huc8, 1, 2))
 #> [1] "01"
@@ -162,15 +166,15 @@ 

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/download_nhdplusv2.html b/docs/reference/download_nhdplusv2.html index 0db29774..b6fb8a73 100644 --- a/docs/reference/download_nhdplusv2.html +++ b/docs/reference/download_nhdplusv2.html @@ -8,7 +8,7 @@ - +
- +
@@ -98,35 +98,35 @@

Download seamless National Hydrography Dataset Version 2 (NHDPlusV2)

Arguments

-
outdir
+ + +
outdir

The folder path where data should be downloaded and extracted

-
url
+
url

the location of the online resource

-
progress
+
progress

boolean display download progress?

Value

- - -

character path to the local geodatabase

+

character path to the local geodatabase

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
   download_nhdplusV2("./data/nhd/")
 
   download_nhdplusv2(outdir = "./inst/",
       url = paste0("https://dmap-data-commons-ow.s3.amazonaws.com/NHDPlusV21/",
                    "Data/NationalData/NHDPlusV21_NationalData_Seamless",
                    "_Geodatabase_HI_PR_VI_PI_03.7z"))
-}
+} # }
 
@@ -141,15 +141,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/download_rf1.html b/docs/reference/download_rf1.html index 82714c7c..03b70f81 100644 --- a/docs/reference/download_rf1.html +++ b/docs/reference/download_rf1.html @@ -4,7 +4,7 @@ - +
- +
@@ -89,30 +89,30 @@

Download the seamless Reach File (RF1) Database

Arguments

-
outdir
+ + +
outdir

The folder path where data should be downloaded and extracted

-
url
+
url

the location of the online resource

-
progress
+
progress

boolean display download progress?

Value

- - -

character path to the local e00 file

+

character path to the local e00 file

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
   download_wbd("./data/rf1/")
-}
+} # }
 
@@ -127,15 +127,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/download_vaa.html b/docs/reference/download_vaa.html index 22810b61..82f72e98 100644 --- a/docs/reference/download_vaa.html +++ b/docs/reference/download_vaa.html @@ -3,7 +3,7 @@ - +
- +
@@ -87,17 +87,19 @@

Download NHDPlusVAA data from HydroShare

Arguments

-
path
+ + +
path

character path where the file should be saved. Default is a persistent system data as retrieved by nhdplusTools_data_dir. Also see: get_vaa_path

-
force
+
force

logical. Force data re-download. Default = FALSE

-
updated_network
+
updated_network

logical default FALSE. If TRUE, updated network attributes from E2NHD and National Water Model retrieved from doi:10.5066/P976XCVT @@ -106,9 +108,7 @@

Arguments

Value

- - -

character path to cached data

+

character path to cached data

Details

@@ -134,15 +134,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/download_wbd.html b/docs/reference/download_wbd.html index 19546ffc..6a6298e1 100644 --- a/docs/reference/download_wbd.html +++ b/docs/reference/download_wbd.html @@ -6,7 +6,7 @@ - +
- +
@@ -94,30 +94,30 @@

Download the seamless Watershed Boundary Dataset (WBD)

Arguments

-
outdir
+ + +
outdir

The folder path where data should be downloaded and extracted

-
url
+
url

the location of the online resource

-
progress
+
progress

boolean display download progress?

Value

- - -

character path to the local geodatabase

+

character path to the local geodatabase

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
   download_wbd("./data/wbd/")
-}
+} # }
 
@@ -132,15 +132,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/fix_flowdir.html b/docs/reference/fix_flowdir.html index 840f8fea..75b897ea 100644 --- a/docs/reference/fix_flowdir.html +++ b/docs/reference/fix_flowdir.html @@ -1,201 +1,8 @@ - -Fix flow direction — fix_flowdir • nhdplusTools - - -
-
- - - -
-
- - -
-

If flowlines aren't digitized in the expected direction, -this will reorder the nodes so they are.

-
- -
-
fix_flowdir(comid, network = NULL, fn_list = NULL)
-
- -
-

Arguments

-
comid
-

integer The COMID of the flowline to check

- - -
network
-

sf data.frame The entire network to check from. Requires a "toCOMID" field.

- - -
fn_list
-

list containing named elements `flowline`, `network`, and `check_end`, -where `flowline` is the flowline to be checked and `network` the feature up or downstream -of the flowline to be checked, and `check_end` is `"start"` or `"end"` depending if the -`network` input is upstream (`"start"`) or downstream (`"end"`) of the flowline to be checked. -This option allows pre-compilation of pairs of features which may be useful for very large -numbers of flow direction checks.

- -
-
-

Value

- - -

a geometry for the feature that has been reversed if needed.

-
- -
-

Examples

-

-source(system.file("extdata/sample_data.R", package = "nhdplusTools"))
-
-fline <- sf::read_sf(sample_data, "NHDFlowline_Network")
-
-# We add a tocomid with prepare_nhdplus
-fline <- sf::st_sf(prepare_nhdplus(fline, 0, 0, 0, FALSE),
-                   geom = sf::st_zm(sf::st_geometry(fline)))
-#> Warning: removing geometry
-#> Warning: Got NHDPlus data without a Terminal catchment. Attempting to find it.
-#> Warning: Removed 0 flowlines that don't apply.
-#>  Includes: Coastlines, non-dendritic paths, 
-#> and networks with drainage area less than 0 sqkm, and drainage basins smaller than 0
-
-# Look at the end node of the 10th line.
-(n1 <- get_node(fline[10, ], position = "end"))
-#> Simple feature collection with 1 feature and 0 fields
-#> Geometry type: POINT
-#> Dimension:     XY
-#> Bounding box:  xmin: -89.34813 ymin: 42.99555 xmax: -89.34813 ymax: 42.99555
-#> Geodetic CRS:  GRS 1980(IUGG, 1980)
-#> # A tibble: 1 × 1
-#>               geometry
-#> *          <POINT [°]>
-#> 1 (-89.34813 42.99555)
-
-# Break the geometry by reversing it.
-sf::st_geometry(fline)[10] <- sf::st_reverse(sf::st_geometry(fline)[10])
-
-# Note that the end node is different now.
-(n2 <- get_node(fline[10, ], position = "end"))
-#> Simple feature collection with 1 feature and 0 fields
-#> Geometry type: POINT
-#> Dimension:     XY
-#> Bounding box:  xmin: -89.36355 ymin: 43 xmax: -89.36355 ymax: 43
-#> Geodetic CRS:  GRS 1980(IUGG, 1980)
-#> # A tibble: 1 × 1
-#>         geometry
-#> *    <POINT [°]>
-#> 1 (-89.36355 43)
-
-# Pass the broken geometry to fix_flowdir with the network for toCOMID
-sf::st_geometry(fline)[10] <- fix_flowdir(fline$COMID[10], fline)
-
-# Note that the geometry is now in the right order.
-(n3 <- get_node(fline[10, ], position = "end"))
-#> Simple feature collection with 1 feature and 0 fields
-#> Geometry type: POINT
-#> Dimension:     XY
-#> Bounding box:  xmin: -89.34813 ymin: 42.99555 xmax: -89.34813 ymax: 42.99555
-#> Geodetic CRS:  GRS 1980(IUGG, 1980)
-#> # A tibble: 1 × 1
-#>               geometry
-#> *          <POINT [°]>
-#> 1 (-89.34813 42.99555)
-
-plot(sf::st_geometry(fline)[10])
-plot(n1, add = TRUE)
-plot(n2, add = TRUE, col = "blue")
-plot(n3, add = TRUE, cex = 2, col = "red")
-
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/get_3dhp.html b/docs/reference/get_3dhp.html index 2584b3a2..764a633a 100644 --- a/docs/reference/get_3dhp.html +++ b/docs/reference/get_3dhp.html @@ -5,7 +5,7 @@ - +

- +
@@ -95,48 +95,48 @@

Get 3DHP Data

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
ids
+
ids

character vector of id3dhp ids or mainstem uris

-
type
+
type

character. Type of feature to return ("hydrolocation", "flowline", "waterbody", "drainage area", "catchment"). If NULL (default) a data.frame of available resources is returned

-
universalreferenceid
+
universalreferenceid

character vector of hydrolocation universal reference ids such as reachcodes

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

-
page_size
+
page_size

numeric default number of features to request at a time. Reducing may help if 500 errors are experienced.

Value

- - -

a simple features (sf) object or valid types if no type supplied

+

a simple features (sf) object or valid types if no type supplied

Details

@@ -159,6 +159,8 @@

Examples

# get flowlines and hydrolocations flowlines <- get_3dhp(AOI = AOI, type = "flowline") hydrolocation <- get_3dhp(AOI = AOI, type = "hydrolocation") +#> Warning: No sink, spring, waterbody outlet features found in area of interest. +#> Warning: No headwater, terminus, divergence, confluence, catchment outlet features found in area of interest. waterbody <- get_3dhp(AOI = AOI, type = "waterbody") if(!is.null(waterbody) & !is.null(flowlines) & !is.null(hydrolocation)) { @@ -171,6 +173,9 @@

Examples

CO <- get_3dhp(ids = "https://geoconnex.us/ref/mainstems/29559", type = "flowline") +#> Getting features 0 to 2000 of 4467 +#> Getting features 2000 to 4000 of 4467 +#> Getting features 4000 to 4467 of 4467 if(!is.null(CO)) plot(sf::st_geometry(CO), col = "blue") @@ -189,6 +194,8 @@

Examples

get_3dhp(universalreferenceid = unique(hydrolocation$universalreferenceid), type = "hydrolocation") +#> Warning: No sink, spring, waterbody outlet features found in area of interest. +#> Warning: No headwater, terminus, divergence, confluence, catchment outlet features found in area of interest. #> Simple feature collection with 558 features and 10 fields #> Geometry type: POINT #> Dimension: XY @@ -243,15 +250,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_DD.html b/docs/reference/get_DD.html index e1e5c413..ff0a3356 100644 --- a/docs/reference/get_DD.html +++ b/docs/reference/get_DD.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,16 +87,18 @@

Navigate Downstream with Diversions

Arguments

-
network
+ + +
network

data.frame NHDPlus flowlines including at a minimum: COMID, DnMinorHyd, DnHydroseq, and Hydroseq.

-
comid
+
comid

integer identifier to start navigating from.

-
distance
+
distance

numeric distance in km to limit how many COMIDs are returned. The COMID that exceeds the distance specified is returned. @@ -105,15 +107,13 @@

Arguments

Value

- - -

integer vector of all COMIDs downstream of the starting COMID

+

integer vector of all COMIDs downstream of the starting COMID

Examples

library(sf)
-#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUE
+#> Linking to GEOS 3.12.2, GDAL 3.9.3, PROJ 9.4.1; sf_use_s2() is TRUE
 start_COMID <- 11688818
 
 source(system.file("extdata", "sample_flines.R", package = "nhdplusTools"))
@@ -141,15 +141,15 @@ 

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_DM.html b/docs/reference/get_DM.html index 57c71aab..042896fa 100644 --- a/docs/reference/get_DM.html +++ b/docs/reference/get_DM.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,33 +83,33 @@

Navigate Downstream Mainstem

Arguments

-
network
+ + +
network

data.frame NHDPlus flowlines including at a minimum: COMID, LENGTHKM, DnHydroseq, and Hydroseq.

-
comid
+
comid

integer identifier to start navigating from.

-
distance
+
distance

numeric distance in km to limit how many COMIDs are returned. The COMID that exceeds the distance specified is returned.

-
sort
+
sort

if TRUE, the returned COMID vector will be sorted in order of distance from the input COMID (nearest to farthest)

-
include
+
include

if TRUE, the input COMID will be included in the returned COMID vector

Value

- - -

integer vector of all COMIDs downstream of the starting COMID +

integer vector of all COMIDs downstream of the starting COMID along the mainstem

@@ -144,15 +144,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_UM.html b/docs/reference/get_UM.html index 3c6d7644..087d907d 100644 --- a/docs/reference/get_UM.html +++ b/docs/reference/get_UM.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,33 +83,33 @@

Navigate Upstream Mainstem

Arguments

-
network
+ + +
network

data.frame NHDPlus flowlines including at a minimum: COMID,Pathlength, LevelPathI, and Hydroseq.

-
comid
+
comid

integer identifier to start navigating from.

-
distance
+
distance

numeric distance in km to limit how many COMIDs are

-
sort
+
sort

if TRUE, the returned COMID vector will be sorted in order of distance from the input COMID (nearest to farthest)

-
include
+
include

if TRUE, the input COMID will be included in the returned COMID vector returned. The COMID that exceeds the distance specified is returned.

Value

- - -

integer vector of all COMIDs upstream of the starting COMID +

integer vector of all COMIDs upstream of the starting COMID along the mainstem

@@ -144,15 +144,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_UT.html b/docs/reference/get_UT.html index 212d4106..ab6c63ca 100644 --- a/docs/reference/get_UT.html +++ b/docs/reference/get_UT.html @@ -3,7 +3,7 @@ - +

- +
@@ -83,25 +83,25 @@

Navigate Upstream with Tributaries

Arguments

-
network
+ + +
network

data.frame NHDPlus flowlines including at a minimum: COMID, Pathlength, LENGTHKM, and Hydroseq.

-
comid
+
comid

integer Identifier to start navigating from.

-
distance
+
distance

numeric distance in km to limit how many COMIDs are returned. The COMID that exceeds the distance specified is returned.

Value

- - -

integer vector of all COMIDs upstream with tributaries of the +

integer vector of all COMIDs upstream with tributaries of the starting COMID.

@@ -134,15 +134,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_boundaries.html b/docs/reference/get_boundaries.html index 3d3b36c5..390c1ec0 100644 --- a/docs/reference/get_boundaries.html +++ b/docs/reference/get_boundaries.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,17 +83,15 @@

Return RPU or VPU boundaries

Arguments

-
type
+ + +
type

character. Either "RPU" or "VPU"

Value

- - -

An object of class "sf"

- - +

An object of class "sf"

@@ -108,15 +106,15 @@

Value

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_catchment_characteristics.html b/docs/reference/get_catchment_characteristics.html index 0b7b2438..dab38a4d 100644 --- a/docs/reference/get_catchment_characteristics.html +++ b/docs/reference/get_catchment_characteristics.html @@ -10,7 +10,7 @@ - +

- +
@@ -97,16 +97,18 @@

Get Catchment Characteristics

Arguments

-
varname
+ + +
varname

character vector of desired variables. If repeated varnames are provided, they will be downloaded once but duplicated in the output.

-
ids
+
ids

numeric vector of identifiers (comids) from the specified fabric

-
reference_fabric
+
reference_fabric

(not used) will be used to allow future specification of alternate reference fabrics

@@ -116,6 +118,15 @@

Arguments

Examples

# \donttest{
   get_catchment_characteristics("CAT_BFI", c(5329343, 5329427))
+#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata.
+#>  Type: "externalptr"
+#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them.
+#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata.
+#>  Type: "externalptr"
+#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them.
+#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata.
+#>  Type: "externalptr"
+#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them.
 #>    characteristic_id   comid characteristic_value percent_nodata
 #>               <char>   <int>                <num>          <num>
 #> 1:           CAT_BFI 5329343                27.76              0
@@ -135,15 +146,15 @@ 

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_characteristics_metadata.html b/docs/reference/get_characteristics_metadata.html index a4b763a1..dcaee2db 100644 --- a/docs/reference/get_characteristics_metadata.html +++ b/docs/reference/get_characteristics_metadata.html @@ -8,7 +8,7 @@ - +
- +
@@ -93,12 +93,14 @@

Get catchment characteristics metadata table

Arguments

-
search
+ + +

character string of length 1 to free search the metadata table. If no search term is provided the entire table is returned.

-
cache
+
cache

logical should cached metadata be used?

@@ -83463,15 +83465,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_elev_along_path-1.png b/docs/reference/get_elev_along_path-1.png index edebb904..5473661c 100644 Binary files a/docs/reference/get_elev_along_path-1.png and b/docs/reference/get_elev_along_path-1.png differ diff --git a/docs/reference/get_elev_along_path.html b/docs/reference/get_elev_along_path.html index b0997ef4..d081904a 100644 --- a/docs/reference/get_elev_along_path.html +++ b/docs/reference/get_elev_along_path.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,28 +85,28 @@

Get Elevation Along Path (experimental)

Arguments

-
points
+ + +
points

sf data.frame containing a point column.

-
num_pts
+
num_pts

numeric number of points to retrieve along the cross section.

-
res
+
res

integer resolution of 3D Elevation Program data to request. Must be on of: 1, 3, 5, 10, 30, 60.

-
status
+
status

logical

Value

- - -

sf data.frame containing points retrieved. Names include +

sf data.frame containing points retrieved. Names include "id", "distance_m", "elevation_m", "spatial_ref", "geometry", and ".group". .group tracks which input point each set of output points belongs to.

@@ -157,6 +157,10 @@

Examples

plot(xs$distance_m, xs$elevation_m) } +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 @@ -177,15 +181,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_flowline_index.html b/docs/reference/get_flowline_index.html index f95de55b..b533be45 100644 --- a/docs/reference/get_flowline_index.html +++ b/docs/reference/get_flowline_index.html @@ -4,7 +4,7 @@ - +
- +
@@ -91,19 +91,21 @@

Get Flowline Index

Arguments

-
flines
+ + +
flines

sf data.frame of type LINESTRING or MULTILINESTRING including COMID, REACHCODE, ToMeas, and FromMeas. Can be "download_nhdplusv2" and remote nhdplusv2 data will be downloaded for the bounding box surround the submitted points. NOTE: The download option may not work for large areas, use with caution.

-
points
+
points

sf or sfc of type POINT in analysis projection. NOTE: flines will be projected to the projection of the points layer.

-
search_radius
+
search_radius

units distance for the nearest neighbor search to extend in analysis projection. If missing or NULL, and points are in a lon lat projection, a default of 0.01 degree is used, otherwise 200 m is used. @@ -111,20 +113,18 @@

Arguments

See RANN nn2 documentation for more details.

-
precision
+
precision

numeric the resolution of measure precision in the output in meters.

-
max_matches
+
max_matches

numeric the maximum number of matches to return if multiple are found in search_radius

Value

- - -

data.frame with five columns, id, COMID, REACHCODE, REACH_meas, and offset. id is the +

data.frame with five columns, id, COMID, REACHCODE, REACH_meas, and offset. id is the row or list element in the point input.

@@ -140,7 +140,7 @@

Details

the input points.

Note 4: See `dfMaxLength` input to sf::st_segmentize() for details of handling of precision parameter.

-

Note 5: "from" is downstream -- 0 is the outlet "to" is upstream -- 100 is the inlet

+

Note 5: "from" is downstream – 0 is the outlet "to" is upstream – 100 is the inlet

@@ -167,6 +167,10 @@

Examples

#> 1 1 11689978 02060003001472 51.8751 25.88438 get_flowline_index("download_nhdplusv2", point) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> id COMID REACHCODE REACH_meas offset #> 1 1 11689978 02060003001472 51.8761 25.85641 @@ -232,15 +236,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_gagesII.html b/docs/reference/get_gagesII.html index b9498533..96e76177 100644 --- a/docs/reference/get_gagesII.html +++ b/docs/reference/get_gagesII.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,37 +85,37 @@

Find gagesII Features

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
id
+
id

character NWIS Gage ID(s)

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

-
basin
+
basin

logical should the gagesII basin also be returned? If True, return value will be a list with "site" and "basin" elements.

Value

- - -

a simple features (sf) object

+

a simple features (sf) object

Details

@@ -140,15 +140,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_geoconnex_reference.html b/docs/reference/get_geoconnex_reference.html index eae49d82..9649dfaa 100644 --- a/docs/reference/get_geoconnex_reference.html +++ b/docs/reference/get_geoconnex_reference.html @@ -3,7 +3,7 @@ - +
- +
@@ -89,35 +89,35 @@

get geoconnex reference feature layers

Arguments

-
AOI
+ + +
AOI

bbox, sf polygon or point, or a URL that will return an sf object when passed to read_sf

-
type
+
type

character the feature type chosen from discover_geoconnex_reference

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

-
status
+
status

boolean print status or not

Value

- - -

sf data.frame containing requested reference features

+

sf data.frame containing requested reference features

@@ -159,10 +159,10 @@

Examples

#> Bounding box: xmin: -91.15213 ymin: 41.22784 xmax: -88.18307 ymax: 46.21648 #> Geodetic CRS: WGS 84 #> # A tibble: 2 × 8 -#> id loaddate gnis_id gnis_url uri fid name -#> * <chr> <dttm> <chr> <chr> <chr> <int> <chr> -#> 1 0707 2017-02-01 00:53:08 NA "" https://geoconnex.us/r… 189 Wisc… -#> 2 0709 2012-06-11 07:54:59 NA "" https://geoconnex.us/r… 65 Rock +#> id gnis_url uri fid gnis_id name loaddate +#> * <chr> <chr> <chr> <int> <chr> <chr> <dttm> +#> 1 0707 "" https://geoconnex.us/r… 189 NA Wisc… 2017-02-01 00:53:08 +#> 2 0709 "" https://geoconnex.us/r… 65 NA Rock 2012-06-11 07:54:59 #> # ℹ 1 more variable: geometry <MULTIPOLYGON [°]> get_geoconnex_reference("https://geoconnex.us/ref/mainstems/315626", type = "hu04", ) @@ -173,23 +173,23 @@

Examples

#> Bounding box: xmin: -106.7484 ymin: 30.05369 xmax: -91.8491 ymax: 39.38306 #> Geodetic CRS: WGS 84 #> # A tibble: 15 × 8 -#> id loaddate gnis_id gnis_url uri fid name -#> * <chr> <dttm> <chr> <chr> <chr> <int> <chr> -#> 1 1102 2017-04-17 09:39:52 NA "" https://geoconnex.us/… 29 Uppe… -#> 2 1103 2012-06-11 07:54:59 NA "" https://geoconnex.us/… 70 Midd… -#> 3 1104 2012-06-11 07:54:59 NA "" https://geoconnex.us/… 133 Uppe… -#> 4 1105 2012-06-11 07:54:59 NA "" https://geoconnex.us/… 143 Lowe… -#> 5 1106 2017-04-21 13:34:18 NA "" https://geoconnex.us/… 144 Arka… -#> 6 1107 2017-04-21 13:34:23 NA "" https://geoconnex.us/… 145 Neos… -#> 7 1108 2017-09-20 20:59:45 NA "" https://geoconnex.us/… 126 Uppe… -#> 8 1109 2017-04-24 11:26:44 NA "" https://geoconnex.us/… 148 Lowe… -#> 9 1110 2017-04-21 13:15:51 NA "" https://geoconnex.us/… 146 Nort… -#> 10 1111 2017-04-21 13:15:55 NA "" https://geoconnex.us/… 7 Lowe… -#> 11 1112 2017-04-24 08:53:22 NA "" https://geoconnex.us/… 147 Red … -#> 12 1113 2017-04-24 08:53:22 NA "" https://geoconnex.us/… 179 Red-… -#> 13 1114 2017-10-15 23:35:54 NA "" https://geoconnex.us/… 175 Red-… -#> 14 1305 2017-11-05 19:43:51 NA "" https://geoconnex.us/… 178 Rio … -#> 15 1306 2017-09-20 20:59:52 NA "" https://geoconnex.us/… 129 Uppe… +#> id name gnis_url uri gnis_id fid loaddate +#> * <chr> <chr> <chr> <chr> <chr> <int> <dttm> +#> 1 1102 Upper Arkansas "" http… NA 29 2017-04-17 09:39:52 +#> 2 1103 Middle Arkansas "" http… NA 70 2012-06-11 07:54:59 +#> 3 1104 Upper Cimarron "" http… NA 133 2012-06-11 07:54:59 +#> 4 1105 Lower Cimarron "" http… NA 143 2012-06-11 07:54:59 +#> 5 1106 Arkansas-Keystone "" http… NA 144 2017-04-21 13:34:18 +#> 6 1107 Neosho-Verdigris "" http… NA 145 2017-04-21 13:34:23 +#> 7 1108 Upper Canadian "" http… NA 126 2017-09-20 20:59:45 +#> 8 1109 Lower Canadian "" http… NA 148 2017-04-24 11:26:44 +#> 9 1110 North Canadian "" http… NA 146 2017-04-21 13:15:51 +#> 10 1111 Lower Arkansas "" http… NA 7 2017-04-21 13:15:55 +#> 11 1112 Red Headwaters "" http… NA 147 2017-04-24 08:53:22 +#> 12 1113 Red-Washita "" http… NA 179 2017-04-24 08:53:22 +#> 13 1114 Red-Sulphur "" http… NA 175 2017-10-15 23:35:54 +#> 14 1305 Rio Grande Closed Bas… "" http… NA 178 2017-11-05 19:43:51 +#> 15 1306 Upper Pecos "" http… NA 129 2017-09-20 20:59:52 #> # ℹ 1 more variable: geometry <MULTIPOLYGON [°]> AOI <- sf::st_sfc(sf::st_point(c(-89.56684, 42.99816)), @@ -203,10 +203,10 @@

Examples

#> Bounding box: xmin: -91.15213 ymin: 41.22784 xmax: -88.18307 ymax: 46.21648 #> Geodetic CRS: WGS 84 #> # A tibble: 2 × 8 -#> id loaddate gnis_id gnis_url uri fid name -#> * <chr> <dttm> <chr> <chr> <chr> <int> <chr> -#> 1 0707 2017-02-01 00:53:08 NA "" https://geoconnex.us/r… 189 Wisc… -#> 2 0709 2012-06-11 07:54:59 NA "" https://geoconnex.us/r… 65 Rock +#> id name gnis_url uri gnis_id fid loaddate +#> * <chr> <chr> <chr> <chr> <chr> <int> <dttm> +#> 1 0707 Wisconsin "" https://geoconnex.… NA 189 2017-02-01 00:53:08 +#> 2 0709 Rock "" https://geoconnex.… NA 65 2012-06-11 07:54:59 #> # ℹ 1 more variable: geometry <MULTIPOLYGON [°]> # } @@ -224,15 +224,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_hr_data.html b/docs/reference/get_hr_data.html index 267924b7..5c613000 100644 --- a/docs/reference/get_hr_data.html +++ b/docs/reference/get_hr_data.html @@ -4,7 +4,7 @@ - +
- +
@@ -92,36 +92,36 @@

Get NHDPlus HiRes Data

Arguments

-
gdb
+ + +
gdb

character path to geodatabase to get data from.

-
layer
+
layer

character layer name from geodatabase found with st_layers

-
min_size_sqkm
+
min_size_sqkm

numeric minimum basin size to be included in the output

-
simp
+
simp

numeric simplification tolerance in units of projection

-
proj
+
proj

a projection specification compatible with st_crs

-
rename
+
rename

boolean if TRUE, nhdplusTools standard attribute values will be applied.

Value

- - -

sf data.frame containing requested data

+

sf data.frame containing requested data

@@ -136,15 +136,15 @@

Value

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_huc.html b/docs/reference/get_huc.html index e37ea024..1286d13d 100644 --- a/docs/reference/get_huc.html +++ b/docs/reference/get_huc.html @@ -4,7 +4,7 @@ - +

- +
@@ -85,43 +85,43 @@

Find WBD HUC unit subsets

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
id
+
id

WBD HUC ID(s)

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

-
type
+
type

character. Type of feature to return ('huc02', 'huc04', 'huc06', 'huc08', 'huc10', 'huc12', 'huc12_nhdplusv2').

Pulls `huc02`-`huc12` from a web service that hosts a snapshot of the Watershed Boundary Dataset from October, 2020.

See <doi:10.5066/P92U7ZUT> for full source data.

-

See https://labs.waterdata.usgs.gov/geoserver/web/ for the web service.

+

See https://api.water.usgs.gov/geoserver/web/ for the web service.

`huc12_nhdplusv2` derives from a snapshot of the WBD available from the nhdplusv2. See download_nhdplusv2 for source data documentation.

Value

- - -

a simple features (sf) object

+

a simple features (sf) object

Details

@@ -146,15 +146,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_hydro_location.html b/docs/reference/get_hydro_location.html index abec552e..75b897ea 100644 --- a/docs/reference/get_hydro_location.html +++ b/docs/reference/get_hydro_location.html @@ -1,143 +1,8 @@ - -Get Hydro Location — get_hydro_location • nhdplusTools - - -
-
- - - -
-
- - -
-

given a flowline index, returns the hydrologic location (point) -along the specific linear element referenced by the index.

-
- -
-
get_hydro_location(indexes, flowpath)
-
- -
-

Arguments

-
indexes
-

data.frame as output from get_flowline_index.

- - -
flowpath
-

data.frame with three columns: COMID, FromMeas, and ToMeas -as well as geometry.

- -
- -
-

Examples

-
source(system.file("extdata", "sample_flines.R", package = "nhdplusTools"))
-
-indexes <- get_flowline_index(sample_flines,
-                   sf::st_sfc(sf::st_sfc(list(sf::st_point(c(-76.86934, 39.49328)),
-                                              sf::st_point(c(-76.91711, 39.40884)),
-                                              sf::st_point(c(-76.88081, 39.36354))),
-                              crs = 4326)))
-
-get_hydro_location(indexes, sample_flines)
-#> Geometry set for 3 features 
-#> Geometry type: POINT
-#> Dimension:     XY
-#> Bounding box:  xmin: -76.91761 ymin: 39.3633 xmax: -76.8694 ymax: 39.49326
-#> Geodetic CRS:  WGS 84
-#> POINT (-76.8694 39.49326)
-#> POINT (-76.91761 39.40909)
-#> POINT (-76.881 39.3633)
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/get_levelpaths.html b/docs/reference/get_levelpaths.html index 886dda38..30a8db9d 100644 --- a/docs/reference/get_levelpaths.html +++ b/docs/reference/get_levelpaths.html @@ -7,7 +7,7 @@ - +
- +
@@ -91,34 +91,34 @@

Get Level Paths (DEPRECATED)

Arguments

-
x
+ + +
x

data.frame with ID, toID, nameID, and weight columns.

-
override_factor
+
override_factor

numeric factor to use to override nameID. If `weight` is `numeric_factor` times larger on a path, it will be followed regardless of the nameID indication.

-
status
+
status

boolean if status updates should be printed.

-
cores
+
cores

numeric number of cores to use in initial path ranking calculations.

Value

- - -

data.frame with ID, outletID, topo_sort, and levelpath columns. +

data.frame with ID, outletID, topo_sort, and levelpath columns. See details for more info.

Details

- +
  1. levelpath provides an identifier for the collection of flowlines that make up the single mainstem flowpath of a total upstream aggregate catchment.

  2. outletID is the catchment ID (COMID in the case of NHDPlus) for the catchment @@ -226,15 +226,15 @@

    Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nhdarea.html b/docs/reference/get_nhdarea.html index a4c16e87..a34a285b 100644 --- a/docs/reference/get_nhdarea.html +++ b/docs/reference/get_nhdarea.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,32 +85,32 @@

Find NHDPlusV2 Areas

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
id
+
id

NHD Area COMID(s)

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

Value

- - -

a simple features (sf) object

+

a simple features (sf) object

Details

@@ -135,15 +135,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nhdplus.html b/docs/reference/get_nhdplus.html index fb67c3d7..93a4ee54 100644 --- a/docs/reference/get_nhdplus.html +++ b/docs/reference/get_nhdplus.html @@ -5,7 +5,7 @@ - +
- +
@@ -94,35 +94,37 @@

Get National Hydrography Dataset V2 Subsets (Multirealization)

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
comid
+
comid

numeric or character. Search for NHD features by COMID(s)

-
nwis
+
nwis

numeric or character. Search for NHD features by collocated NWIS identifiers

-
realization
+
realization

character. What realization to return. Default is flowline and options include: outlet, flowline, catchment, and all

-
streamorder
+
streamorder

numeric or character. Only return NHD flowlines with a streamorder greater then or equal to this value for input value and higher. Only usable with AOI and flowline realizations.

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

@@ -130,9 +132,7 @@

Arguments

Value

- - -

sfc a single, or list, of simple feature objects

+

sfc a single, or list, of simple feature objects

Details

@@ -150,6 +150,8 @@

Examples

# \donttest{
  point <- sf::st_sfc(sf::st_point(c(-119.845, 34.4146)), crs = 4326)
  get_nhdplus(point)
+#> Spherical geometry (s2) switched off
+#> Spherical geometry (s2) switched on
 #> Simple feature collection with 1 feature and 137 fields
 #> Geometry type: LINESTRING
 #> Dimension:     XY
@@ -167,6 +169,8 @@ 

Examples

#> # uplevelpat <dbl>, uphydroseq <dbl>, dnlevelpat <dbl>, dnminorhyd <int>, #> # dndraincou <int>, dnhydroseq <dbl>, frommeas <int>, tomeas <dbl>, … get_nhdplus(point, realization = "catchment") +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Simple feature collection with 1 feature and 6 fields #> Geometry type: POLYGON #> Dimension: XY @@ -178,6 +182,10 @@

Examples

#> 1 1482979 948060316 NHDFlowline 2.58 0.133 0.000253 #> # ℹ 1 more variable: geometry <POLYGON [°]> get_nhdplus(point, realization = "all") +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> $catchment #> Simple feature collection with 1 feature and 6 fields #> Geometry type: POLYGON @@ -227,6 +235,8 @@

Examples

#> # dndraincou <int>, dnhydroseq <dbl>, frommeas <int>, tomeas <dbl>, … #> get_nhdplus(comid = 101) +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Simple feature collection with 1 feature and 137 fields #> Geometry type: LINESTRING #> Dimension: XY @@ -244,6 +254,8 @@

Examples

#> # uplevelpat <dbl>, uphydroseq <dbl>, dnlevelpat <dbl>, dnminorhyd <int>, #> # dndraincou <int>, dnhydroseq <dbl>, frommeas <int>, tomeas <dbl>, … get_nhdplus(nwis = c(11120000, 11120500)) +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Simple feature collection with 2 features and 137 fields #> Geometry type: LINESTRING #> Dimension: XY @@ -264,6 +276,10 @@

Examples

area <- sf::st_as_sfc(sf::st_bbox(c(xmin = -119.8851, xmax =-119.8361, ymax = 34.42439, ymin = 34.40473), crs = 4326)) get_nhdplus(area) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Simple feature collection with 19 features and 137 fields #> Geometry type: LINESTRING #> Dimension: XY @@ -299,6 +315,10 @@

Examples

#> # uplevelpat <dbl>, uphydroseq <dbl>, dnlevelpat <dbl>, dnminorhyd <dbl>, #> # dndraincou <int>, dnhydroseq <dbl>, frommeas <dbl>, tomeas <dbl>, … get_nhdplus(area, realization = "flowline", streamorder = 3) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Simple feature collection with 8 features and 137 fields #> Geometry type: LINESTRING #> Dimension: XY @@ -337,15 +357,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nhdplushr.html b/docs/reference/get_nhdplushr.html index 0dace63a..196658b5 100644 --- a/docs/reference/get_nhdplushr.html +++ b/docs/reference/get_nhdplushr.html @@ -3,7 +3,7 @@ - +
- +
@@ -92,15 +92,17 @@

Get NHDPlus HiRes

Arguments

-
hr_dir
+ + +
hr_dir

character directory with geodatabases (gdb search is recursive)

-
out_gpkg
+
out_gpkg

character path to write output geopackage

-
layers
+
layers

character vector with desired layers to return. c("NHDFlowline", "NHDPlusCatchment") is default. Choose from: @@ -111,36 +113,34 @@

Arguments

Set to NULL to get all available.

-
pattern
+
pattern

character optional regex to select certain files in hr_dir

-
check_terminals
+
check_terminals

boolean if TRUE, run make_standalone on output.

-
overwrite
+
overwrite

boolean should the output overwrite? If false and the output layer exists, it will be read and returned so this function will always return data even if called a second time for the same output. This is useful for workflows. Note that this will NOT delete the entire Geopackage. It will overwrite on a per layer basis.

-
keep_cols
+
keep_cols

character vector of column names to keep in the output. If NULL, all will be kept.

-
...
+
...

parameters passed along to get_hr_data for "NHDFlowline" layers.

Value

- - -

sf data.frames containing output that may also be written +

sf data.frames containing output that may also be written to a geopackage for later use.

@@ -153,7 +153,7 @@

Details

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
 # Note this will download a lot of data to a temp directory.
 # Change 'temp_dir' to your directory of choice.
 temp_dir <- file.path(nhdplusTools_data_dir(), "temp_hr_cache")
@@ -174,7 +174,7 @@ 

Examples

# Cleanup unlink(temp_dir, recursive = TRUE) -} +} # }
@@ -189,15 +189,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nldi_basin-2.png b/docs/reference/get_nldi_basin-2.png index bc876c79..048abfe2 100644 Binary files a/docs/reference/get_nldi_basin-2.png and b/docs/reference/get_nldi_basin-2.png differ diff --git a/docs/reference/get_nldi_basin.html b/docs/reference/get_nldi_basin.html index 56f37059..567b3597 100644 --- a/docs/reference/get_nldi_basin.html +++ b/docs/reference/get_nldi_basin.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,19 +83,21 @@

Get NLDI Basin Boundary

Arguments

-
nldi_feature
+ + +
nldi_feature

list with names `featureSource` and `featureID` where `featureSource` is derived from the "source" column of the response of get_nldi_sources and the `featureID` is a known identifier from the specified `featureSource`.

-
simplify
+
simplify

logical should response geometry be simplified for visualization and performance?

-
split
+
split

logical should response resolve precisely to the location of the `nldi_feature`? Setting `TRUE` calls an additional service and will be slower and less robust.

@@ -103,9 +105,7 @@

Arguments

Value

- - -

sf data.frame with result basin boundary

+

sf data.frame with result basin boundary

Details

@@ -171,15 +171,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nldi_characteristics.html b/docs/reference/get_nldi_characteristics.html index eead07fd..db176259 100644 --- a/docs/reference/get_nldi_characteristics.html +++ b/docs/reference/get_nldi_characteristics.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,22 +85,22 @@

(DEPRECATED) Get Catchment Characteristics

Arguments

-
nldi_feature
+ + +
nldi_feature

list with names `featureSource` and `featureID` where `featureSource` is derived from the "source" column of the response of get_nldi_sources and the `featureID` is a known identifier from the specified `featureSource`.

-
type
+
type

character "all", "local", "total", or "divergence_routed".

Value

- - -

data.frame containing requested characteristics

+

data.frame containing requested characteristics

@@ -115,15 +115,15 @@

Value

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nldi_feature.html b/docs/reference/get_nldi_feature.html index aee5bcf3..88eb7fd6 100644 --- a/docs/reference/get_nldi_feature.html +++ b/docs/reference/get_nldi_feature.html @@ -3,7 +3,7 @@ - +

- +
@@ -83,7 +83,9 @@

Get NLDI Feature

Arguments

-
nldi_feature
+ + +
nldi_feature

list with names `featureSource` and `featureID` where `featureSource` is derived from the "source" column of the response of get_nldi_sources and the `featureID` is a known identifier @@ -92,9 +94,7 @@

Arguments

Value

- - -

sf data.frame with one feature

+

sf data.frame with one feature

@@ -126,15 +126,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_nldi_index-1.png b/docs/reference/get_nldi_index-1.png index 4e8930c3..601cd791 100644 Binary files a/docs/reference/get_nldi_index-1.png and b/docs/reference/get_nldi_index-1.png differ diff --git a/docs/reference/get_nldi_index.html b/docs/reference/get_nldi_index.html index 067a785b..4cf127bc 100644 --- a/docs/reference/get_nldi_index.html +++ b/docs/reference/get_nldi_index.html @@ -6,7 +6,7 @@ - +
- +
@@ -89,7 +89,9 @@

Get NLDI Index

Arguments

-
location
+ + +
location

numeric WGS84 lon/lat pair (X, Y)

@@ -105,6 +107,10 @@

Examples

plot(sf::st_geometry(sf::st_transform(index, 3857)), add = TRUE) } +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 # } @@ -122,15 +128,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_node.html b/docs/reference/get_node.html index ab609f26..75b897ea 100644 --- a/docs/reference/get_node.html +++ b/docs/reference/get_node.html @@ -1,148 +1,8 @@ - -Get Flowline Node — get_node • nhdplusTools - - -
-
- - - -
-
- - -
-

Given one or more flowlines, returns - a particular node from the flowline.

-
- -
-
get_node(x, position = "end")
-
- -
-

Arguments

-
x
-

sf data.frame with one or more flowlines

- - -
position
-

character either "start" or "end"

- -
-
-

Value

- - -

sf data.frame containing requested nodes

-
- -
-

Examples

-

-source(system.file("extdata/sample_data.R", package = "nhdplusTools"))
-
-fline <- sf::read_sf(sample_data, "NHDFlowline_Network")
-
-start <- get_node(fline, "start")
-end <- get_node(fline, "end")
-
-plot(sf::st_zm(fline$geom),
-     lwd = fline$StreamOrde, col = "blue")
-plot(sf::st_geometry(start), add = TRUE)
-
-
-plot(sf::st_zm(fline$geom),
-     lwd = fline$StreamOrde, col = "blue")
-plot(sf::st_geometry(end), add = TRUE)
-
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/get_nwis.html b/docs/reference/get_nwis.html index 5c098c61..5593aa2f 100644 --- a/docs/reference/get_nwis.html +++ b/docs/reference/get_nwis.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,19 +87,21 @@

Discover USGS NWIS Stream Gages

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 20,000. Returned results are arrange by distance from POINT AOI

@@ -107,9 +109,7 @@

Arguments

Value

- - -

a simple features (sf) object

+

a simple features (sf) object

Details

@@ -134,15 +134,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_partial_length.html b/docs/reference/get_partial_length.html index 230b031f..75b897ea 100644 --- a/docs/reference/get_partial_length.html +++ b/docs/reference/get_partial_length.html @@ -1,176 +1,8 @@ - -Get Partial Flowline Length — get_partial_length • nhdplusTools - - -
-
- - - -
-
- - -
-

Finds the upstream and downstream lengths along a given -flowpath (flowline in nhdplus terminology). Internally, the function -rescales the reach measure to a flowpath measure and applies that -rescaled measure to the length of the flowpath.

-
- -
-
get_partial_length(hl, net = NULL, fl = NULL)
-
- -
-

Arguments

-
hl
-

list containing a hydrologic location with names reachcode -and reach_meas.

- - -
net
-

data.frame containing a flowpath network with reachcode, -frommeas, tomeas, and lengthkm attributes. Not required if `fl` is -provided.

- - -
fl
-

data.frame containing one flowline that corresponds to the -reachcode and measure of `hl`. Not required if `hl` is provided.

- -
-
-

Value

- - -

list containing `up` and `dn` elements with numeric length in -km.

-
- -
-

Examples

-

-source(system.file("extdata", "walker_data.R", package = "nhdplusTools"))
-hydro_location <- list(comid = 5329339,
-                       reachcode = "18050005000078",
-                       reach_meas = 30)
-
-(pl <- get_partial_length(hydro_location, walker_flowline))
-#> $dn
-#> [1] 1.4358
-#> 
-#> $up
-#> [1] 3.3502
-#> 
-
-hydro_location <- sf::st_sf(hydro_location,
-                            geom = nhdplusTools::get_hydro_location(data.frame(hydro_location),
-                                                                    walker_flowline))
-
-net <- navigate_network(hydro_location,
-                        mode = "DM", network = walker_flowline,
-                        distance_km = 4, trim_start = TRUE)
-#> Loading required namespace: lwgeom
-
-plot(sf::st_geometry(walker_flowline[walker_flowline$COMID == hydro_location$comid,]))
-plot(sf::st_geometry(hydro_location), add = TRUE)
-plot(sf::st_geometry(net), add = TRUE, col = "blue", lwd = 2)
-
-
-sf::st_length(net)
-#> 2384.619 [m]
-pl$dn
-#> [1] 1.4358
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/get_path_lengths.html b/docs/reference/get_path_lengths.html index 5e66dc4d..ab128e13 100644 --- a/docs/reference/get_path_lengths.html +++ b/docs/reference/get_path_lengths.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,27 +87,27 @@

Get Path Lengths (DEPRECATED)

Arguments

-
outlets
+ + +
outlets

vector of IDs from data.frame

-
network
+
network

data.frame with ID, toID, and lengthkm attributes.

-
cores
+
cores

integer number of cores to use for parallel computation.

-
status
+
status

logical print status and progress bars?

Value

- - -

data.frame containing the distance between pairs of network outlets. +

data.frame containing the distance between pairs of network outlets. For a network with one terminal outlet, the data.frame will have `nrow(network)^2` rows.

@@ -157,15 +157,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_path_members.html b/docs/reference/get_path_members.html index e32b9c10..8f05853b 100644 --- a/docs/reference/get_path_members.html +++ b/docs/reference/get_path_members.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,27 +87,27 @@

Get Path Members (DEPRECATED)

Arguments

-
outlets
+ + +
outlets

vector of IDs from data.frame

-
network
+
network

data.frame with ID, toID, and lengthkm attributes.

-
cores
+
cores

integer number of cores to use for parallel computation.

-
status
+
status

logical print status and progress bars?

Value

- - -

list of lists containing flowpath identifiers along path that connect +

list of lists containing flowpath identifiers along path that connect outlets.

@@ -156,15 +156,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_pathlength.html b/docs/reference/get_pathlength.html index 3f8c3d01..f05e7f8f 100644 --- a/docs/reference/get_pathlength.html +++ b/docs/reference/get_pathlength.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,15 +83,15 @@

Get Path Length

Arguments

-
x
+ + +
x

data.frame with ID, toID, length columns.

Value

- - -

data.frame containing pathlength for each ID

+

data.frame containing pathlength for each ID

@@ -106,8 +106,69 @@

Examples

#> and networks with drainage area less than 0 sqkm, and drainage basins smaller than 0 get_pathlength(fl) -#> Warning: Unknown or uninitialised column: `lengthkm`. -#> Error in pathlength_km[i] <- length_km[toids[i]] + pathlength_km[toids[i]]: replacement has length zero +#> ID pathlength +#> 1 5329303 0.000 +#> 2 5329293 1.195 +#> 3 5329305 1.777 +#> 4 5329317 5.797 +#> 5 5329315 10.240 +#> 6 5329339 12.924 +#> 7 5329343 17.710 +#> 8 5329357 18.742 +#> 9 5329365 22.345 +#> 10 5329373 25.484 +#> 11 5329385 28.463 +#> 12 5329821 30.379 +#> 13 5329395 31.511 +#> 14 5329397 33.519 +#> 15 5329389 34.700 +#> 16 5329435 35.130 +#> 17 5329313 12.924 +#> 18 5329311 14.870 +#> 19 5329817 16.043 +#> 20 5329323 20.855 +#> 21 5329325 21.822 +#> 22 5329327 21.496 +#> 23 5329347 22.473 +#> 24 5329291 1.777 +#> 25 5329363 25.484 +#> 26 5329819 26.764 +#> 27 5329359 29.649 +#> 28 5329333 10.240 +#> 29 5329371 18.742 +#> 30 5329375 22.345 +#> 31 5329377 24.666 +#> 32 5329379 24.666 +#> 33 5329399 24.748 +#> 34 5329405 24.748 +#> 35 5329427 30.379 +#> 36 5329413 31.511 +#> 37 5329419 33.519 +#> 38 5329391 35.130 +#> 39 5329407 35.306 +#> 40 5329387 34.700 +#> 41 5329415 27.521 +#> 42 5329355 29.649 +#> 43 5329337 17.710 +#> 44 5329335 21.496 +#> 45 5329345 22.878 +#> 46 5329341 22.878 +#> 47 5329321 22.473 +#> 48 5329841 23.494 +#> 49 5329815 27.094 +#> 50 5329319 20.855 +#> 51 5329309 16.043 +#> 52 5329307 14.870 +#> 53 5329299 5.797 +#> 54 5329297 7.206 +#> 55 5329295 1.195 +#> 56 5329849 35.779 +#> 57 5329393 35.306 +#> 58 5329871 38.554 +#> 59 5329383 36.172 +#> 60 5329847 27.173 +#> 61 5329845 27.173 +#> 62 5329843 26.943
@@ -123,15 +184,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_pfaf-1.png b/docs/reference/get_pfaf-1.png index 33fdfa4b..bcd06da0 100644 Binary files a/docs/reference/get_pfaf-1.png and b/docs/reference/get_pfaf-1.png differ diff --git a/docs/reference/get_pfaf-2.png b/docs/reference/get_pfaf-2.png index f20b2be9..b65b9a39 100644 Binary files a/docs/reference/get_pfaf-2.png and b/docs/reference/get_pfaf-2.png differ diff --git a/docs/reference/get_pfaf.html b/docs/reference/get_pfaf.html index 0b5998df..f083e67c 100644 --- a/docs/reference/get_pfaf.html +++ b/docs/reference/get_pfaf.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,26 +85,26 @@

Get Pfafstetter Codes (DEPRECATED)

Arguments

-
x
+ + +
x

sf data.frame with ID, toID, totda, outletID, topo_sort, and levelpath attributes.

-
max_level
+
max_level

integer number of pfaf levels to attempt to calculate. If the network doesn't have resolution to support the desired level, unexpected behavior may occur.

-
status
+
status

boolean print status or not

Value

- - -

data.frame with ID and pfaf columns.

+

data.frame with ID and pfaf columns.

@@ -186,15 +186,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_raindrop_trace-1.png b/docs/reference/get_raindrop_trace-1.png index a134a407..2f81882f 100644 Binary files a/docs/reference/get_raindrop_trace-1.png and b/docs/reference/get_raindrop_trace-1.png differ diff --git a/docs/reference/get_raindrop_trace.html b/docs/reference/get_raindrop_trace.html index 183d4def..9037e573 100644 --- a/docs/reference/get_raindrop_trace.html +++ b/docs/reference/get_raindrop_trace.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,12 +85,14 @@

Get Raindrop Trace

Arguments

-
point
+ + +
point

sfc POINT including crs as created by: sf::st_sfc(sf::st_point(.. ,..), crs)

-
direction
+
direction

character "up", "down", or "none". Controls the portion of the split flowline that is returned along with the raindrop trace line.

@@ -98,9 +100,7 @@

Arguments

Value

- - -

sf data.frame containing raindrop trace and requested +

sf data.frame containing raindrop trace and requested portion of flowline.

@@ -113,12 +113,12 @@

Examples

#> Simple feature collection with 2 features and 7 fields #> Geometry type: LINESTRING #> Dimension: XY -#> Bounding box: xmin: -89.21572 ymin: 42.94986 xmax: -89.20944 ymax: 42.95699 +#> Bounding box: xmin: -89.2158 ymin: 42.94986 xmax: -89.20944 ymax: 42.95673 #> Geodetic CRS: WGS 84 #> # A tibble: 2 × 8 #> id gnis_name comid reachcode raindrop_pathDist measure intersection_point #> <chr> <chr> <int> <chr> <dbl> <dbl> <list> -#> 1 down… Yahara R… 1.33e7 07090002… 273. 29.7 <dbl [2]> +#> 1 down… Yahara R… 1.33e7 07090002… 267. 28.6 <dbl [2]> #> 2 rain… NA NA NA NA NA <dbl [0]> #> # ℹ 1 more variable: geometry <LINESTRING [°]> @@ -131,6 +131,10 @@

Examples

plot(sf::st_transform(sf::st_geometry(trace)[1], 3857), add = TRUE, col = "red") plot(sf::st_transform(sf::st_geometry(trace)[2], 3857), add = TRUE, col = "black") } +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 # } @@ -149,15 +153,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_sorted.html b/docs/reference/get_sorted.html index 8618cae1..ea1a0495 100644 --- a/docs/reference/get_sorted.html +++ b/docs/reference/get_sorted.html @@ -8,7 +8,7 @@ - +
- +
@@ -93,28 +93,28 @@

Get Sorted Network

Arguments

-
x
+ + +
x

data.frame with an identifier and to identifier in the first and second columns.

-
split
+
split

logical if TRUE, the result will be split into independent networks identified by the id of their outlet. The outlet id of each independent network is added as a "terminalID" attribute.

-
outlets
+
outlets

same as id in x; if specified only the network emanating from these outlets will be considered and returned.

Value

- - -

data.frame containing a topologically sorted version +

data.frame containing a topologically sorted version of the requested network and optionally a terminal id.

@@ -163,15 +163,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_split_catchment-1.png b/docs/reference/get_split_catchment-1.png index 4ba3e5b1..6b958746 100644 Binary files a/docs/reference/get_split_catchment-1.png and b/docs/reference/get_split_catchment-1.png differ diff --git a/docs/reference/get_split_catchment-2.png b/docs/reference/get_split_catchment-2.png index 8f7be087..2e5013a7 100644 Binary files a/docs/reference/get_split_catchment-2.png and b/docs/reference/get_split_catchment-2.png differ diff --git a/docs/reference/get_split_catchment-3.png b/docs/reference/get_split_catchment-3.png index 20c6d2c1..764f364a 100644 Binary files a/docs/reference/get_split_catchment-3.png and b/docs/reference/get_split_catchment-3.png differ diff --git a/docs/reference/get_split_catchment.html b/docs/reference/get_split_catchment.html index fb13eef3..c77b2d9f 100644 --- a/docs/reference/get_split_catchment.html +++ b/docs/reference/get_split_catchment.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,21 +85,21 @@

Get split catchment

Arguments

-
point
+ + +
point

scf POINT including crs as created by: sf::st_sfc(sf::st_point(.. ,..), crs).

-
upstream
+
upstream

logical If TRUE, the entire drainage basin upstream of the point provided is returned in addition to the local catchment.

Value

- - -

sf data.frame containing the local catchment, the split portion +

sf data.frame containing the local catchment, the split portion and optionally the total drainage basin.

@@ -110,6 +110,9 @@

Details

along the flowline a small sub catchment will typically result. As a result, most users of this function will want to use get_raindrop_trace prior to calls to this function.

+

An attempt is made to eliminate polygon shards if they exist in the output. +However, there is a chance that this function will return a multipolygon +data.frame.

@@ -156,11 +159,23 @@

Examples

plot(sf::st_transform(sf::st_geometry(catchment)[2], 3857), add = TRUE, col = "black") plot(sf::st_transform(sf::st_sfc(pour_point, crs = 4326), 3857), add = TRUE, col = "white") } +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 10 -#> Zoom set to: 12 +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on +#> Zoom set to: 12 # } @@ -178,15 +193,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_streamlevel.html b/docs/reference/get_streamlevel.html index 847005c0..e440d909 100644 --- a/docs/reference/get_streamlevel.html +++ b/docs/reference/get_streamlevel.html @@ -9,7 +9,7 @@ - +
- +
@@ -95,7 +95,9 @@

Get Streamlevel

Arguments

-
x
+ + +
x

data.frame with levelpathi, dnlevelpat, and optionally a coastal flag. If no coastal flag is included, all terminal paths are assumed to be coastal.

@@ -103,9 +105,7 @@

Arguments

Value

- - -

numeric stream order in same order as input

+

numeric stream order in same order as input

@@ -151,15 +151,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_streamorder.html b/docs/reference/get_streamorder.html index daf6403c..cdf041a0 100644 --- a/docs/reference/get_streamorder.html +++ b/docs/reference/get_streamorder.html @@ -6,7 +6,7 @@ - +
- +
@@ -89,19 +89,19 @@

Get Streamorder

Arguments

-
x
+ + +
x

data.frame with dendritic ID and toID columns.

-
status
+
status

logical show progress update messages?

Value

- - -

numeric stream order in same order as input

+

numeric stream order in same order as input

@@ -141,15 +141,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_terminal.html b/docs/reference/get_terminal.html index bdd78cce..f33e2558 100644 --- a/docs/reference/get_terminal.html +++ b/docs/reference/get_terminal.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,19 +85,19 @@

Get Terminal ID (DEPRECATED)

Arguments

-
x
+ + +
x

two column data.frame with IDs and toIDs. Names are ignored.

-
outlets
+
outlets

IDs of outlet flowlines

Value

- - -

data.frame containing the terminal ID for each outlet

+

data.frame containing the terminal ID for each outlet

@@ -193,15 +193,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_tocomid.html b/docs/reference/get_tocomid.html index 8ffa6c70..ee2da365 100644 --- a/docs/reference/get_tocomid.html +++ b/docs/reference/get_tocomid.html @@ -10,7 +10,7 @@ - +
- +
@@ -103,38 +103,38 @@

Get tocomid

Arguments

-
x
+ + +
x

data.frame with comid, tonode, fromnode, and (optionally) divergence and terminalpa attributes.

-
return_dendritic
+
return_dendritic

logical if TRUE, a divergence attribute is required (2 indicates diverted path, 1 is main) and diverted paths will be treated as headwaters. If this is FALSE, the return value is a data.frame including the comid and tocomid attributes.

-
missing
+
missing

integer value to use for terminal nodes.

-
remove_coastal
+
remove_coastal

logical remove coastal features prior to generating tocomid values? ftype or fcode are required if `TRUE`. fcode == 56600 or fcode == "Coastline" will be removed.

-
add
+
add

logical if TRUE, a tocomid column will be added, otherwise a data.frame with two columns will be returned.

Value

- - -

data.frame containing comid and tocomid attributes or all +

data.frame containing comid and tocomid attributes or all attributes provided with comid and tocomid in the first and second columns..

@@ -160,15 +160,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_vaa.html b/docs/reference/get_vaa.html index 98b6e1f1..4f1a5711 100644 --- a/docs/reference/get_vaa.html +++ b/docs/reference/get_vaa.html @@ -3,7 +3,7 @@ - +
- +
@@ -88,22 +88,24 @@

NHDPlusV2 Attribute Subset

Arguments

-
atts
+ + +
atts

character The variable names you would like, always includes comid

-
path
+
path

character path where the file should be saved. Default is a persistent system data as retrieved by nhdplusTools_data_dir. Also see: get_vaa_path

-
download
+
download

logical if TRUE, the default, will download VAA table if not found at path.

-
updated_network
+
updated_network

logical default FALSE. If TRUE, updated network attributes from E2NHD and National Water Model retrieved from doi:10.5066/P976XCVT @@ -112,9 +114,7 @@

Arguments

Value

- - -

data.frame containing requested VAA data

+

data.frame containing requested VAA data

Details

@@ -130,7 +130,7 @@

Details

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
 # This will download the vaa file to the path from get_vaa_path()
 
 get_vaa("slope")
@@ -141,7 +141,7 @@ 

Examples

#cleanup if desired unlink(dirname(get_vaa_path()), recursive = TRUE) -} +} # }
@@ -156,15 +156,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_vaa_names.html b/docs/reference/get_vaa_names.html index 7ddb6ac3..5009220e 100644 --- a/docs/reference/get_vaa_names.html +++ b/docs/reference/get_vaa_names.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,7 +83,9 @@

Available NHDPlusV2 Attributes

Arguments

-
updated_network
+ + +
updated_network

logical default FALSE. If TRUE, updated network attributes from E2NHD and National Water Model retrieved from doi:10.5066/P976XCVT @@ -92,9 +94,7 @@

Arguments

Value

- - -

character vector

+

character vector

Details

@@ -110,13 +110,13 @@

Details

Examples

-
if (FALSE) {
+    
if (FALSE) { # \dontrun{
 # This will download the vaa file to the path from get_vaa_path()
 get_vaa_names()
 
 #cleanup if desired
 unlink(dirname(get_vaa_path()), recursive = TRUE)
-}
+} # }
 
@@ -131,15 +131,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_vaa_path.html b/docs/reference/get_vaa_path.html index e93ae703..85776fd3 100644 --- a/docs/reference/get_vaa_path.html +++ b/docs/reference/get_vaa_path.html @@ -6,7 +6,7 @@ - +
- +
@@ -89,16 +89,16 @@

File path to value added attribute (vaa) Cache

Arguments

-
updated_network
+ + +
updated_network

logical default FALSE. If TRUE, returns path to updated network parameters. See get_vaa for more.

Value

- - -

character file path

+

character file path

Details

@@ -134,15 +134,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_waterbodies.html b/docs/reference/get_waterbodies.html index e19bd861..f7bc98d7 100644 --- a/docs/reference/get_waterbodies.html +++ b/docs/reference/get_waterbodies.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,32 +85,32 @@

Find NHDPlusV2 Water Bodies

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
id
+
id

NHD Waterbody COMID(s)

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

Value

- - -

a simple features (sf) object

+

a simple features (sf) object

Details

@@ -135,15 +135,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_waterbody_index.html b/docs/reference/get_waterbody_index.html index ba3649bb..52397697 100644 --- a/docs/reference/get_waterbody_index.html +++ b/docs/reference/get_waterbody_index.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,21 +85,23 @@

Get Waterbody Index

Arguments

-
waterbodies
+ + +
waterbodies

sf data.frame of type POLYGON or MULTIPOLYGON including COMID attributes.

-
points
+
points

sfc of type POINT

-
flines
+
flines

sf data.frame of type LINESTRING or MULTILINESTRING including COMID, WBAREACOMI, and Hydroseq attributes

-
search_radius
+
search_radius

units class with a numeric value indicating how far to search for a waterbody boundary in units of provided projection. Set units with set_units.

@@ -107,9 +109,7 @@

Arguments

Value

- - -

data.frame with two columns, COMID, in_wb_COMID, near_wb_COMID, +

data.frame with two columns, COMID, in_wb_COMID, near_wb_COMID, near_wb_dist, and outlet_fline_COMID. Distance is in units of provided projection.

@@ -144,15 +144,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_wb_outlet.html b/docs/reference/get_wb_outlet.html index 4605423f..e1e2034f 100644 --- a/docs/reference/get_wb_outlet.html +++ b/docs/reference/get_wb_outlet.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,19 +83,19 @@

Get Waterbody Outlet

Arguments

-
lake_id
+ + +
lake_id

integer COMID (or character permanent identifier for hi res) of lake.

-
network
+
network

data.frame of network features containing wbareacomi, and Hydroseq

Value

- - -

sf data.frame with single record of network COMID +

sf data.frame with single record of network COMID associated with most-downstream reach in the NHD Waterbody

@@ -146,15 +146,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_xs_point-1.png b/docs/reference/get_xs_point-1.png index 0aeae885..7792c6a1 100644 Binary files a/docs/reference/get_xs_point-1.png and b/docs/reference/get_xs_point-1.png differ diff --git a/docs/reference/get_xs_point-2.png b/docs/reference/get_xs_point-2.png index 84304b38..bb825597 100644 Binary files a/docs/reference/get_xs_point-2.png and b/docs/reference/get_xs_point-2.png differ diff --git a/docs/reference/get_xs_point.html b/docs/reference/get_xs_point.html index c68c0cf2..f8e9caf9 100644 --- a/docs/reference/get_xs_point.html +++ b/docs/reference/get_xs_point.html @@ -6,7 +6,7 @@ - +
- +
@@ -89,24 +89,24 @@

Get Cross Section From Point (experimental)

Arguments

-
point
+ + +
point

sfc POINT including crs as created by: sf::st_sfc(sf::st_point(.. ,..), crs)crs.

-
width
+
width

Cross section width in meters.

-
num_pts
+
num_pts

numeric number of points to retrieve along the cross section.

Value

- - -

sf data.frame containing points retrieved.

+

sf data.frame containing points retrieved.

@@ -146,6 +146,10 @@

Examples

plot(xs$distance_m, xs$elevation_m) } +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 @@ -165,15 +169,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/get_xs_points-1.png b/docs/reference/get_xs_points-1.png index d8b58721..d4272280 100644 Binary files a/docs/reference/get_xs_points-1.png and b/docs/reference/get_xs_points-1.png differ diff --git a/docs/reference/get_xs_points.html b/docs/reference/get_xs_points.html index 06a9f7e0..c6d750e3 100644 --- a/docs/reference/get_xs_points.html +++ b/docs/reference/get_xs_points.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,29 +85,29 @@

Get Cross Section Endpoints (experimental)

Arguments

-
point1
+ + +
point1

sfc POINT including crs as created by: sf::st_sfc(sf::st_point(.. ,..), crs)

-
point2
+
point2

sfc POINT including crs.

-
num_pts
+
num_pts

numeric number of points to retrieve along the cross section.

-
res
+
res

integer resolution of 3D Elevation Program data to request. Must be on of: 1, 3, 5, 10, 30, 60.

Value

- - -

sf data.frame containing points retrieved.

+

sf data.frame containing points retrieved.

@@ -149,6 +149,10 @@

Examples

plot(xs$distance_m, xs$elevation_m) } +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 @@ -168,15 +172,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 68a67a18..fcfd464c 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,9 +1,9 @@ -Function reference • nhdplusToolsPackage index • nhdplusTools - +
- +
@@ -412,15 +412,15 @@

Network Attributes
-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/make_node_topology.html b/docs/reference/make_node_topology.html index ec54e2f8..9292852a 100644 --- a/docs/reference/make_node_topology.html +++ b/docs/reference/make_node_topology.html @@ -3,7 +3,7 @@ - +
- +
@@ -83,27 +83,27 @@

get node topology from edge topology (DEPRECATED)

Arguments

-
x
+ + +
x

data.frame with an identifier and to identifier in the first and second columns.

-
add_div
+
add_div

data.frame containing id and toid diverted paths to add. Should have id and toid fields in the first and second columns. Names are not used.

-
add
+
add

logical if TRUE, a tocomid column will be added, otherwise a data.frame with two columns will be returned.

Value

- - -

data.frame containing id, fromnode, and tonode attributes or all +

data.frame containing id, fromnode, and tonode attributes or all attributes provided with id, fromnode and tonode in the first three columns.

@@ -158,15 +158,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/make_standalone.html b/docs/reference/make_standalone.html index e3f76304..e7056178 100644 --- a/docs/reference/make_standalone.html +++ b/docs/reference/make_standalone.html @@ -6,7 +6,7 @@ - +
- +
@@ -89,15 +89,15 @@

Make isolated NHDPlusHR region a standalone dataset

Arguments

-
flowlines
+ + +
flowlines

sf data.frame of NHDPlusHR flowlines.

Value

- - -

sf data.frame containing standalone network

+

sf data.frame containing standalone network

@@ -208,15 +208,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/map_nhdplus.html b/docs/reference/map_nhdplus.html index 8c90aaac..409313fe 100644 --- a/docs/reference/map_nhdplus.html +++ b/docs/reference/map_nhdplus.html @@ -4,7 +4,7 @@ - +
- +
@@ -96,53 +96,53 @@

Make Interactive Map of NHDPlus

Arguments

-
outlets
+ + +
outlets

list of nldi outlets. Other inputs are coerced into nldi outlets, see details.

-
bbox
+
bbox

object of class bbox with a defined crs. See examples.

-
streamorder
+
streamorder

integer only streams of order greater than or equal will be returned

-
nhdplus_data
+
nhdplus_data

geopackage containing source nhdplus data (omit to download)

-
gpkg
+
gpkg

path and file with .gpkg ending. If omitted, no file is written.

-
flowline_only
+
flowline_only

boolean only subset and plot flowlines only, default=FALSE

-
plot_config
+
plot_config

list containing plot configuration, see details.

-
overwrite
+
overwrite

passed on the subset_nhdplus.

-
cache_data
+
cache_data

character path to rds file where all plot data can be cached. If file doesn't exist, it will be created. If set to FALSE, all caching will -be turned off -- this includes basemap tiles.

+be turned off – this includes basemap tiles.

-
return_map
+
return_map

if FALSE (default), a data.frame of plot data is returned invisibly in NAD83 Lat/Lon, if TRUE the leaflet object is returned

Value

- - -

data.frame or leaflet map (see return_map)

+

data.frame or leaflet map (see return_map)

Details

@@ -165,10 +165,22 @@

Details

Examples

# \donttest{
 map_nhdplus("05428500")
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
 
 map_nhdplus("05428500", streamorder = 2)
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
 
 map_nhdplus(list(13293970, 13293750))
+#> Spherical geometry (s2) switched off
+#> although coordinates are longitude/latitude, st_intersects assumes that they
+#> are planar
+#> Spherical geometry (s2) switched on
 
 source(system.file("extdata/sample_data.R", package = "nhdplusTools"))
 
@@ -176,6 +188,10 @@ 

Examples

#return leaflet object map_nhdplus("05428500", return_map = TRUE) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on # }
@@ -191,15 +207,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/navigate_network.html b/docs/reference/navigate_network.html index 6c70f58e..35720d46 100644 --- a/docs/reference/navigate_network.html +++ b/docs/reference/navigate_network.html @@ -5,7 +5,7 @@ - +
- +
@@ -96,38 +96,40 @@

Navigate Network

Arguments

-
start
+ + +
start

list, integer, sf, or sfc if list must be a valid NLDI feature if integer must be a valid comid. If sf, must contain a "comid" field.

-
mode
+
mode

character chosen from c(UM, DM, UT, or DD)

-
network
+
network

sf should be compatible with network navigation functions If NULL, network will be derived from requests to the NLDI

-
output
+
output

character flowline or a valid NLDI data source

-
distance_km
+
distance_km

numeric distance to navigate in km

-
trim_start
+
trim_start

logical should start be trimmed or include entire catchment?

-
trim_stop
+
trim_stop

logical should stop(s) be trimmed or include entire catchment(s)? # Not supported

-
trim_tolerance
+
trim_tolerance

numeric from 0 to 100 percent of flowline length. If amount to trim is less than this tolerance, no trim will be applied.

@@ -143,6 +145,8 @@

Examples

trim_start = TRUE) #> All intersections performed in latitude/longitude. #> Reading NHDFlowline_Network +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Writing NHDFlowline_Network #> Simple feature collection with 8 features and 137 fields #> Geometry type: LINESTRING @@ -202,15 +206,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/navigate_nldi-1.png b/docs/reference/navigate_nldi-1.png index 83d94cc6..44fd1351 100644 Binary files a/docs/reference/navigate_nldi-1.png and b/docs/reference/navigate_nldi-1.png differ diff --git a/docs/reference/navigate_nldi.html b/docs/reference/navigate_nldi.html index 98587a32..1ae3d8c6 100644 --- a/docs/reference/navigate_nldi.html +++ b/docs/reference/navigate_nldi.html @@ -3,7 +3,7 @@ - +
- +
@@ -88,31 +88,31 @@

Navigate NLDI

Arguments

-
nldi_feature
+ + +
nldi_feature

list with names `featureSource` and `featureID` where `featureSource` is derived from the "source" column of the response of get_nldi_sources and the `featureID` is a known identifier from the specified `featureSource`.

-
mode
+
mode

character chosen from ("UM", "UT", DM", "DD"). See examples.

-
data_source
+
data_source

character chosen from "source" column of the response of get_nldi_sources or empty string for flowline geometry.

-
distance_km
+
distance_km

numeric distance in km to stop navigating.

Value

- - -

sf data.frame with result

+

sf data.frame with result

@@ -144,18 +144,17 @@

Examples

nwissite -#> Simple feature collection with 4 features and 8 fields +#> Simple feature collection with 3 features and 8 fields #> Geometry type: POINT #> Dimension: XY -#> Bounding box: xmin: -89.45556 ymin: 43.08944 xmax: -89.36083 ymax: 43.14083 +#> Bounding box: xmin: -89.45556 ymin: 43.08944 xmax: -89.36083 ymax: 43.09986 #> Geodetic CRS: WGS 84 -#> # A tibble: 4 × 9 +#> # A tibble: 3 × 9 #> sourceName identifier comid measure reachcode name X Y #> <chr> <chr> <chr> <dbl> <chr> <chr> <dbl> <dbl> #> 1 NWIS Surface Water Sites USGS-05428… 1329… 1.37 07090002… LAKE… -89.4 43.1 #> 2 NWIS Surface Water Sites USGS-05428… 1329… 42.9 07090002… YAHA… -89.4 43.1 -#> 3 NWIS Surface Water Sites USGS-05427… 1329… 86.8 07090002… SIXM… -89.4 43.1 -#> 4 NWIS Surface Water Sites USGS-43060… 1329… 59.3 07090002… LAKE… -89.5 43.1 +#> 3 NWIS Surface Water Sites USGS-43060… 1329… 59.3 07090002… LAKE… -89.5 43.1 #> # ℹ 1 more variable: geometry <POINT [°]> # } @@ -173,15 +172,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/nhdplusTools_cache_settings.html b/docs/reference/nhdplusTools_cache_settings.html index 06c94911..ca7ba612 100644 --- a/docs/reference/nhdplusTools_cache_settings.html +++ b/docs/reference/nhdplusTools_cache_settings.html @@ -6,7 +6,7 @@ - +
- +
@@ -89,19 +89,19 @@

nhdplusTools cache settings

Arguments

-
mode
+ + +
mode

character 'memory' or 'filesystem'

-
timeout
+
timeout

numeric number of seconds until caches invalidate

Value

- - -

list containing settings at time of calling. If inputs are +

list containing settings at time of calling. If inputs are NULL, current settings. If settings are altered, previous setting values.

@@ -117,15 +117,15 @@

Value

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/nhdplusTools_data_dir.html b/docs/reference/nhdplusTools_data_dir.html index 3a8f7905..904f937b 100644 --- a/docs/reference/nhdplusTools_data_dir.html +++ b/docs/reference/nhdplusTools_data_dir.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,15 +85,15 @@

Get or set nhdplusTools data directory

Arguments

-
dir
+ + +
dir

path of desired data directory

Value

- - -

character path of data directory (silent when setting)

+

character path of data directory (silent when setting)

@@ -119,15 +119,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/nhdplus_path.html b/docs/reference/nhdplus_path.html index 44d76374..8a6442d6 100644 --- a/docs/reference/nhdplus_path.html +++ b/docs/reference/nhdplus_path.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,19 +87,19 @@

NHDPlus Data Path

Arguments

-
path
+ + +
path

character path ending in .gdb or .gpkg

-
warn
+
warn

boolean controls whether warning an status messages are printed

Value

- - -

0 (invisibly) if set successfully, character path if no input.

+

0 (invisibly) if set successfully, character path if no input.

@@ -125,15 +125,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/plot_nhdplus-1.png b/docs/reference/plot_nhdplus-1.png index 025527a6..d900b32c 100644 Binary files a/docs/reference/plot_nhdplus-1.png and b/docs/reference/plot_nhdplus-1.png differ diff --git a/docs/reference/plot_nhdplus-10.png b/docs/reference/plot_nhdplus-10.png index 989d6f7d..ebfa2967 100644 Binary files a/docs/reference/plot_nhdplus-10.png and b/docs/reference/plot_nhdplus-10.png differ diff --git a/docs/reference/plot_nhdplus-11.png b/docs/reference/plot_nhdplus-11.png index 65973ebe..085bbce2 100644 Binary files a/docs/reference/plot_nhdplus-11.png and b/docs/reference/plot_nhdplus-11.png differ diff --git a/docs/reference/plot_nhdplus-2.png b/docs/reference/plot_nhdplus-2.png index 59f81d01..aaaf5e68 100644 Binary files a/docs/reference/plot_nhdplus-2.png and b/docs/reference/plot_nhdplus-2.png differ diff --git a/docs/reference/plot_nhdplus-3.png b/docs/reference/plot_nhdplus-3.png index 83f437f4..c2f67001 100644 Binary files a/docs/reference/plot_nhdplus-3.png and b/docs/reference/plot_nhdplus-3.png differ diff --git a/docs/reference/plot_nhdplus-4.png b/docs/reference/plot_nhdplus-4.png index 878d503a..5a1fbf38 100644 Binary files a/docs/reference/plot_nhdplus-4.png and b/docs/reference/plot_nhdplus-4.png differ diff --git a/docs/reference/plot_nhdplus-5.png b/docs/reference/plot_nhdplus-5.png index 548b33fb..0abbc765 100644 Binary files a/docs/reference/plot_nhdplus-5.png and b/docs/reference/plot_nhdplus-5.png differ diff --git a/docs/reference/plot_nhdplus-6.png b/docs/reference/plot_nhdplus-6.png index b2c09497..2272acb7 100644 Binary files a/docs/reference/plot_nhdplus-6.png and b/docs/reference/plot_nhdplus-6.png differ diff --git a/docs/reference/plot_nhdplus-7.png b/docs/reference/plot_nhdplus-7.png index b2394dd6..84f960f9 100644 Binary files a/docs/reference/plot_nhdplus-7.png and b/docs/reference/plot_nhdplus-7.png differ diff --git a/docs/reference/plot_nhdplus-8.png b/docs/reference/plot_nhdplus-8.png index 724a40ab..668c11db 100644 Binary files a/docs/reference/plot_nhdplus-8.png and b/docs/reference/plot_nhdplus-8.png differ diff --git a/docs/reference/plot_nhdplus-9.png b/docs/reference/plot_nhdplus-9.png index ce5cf080..0013dc51 100644 Binary files a/docs/reference/plot_nhdplus-9.png and b/docs/reference/plot_nhdplus-9.png differ diff --git a/docs/reference/plot_nhdplus.html b/docs/reference/plot_nhdplus.html index 2de60ea7..9a8314b3 100644 --- a/docs/reference/plot_nhdplus.html +++ b/docs/reference/plot_nhdplus.html @@ -4,7 +4,7 @@ - +
- +
@@ -99,67 +99,67 @@

Plot NHDPlus

Arguments

-
outlets
+ + +
outlets

list of nldi outlets. Other inputs are coerced into nldi outlets, see details.

-
bbox
+
bbox

object of class bbox with a defined crs. See examples.

-
streamorder
+
streamorder

integer only streams of order greater than or equal will be returned

-
nhdplus_data
+
nhdplus_data

geopackage containing source nhdplus data (omit to download)

-
gpkg
+
gpkg

path and file with .gpkg ending. If omitted, no file is written.

-
plot_config
+
plot_config

list containing plot configuration, see details.

-
basemap
+
basemap

character indicating which basemap type to use. Chose from: get_tiles.

-
zoom
+
zoom

integer passed on to get_tiles. This value will override the default set by the package.

-
add
+
add

boolean should this plot be added to an already built map.

-
actually_plot
+
actually_plot

boolean actually draw the plot? Use to get data subset only.

-
overwrite
+
overwrite

passed on the subset_nhdplus.

-
flowline_only
+
flowline_only

boolean only subset and plot flowlines only, default=FALSE

-
cache_data
+
cache_data

character path to rds file where all plot data can be cached. If file doesn't exist, it will be created. If set to FALSE, all caching will -be turned off -- this includes basemap tiles.

+be turned off – this includes basemap tiles.

Value

- - -

data.frame plot data is returned invisibly in NAD83 Lat/Lon.

+

data.frame plot data is returned invisibly in NAD83 Lat/Lon.

Details

@@ -202,14 +202,26 @@

Examples

nhdplusTools_data_dir(tempdir()) plot_nhdplus("05428500") +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 11 plot_nhdplus("05428500", streamorder = 2) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 11 plot_nhdplus(list(13293970, 13293750)) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 10 @@ -225,8 +237,8 @@

Examples

list("huc12pp", "070900020602")), streamorder = 2, nhdplus_data = sample_data) -#> Error in: https://labs.waterdata.usgs.gov/api/nldi/linked-data/huc12pp_102020/070900020603/ -#> Error in: https://labs.waterdata.usgs.gov/api/nldi/linked-data/huc12pp_102020/070900020602/ +#> Error in: https://api.water.usgs.gov/nldi/linked-data/huc12pp_102020/070900020603/ +#> Error in: https://api.water.usgs.gov/nldi/linked-data/huc12pp_102020/070900020602/ #> Zoom set to: 10 @@ -248,8 +260,8 @@

Examples

plot_config = list(basin = list(lwd = 2), outlets = list(huc12pp = list(cex = 1.5), comid = list(col = "green")))) -#> Error in: https://labs.waterdata.usgs.gov/api/nldi/linked-data/huc12pp_102020/070900020603/ -#> Error in: https://labs.waterdata.usgs.gov/api/nldi/linked-data/huc12pp_102020/070900020602/ +#> Error in: https://api.water.usgs.gov/nldi/linked-data/huc12pp_102020/070900020603/ +#> Error in: https://api.water.usgs.gov/nldi/linked-data/huc12pp_102020/070900020602/ #> Zoom set to: 10 @@ -260,6 +272,8 @@

Examples

comids <- nhdplusTools::get_UT(fline, 13293970) plot_nhdplus(comids) +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Zoom set to: 11 @@ -270,6 +284,10 @@

Examples

# With downloaded data plot_nhdplus(bbox = bbox, streamorder = 3) +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> Zoom set to: 12 @@ -297,15 +315,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/prepare_nhdplus.html b/docs/reference/prepare_nhdplus.html index c1aa476c..4c70c983 100644 --- a/docs/reference/prepare_nhdplus.html +++ b/docs/reference/prepare_nhdplus.html @@ -3,7 +3,7 @@ - +
- +
@@ -93,55 +93,55 @@

Prep NHDPlus Data

Arguments

-
flines
+ + +
flines

data.frame NHDPlus flowlines including: COMID, LENGTHKM, FTYPE (or FCODE), TerminalFl, FromNode, ToNode, TotDASqKM, StartFlag, StreamOrde, StreamCalc, TerminalPa, Pathlength, and Divergence variables.

-
min_network_size
+
min_network_size

numeric Minimum size (sqkm) of drainage network to include in output.

-
min_path_length
+
min_path_length

numeric Minimum length (km) of terminal level path of a network.

-
min_path_size
+
min_path_size

numeric Minimum size (sqkm) of outlet level path of a drainage basin. Drainage basins with an outlet drainage area smaller than this will be removed.

-
purge_non_dendritic
+
purge_non_dendritic

logical Should non dendritic paths be removed or not.

-
warn
+
warn

logical controls whether warning an status messages are printed

-
error
+
error

logical controls whether to return potentially invalid data with a warning rather than an error

-
skip_toCOMID
+
skip_toCOMID

logical if TRUE, toCOMID will not be added to output.

-
align_names
+
align_names

logical

Value

- - -

data.frame ready to be used with the refactor_flowlines function.

+

data.frame ready to be used with the refactor_flowlines function.

@@ -866,15 +866,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/query_usgs_arcrest.html b/docs/reference/query_usgs_arcrest.html index da447347..866fbba8 100644 --- a/docs/reference/query_usgs_arcrest.html +++ b/docs/reference/query_usgs_arcrest.html @@ -4,7 +4,7 @@ - +
- +
@@ -93,48 +93,48 @@

Query USGS Hydro ESRI Rest Server

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
ids
+
ids

character. A set of identifier(s) from the data type requested, for 3dhp, this is id3dhp.

-
type
+
type

character. Type of feature to return ("hydrolocation", "flowline", "waterbody", "drainage area", "catchment"). If NULL (default) a data.frame of available resources is returned

-
where
+
where

character. An where clause to pass to the server.

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

-
page_size
+
page_size

numeric default number of features to request at a time. Reducing may help if 500 errors are experienced.

Value

- - -

a simple features (sf) object or valid types if no type supplied

+

a simple features (sf) object or valid types if no type supplied

Details

@@ -159,15 +159,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/query_usgs_geoserver.html b/docs/reference/query_usgs_geoserver.html index c0923045..871209b5 100644 --- a/docs/reference/query_usgs_geoserver.html +++ b/docs/reference/query_usgs_geoserver.html @@ -4,7 +4,7 @@ - +
- +
@@ -92,43 +92,43 @@

Query USGS Geoserver

Arguments

-
AOI
+ + +
AOI

sf (MULTI)POINT or (MULTI)POLYGON. An 'area of interest' can be provided as either a location (sf POINT) or area (sf POLYGON) in any Spatial Reference System.

-
ids
+
ids

character or numeric. A set of identifier(s) from the data type requested, for example if NHD, then a set of COMID(s).

-
type
+
type

character. Type of feature to return ('huc08','huc12', 'nhd', 'catchment', 'waterbodies', 'gagesII'). If NULL (default) a data.frame of available resources is returned

-
filter
+
filter

character. An XML filter to pass to httr POST query

-
t_srs
+
t_srs

character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.

-
buffer
+
buffer

numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5

Value

- - -

a simple features (sf) object

+

a simple features (sf) object

Details

@@ -153,15 +153,15 @@

Details

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index a1bb84a6..ad4b0008 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -10,7 +10,7 @@ - +
- +
@@ -103,15 +103,15 @@

Objects exported from other packages

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/rename_geometry.html b/docs/reference/rename_geometry.html index a22f05dc..75b897ea 100644 --- a/docs/reference/rename_geometry.html +++ b/docs/reference/rename_geometry.html @@ -1,142 +1,8 @@ - -rename_geometry — rename_geometry • nhdplusTools - - -
-
- - - -
-
- - -
-

correctly renames the geometry column -of a sf object.

-
- -
-
rename_geometry(g, name)
-
- -
-

Arguments

-
g
-

sf data.table

- - -
name
-

character name to be used for geometry

- -
- -
-

Examples

-

-(g <- sf::st_sf(a=3, geo = sf::st_sfc(sf::st_point(1:2))))
-#> Simple feature collection with 1 feature and 1 field
-#> Geometry type: POINT
-#> Dimension:     XY
-#> Bounding box:  xmin: 1 ymin: 2 xmax: 1 ymax: 2
-#> CRS:           NA
-#>   a         geo
-#> 1 3 POINT (1 2)
-rename_geometry(g, "geometry")
-#> Simple feature collection with 1 feature and 1 field
-#> Geometry type: POINT
-#> Dimension:     XY
-#> Bounding box:  xmin: 1 ymin: 2 xmax: 1 ymax: 2
-#> CRS:           NA
-#>   a    geometry
-#> 1 3 POINT (1 2)
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/rescale_catchment_characteristics.html b/docs/reference/rescale_catchment_characteristics.html index 24a63692..d39078ee 100644 --- a/docs/reference/rescale_catchment_characteristics.html +++ b/docs/reference/rescale_catchment_characteristics.html @@ -4,7 +4,7 @@ - +
- +
@@ -91,7 +91,9 @@

Rescale Catchment Characteristics

Arguments

-
vars
+ + +
vars

data.frame containing `characteristic_id` retrieved from get_characteristics_metadata and `summary_statistic` indicating which summary statistic should be applied to rescale each characteristic. @@ -99,7 +101,7 @@

Arguments

"min," and "max."

-
lookup_table
+
lookup_table

data.frame containing `id` numeric vector of identifiers at the desired scale; "comid" is a numeric vector of NHDPlusV2 identifiers; "member_comid" contains formatted NHDPlusV2 COMIDs indicating that the @@ -107,21 +109,21 @@

Arguments

the columns "comid" and "member_comid" should be identical.

-
refactored_areas
+
refactored_areas

data.frame containing columns "featureid" and "areasqkm." Used to retrieve adjusted catchment areas in the case of split catchments. If not provided, either no split catchments can be considered or the `catchment_areas` parameter is required.

-
catchment_characteristics
+
catchment_characteristics

data.frame containing columns "characteristic_id", "comid", "characteristic_value", and "percent_nodata". If not provided, it will be retrieved from get_catchment_characteristics using the characteristic ids from `vars` and the comids from `lookup_table`.

-
catchment_areas
+
catchment_areas

data.frame containing columns "comid", "areasqkm", "split_catchment_areasqkm", and "split_area_prop". If not provided, it will be retrieved from `refactored_areas` and/or get_vaa.

@@ -148,6 +150,24 @@

Examples

comid = c(4146596, 4147382), member_comid = c(4146596, 4147382)) rescale_catchment_characteristics(vars, lookup_table) +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. #> # A tibble: 1 × 6 #> id areasqkm_sum lengthkm_sum CAT_IMPV11_area_wtd percent_nodata_CAT_BA…¹ #> <dbl> <dbl> <dbl> <dbl> <dbl> @@ -161,6 +181,24 @@

Examples

comid = c(4146596, 4147382), member_comid = c(4146596, 4147382)) rescale_catchment_characteristics(vars, lookup_table) +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. #> # A tibble: 1 × 7 #> id areasqkm_sum lengthkm_sum percent_nodata_CAT_E…¹ percent_nodata_CAT_E…² #> <dbl> <dbl> <dbl> <dbl> <dbl> @@ -177,6 +215,33 @@

Examples

comid_areas <- data.frame(featureid = c("4146596", "4147382", "4147396.1", "4147396.2"), areasqkm = c(0.9558, 11.9790, 6.513294, 1.439999)) rescale_catchment_characteristics(vars, lookup_table, refactored_areas = comid_areas) +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. +#> Warning: Potentially unsafe or invalid elements have been discarded from R metadata. +#> Type: "externalptr" +#> → If you trust the source, you can set `options(arrow.unsafe_metadata = TRUE)` to preserve them. #> # A tibble: 3 × 9 #> id areasqkm_sum lengthkm_sum CAT_EWT_area_wtd CAT_TWI_area_wtd #> <dbl> <dbl> <dbl> <dbl> <dbl> @@ -203,15 +268,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/rescale_measures.html b/docs/reference/rescale_measures.html index 446e9ecb..75b897ea 100644 --- a/docs/reference/rescale_measures.html +++ b/docs/reference/rescale_measures.html @@ -1,153 +1,8 @@ - -Rescale reachcode measure to comid flowline measure — rescale_measures • nhdplusTools - - -
-
- - - -
-
- - -
-

Given a reachcode measure and the from and to measure for a -comid flowline, returns the measure along the comid flowline. This is -a utility specific to the NHDPlus data model where many comid flowlines make -up a single reachcode / reach. "Measures" are typically referenced to -reaches. Flowlines have a stated from-measure / to-measure. In some cases -it is useful to rescale the measure such that it is relative only to the -flowline.

-

from is downstream -- 0 is the outlet -to is upstream -- 100 is the inlet

-
- -
-
rescale_measures(measure, from, to)
-
- -
-

Arguments

-
measure
-

numeric reach measure between 0 and 100

- - -
from
-

numeric flowline from-measure relative to the reach

- - -
to
-

numeric flowline to-measure relative to the reach

- -
-
-

Value

- - -

numeric rescaled measure

-
- -
-

Examples

-
rescale_measures(40, 0, 50)
-#> [1] 80
-rescale_measures(60, 50, 100)
-#> [1] 20
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/rpu_boundaries.html b/docs/reference/rpu_boundaries.html index b5e2afa1..b9bad4ba 100644 --- a/docs/reference/rpu_boundaries.html +++ b/docs/reference/rpu_boundaries.html @@ -4,7 +4,7 @@ - +
- +
@@ -100,15 +100,15 @@

Format

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/st_compatibalize.html b/docs/reference/st_compatibalize.html index a0c45d00..75b897ea 100644 --- a/docs/reference/st_compatibalize.html +++ b/docs/reference/st_compatibalize.html @@ -1,194 +1,8 @@ - -make spatial inputs compatible — st_compatibalize • nhdplusTools - - -
-
- - - -
-
- - -
-

makes sf1 compatible with sf2 by projecting into -the projection of 2 and ensuring that the geometry columns are the -same name.

-
- -
-
st_compatibalize(sf1, sf2)
-
- -
-

Arguments

-
sf1
-

sf data.frame

- - -
sf2
-

sf data.frame

- -
- -
-

Examples

-

-source(system.file("extdata", "sample_flines.R", package = "nhdplusTools"))
-
-(one <- dplyr::select(sample_flines))
-#> Simple feature collection with 707 features and 0 fields
-#> Geometry type: MULTILINESTRING
-#> Dimension:     XY
-#> Bounding box:  xmin: -77.16175 ymin: 39.11307 xmax: -76.43622 ymax: 39.64679
-#> Geodetic CRS:  WGS 84
-#> # A tibble: 707 × 1
-#>                                                                             geom
-#>                                                            <MULTILINESTRING [°]>
-#>  1 ((-76.66157 39.27636, -76.6614 39.27636, -76.66057 39.27545, -76.66051 39.27…
-#>  2 ((-76.65498 39.27543, -76.65436 39.27497, -76.65398 39.27431, -76.65386 39.2…
-#>  3 ((-76.64835 39.27115, -76.64812 39.27115, -76.64771 39.2709, -76.64662 39.27…
-#>  4 ((-76.63034 39.2693, -76.63021 39.26919, -76.62808 39.26881, -76.62708 39.26…
-#>  5 ((-76.61201 39.25434, -76.61183 39.25413, -76.61068 39.25344, -76.60962 39.2…
-#>  6 ((-76.68668 39.30612, -76.68492 39.30628, -76.6835 39.30608, -76.68218 39.30…
-#>  7 ((-76.71434 39.32628, -76.71457 39.32592, -76.7146 39.32432, -76.71425 39.32…
-#>  8 ((-76.72432 39.32412, -76.7235 39.32383, -76.72247 39.32387, -76.72152 39.32…
-#>  9 ((-76.73594 39.34748, -76.73455 39.34652, -76.73208 39.34574, -76.73143 39.3…
-#> 10 ((-76.7446 39.36049, -76.7446 39.35959, -76.74451 39.35934, -76.74424 39.359…
-#> # ℹ 697 more rows
-(two <- sf::st_transform(one, 5070))
-#> Simple feature collection with 707 features and 0 fields
-#> Geometry type: MULTILINESTRING
-#> Dimension:     XY
-#> Bounding box:  xmin: 1597686 ymin: 1956259 xmax: 1663643 ymax: 2010159
-#> Projected CRS: NAD83 / Conus Albers
-#> # A tibble: 707 × 1
-#>                                                                             geom
-#>  *                                                         <MULTILINESTRING [m]>
-#>  1 ((1641586 1973488, 1641601 1973491, 1641690 1973404, 1641699 1973388, 164172…
-#>  2 ((1642159 1973499, 1642221 1973459, 1642268 1973393, 1642289 1973342, 164233…
-#>  3 ((1642811 1973144, 1642831 1973148, 1642871 1973127, 1642970 1973109, 164303…
-#>  4 ((1644361 1973252, 1644374 1973243, 1644561 1973238, 1644645 1973252, 164474…
-#>  5 ((1646235 1971928, 1646255 1971908, 1646367 1971852, 1646465 1971824, 164695…
-#>  6 ((1638811 1976321, 1638955 1976369, 1639078 1976371, 1639181 1976429, 163923…
-#>  7 ((1636041 1978058, 1636030 1978013, 1636063 1977837, 1636107 1977775, 163625…
-#>  8 ((1635254 1977649, 1635330 1977630, 1635415 1977653, 1635482 1977730, 163554…
-#>  9 ((1633756 1980012, 1633893 1979931, 1634118 1979888, 1634173 1979894, 163427…
-#> 10 ((1632738 1981292, 1632758 1981194, 1632771 1981168, 1632799 1981145, 163287…
-#> # ℹ 697 more rows
-
-attr(one, "sf_column") <- "geotest"
-names(one)[names(one) == "geom"] <- "geotest"
-
-st_compatibalize(one, two)
-#> Simple feature collection with 707 features and 0 fields
-#> Geometry type: MULTILINESTRING
-#> Dimension:     XY
-#> Bounding box:  xmin: 1597686 ymin: 1956259 xmax: 1663643 ymax: 2010159
-#> Projected CRS: NAD83 / Conus Albers
-#> # A tibble: 707 × 1
-#>                                                                             geom
-#>  *                                                         <MULTILINESTRING [m]>
-#>  1 ((1641586 1973488, 1641601 1973491, 1641690 1973404, 1641699 1973388, 164172…
-#>  2 ((1642159 1973499, 1642221 1973459, 1642268 1973393, 1642289 1973342, 164233…
-#>  3 ((1642811 1973144, 1642831 1973148, 1642871 1973127, 1642970 1973109, 164303…
-#>  4 ((1644361 1973252, 1644374 1973243, 1644561 1973238, 1644645 1973252, 164474…
-#>  5 ((1646235 1971928, 1646255 1971908, 1646367 1971852, 1646465 1971824, 164695…
-#>  6 ((1638811 1976321, 1638955 1976369, 1639078 1976371, 1639181 1976429, 163923…
-#>  7 ((1636041 1978058, 1636030 1978013, 1636063 1977837, 1636107 1977775, 163625…
-#>  8 ((1635254 1977649, 1635330 1977630, 1635415 1977653, 1635482 1977730, 163554…
-#>  9 ((1633756 1980012, 1633893 1979931, 1634118 1979888, 1634173 1979894, 163427…
-#> 10 ((1632738 1981292, 1632758 1981194, 1632771 1981168, 1632799 1981145, 163287…
-#> # ℹ 697 more rows
-
-
-
-
- -
- - -
- -
-

Site built with pkgdown 2.0.7.

-
- -
- - - - - - - + + + + + + + diff --git a/docs/reference/subset_nhdplus.html b/docs/reference/subset_nhdplus.html index 0a1108c3..5df01a02 100644 --- a/docs/reference/subset_nhdplus.html +++ b/docs/reference/subset_nhdplus.html @@ -7,7 +7,7 @@ - +
- +
@@ -103,16 +103,18 @@

Subset NHDPlus

Arguments

-
comids
+ + +
comids

integer vector of COMIDs to include.

-
output_file
+
output_file

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

-
nhdplus_data
+
nhdplus_data

character path to the .gpkg or .gdb containing the national seamless database, a subset of NHDPlusHR, or "download" to use a web service to download NHDPlusV2.1 data. @@ -120,48 +122,46 @@

Arguments

has been adopted. See details for more.

-
bbox
+
bbox

object of class "bbox" as returned by sf::st_bbox in Latitude/Longitude. If no CRS is present, will be assumed to be in WGS84 Latitude Longitude.

-
simplified
+
simplified

boolean if TRUE (the default) the CatchmentSP layer will be included. Not relevant to the "download" option or NHDPlusHR data.

-
overwrite
+
overwrite

boolean should the output file be overwritten

-
return_data
+
return_data

boolean if FALSE path to output file is returned silently otherwise data is returned in a list.

-
status
+
status

boolean should the function print status messages

-
flowline_only
+
flowline_only

boolean WARNING: experimental if TRUE only the flowline network and attributes will be returned

-
streamorder
+
streamorder

integer only streams of order greater than or equal will be downloaded. Not implemented for local data.

-
out_prj
+
out_prj

character override the default output CRS of NAD83 lat/lon (EPSG:4269)

Value

- - -

character path to the saved subset geopackage

+

character path to the saved subset geopackage

Details

@@ -319,9 +319,25 @@

Examples

status = TRUE, flowline_only = FALSE) #> All intersections performed in latitude/longitude. #> Reading NHDFlowline_Network +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Writing NHDFlowline_Network #> Reading CatchmentSP +#> Spherical geometry (s2) switched off +#> Spherical geometry (s2) switched on #> Writing CatchmentSP +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on +#> Spherical geometry (s2) switched off +#> although coordinates are longitude/latitude, st_intersects assumes that they +#> are planar +#> Spherical geometry (s2) switched on #> $NHDFlowline_Network #> Simple feature collection with 168 features and 137 fields #> Geometry type: LINESTRING @@ -505,15 +521,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/subset_rpu.html b/docs/reference/subset_rpu.html index 014e9eb0..345b1ad1 100644 --- a/docs/reference/subset_rpu.html +++ b/docs/reference/subset_rpu.html @@ -5,7 +5,7 @@ - +
- +
@@ -87,31 +87,31 @@

Subset by Raster Processing Unit

Arguments

-
fline
+ + +
fline

sf data.frame NHD Flowlines with comid, pathlength, lengthkm, hydroseq, levelpathi, rpuid, and arbolatesu (dnhydroseq is required if tocomid is not provided).

-
rpu
+
rpu

character e.g. "01a"

-
run_make_standalone
+
run_make_standalone

logical default TRUE should the run_make_standalone function be run on result?

-
strict
+
strict

logical if TRUE, paths that extend outside the RPU but have no tributaries in the upstream RPU will be included in the output.

Value

- - -

data.frame containing subset network

+

data.frame containing subset network

@@ -164,15 +164,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/subset_vpu.html b/docs/reference/subset_vpu.html index 982b2386..bc7bdd6a 100644 --- a/docs/reference/subset_vpu.html +++ b/docs/reference/subset_vpu.html @@ -4,7 +4,7 @@ - +
- +
@@ -85,32 +85,32 @@

Subset by Vector Processing Unit

Arguments

-
fline
+ + +
fline

sf data.frame NHD Flowlines with comid, pathlength, lengthkm, hydroseq, levelpathi, rpuid, vpuid, and arbolatesu (dnhydroseq is required if tocomid is not provided).

-
vpu
+
vpu

character e.g. "01"

-
include_null_rpuid
+
include_null_rpuid

logical default TRUE. Note that there are some flowlines that may have a NULL rpuid but be included in the vector processing unit.

-
run_make_standalone
+
run_make_standalone

logical default TRUE should the run_make_standalone function be run on result?

Value

- - -

data.frame containing subset network

+

data.frame containing subset network

@@ -163,15 +163,15 @@

Examples

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/reference/vpu_boundaries.html b/docs/reference/vpu_boundaries.html index 0f192b63..c9451c0c 100644 --- a/docs/reference/vpu_boundaries.html +++ b/docs/reference/vpu_boundaries.html @@ -4,7 +4,7 @@ - +
- +
@@ -100,15 +100,15 @@

Format

-

Site built with pkgdown 2.0.9.

+

Site built with pkgdown 2.1.1.

- - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 6ca8e0cf..59499b6a 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,324 +1,103 @@ - - - - https://doi-usgs.github.io/nhdplusTools/3dhp_demo.html - - - https://doi-usgs.github.io/nhdplusTools/404.html - - - https://doi-usgs.github.io/nhdplusTools/articles/advanced_network.html - - - https://doi-usgs.github.io/nhdplusTools/articles/get_3dhp_data.html - - - https://doi-usgs.github.io/nhdplusTools/articles/get_data_overview.html - - - https://doi-usgs.github.io/nhdplusTools/articles/index.html - - - https://doi-usgs.github.io/nhdplusTools/articles/indexing.html - - - https://doi-usgs.github.io/nhdplusTools/articles/nhdplushr.html - - - https://doi-usgs.github.io/nhdplusTools/articles/nhdplusTools.html - - - https://doi-usgs.github.io/nhdplusTools/articles/plot_nhdplus.html - - - https://doi-usgs.github.io/nhdplusTools/articles/point_indexing.html - - - https://doi-usgs.github.io/nhdplusTools/articles/US_data.html - - - https://doi-usgs.github.io/nhdplusTools/authors.html - - - https://doi-usgs.github.io/nhdplusTools/awra_2019/index.html - - - https://doi-usgs.github.io/nhdplusTools/DISCLAIMER.html - - - https://doi-usgs.github.io/nhdplusTools/index.html - - - https://doi-usgs.github.io/nhdplusTools/LICENSE-text.html - - - https://doi-usgs.github.io/nhdplusTools/LICENSE.html - - - https://doi-usgs.github.io/nhdplusTools/news/index.html - - - https://doi-usgs.github.io/nhdplusTools/reference/add_plus_network_attributes.html - - - https://doi-usgs.github.io/nhdplusTools/reference/align_nhdplus_names.html - - - https://doi-usgs.github.io/nhdplusTools/reference/calculate_arbolate_sum.html - - - https://doi-usgs.github.io/nhdplusTools/reference/calculate_total_drainage_area.html - - - https://doi-usgs.github.io/nhdplusTools/reference/disambiguate_flowline_indexes.html - - - https://doi-usgs.github.io/nhdplusTools/reference/discover_geoconnex_reference.html - - - https://doi-usgs.github.io/nhdplusTools/reference/discover_nhdplus_id.html - - - https://doi-usgs.github.io/nhdplusTools/reference/discover_nldi_characteristics.html - - - https://doi-usgs.github.io/nhdplusTools/reference/download_nhd.html - - - https://doi-usgs.github.io/nhdplusTools/reference/download_nhdplushr.html - - - https://doi-usgs.github.io/nhdplusTools/reference/download_nhdplusv2.html - - - https://doi-usgs.github.io/nhdplusTools/reference/download_rf1.html - - - https://doi-usgs.github.io/nhdplusTools/reference/download_vaa.html - - - https://doi-usgs.github.io/nhdplusTools/reference/download_wbd.html - - - https://doi-usgs.github.io/nhdplusTools/reference/fix_flowdir.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_3dhp.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_boundaries.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_catchment_characteristics.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_characteristics_metadata.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_DD.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_DM.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_elev_along_path.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_flowline_index.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_gagesII.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_geoconnex_reference.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_hr_data.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_huc.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_huc12.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_huc8.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_hydro_location.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_levelpaths.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nhdarea.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nhdplus.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nhdplushr.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_basin.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_characteristics.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_feature.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_index.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_node.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_nwis.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_partial_length.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_pathlength.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_path_lengths.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_path_members.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_pfaf.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_raindrop_trace.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_sorted.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_split_catchment.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_streamlevel.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_streamorder.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_terminal.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_tocomid.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_UM.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_UT.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_vaa.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_vaa_names.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_vaa_path.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_waterbodies.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_waterbody_index.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_wb_outlet.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_xs_point.html - - - https://doi-usgs.github.io/nhdplusTools/reference/get_xs_points.html - - - https://doi-usgs.github.io/nhdplusTools/reference/index.html - - - https://doi-usgs.github.io/nhdplusTools/reference/make_node_topology.html - - - https://doi-usgs.github.io/nhdplusTools/reference/make_standalone.html - - - https://doi-usgs.github.io/nhdplusTools/reference/map_nhdplus.html - - - https://doi-usgs.github.io/nhdplusTools/reference/navigate_network.html - - - https://doi-usgs.github.io/nhdplusTools/reference/navigate_nldi.html - - - https://doi-usgs.github.io/nhdplusTools/reference/nhdplusTools_cache_settings.html - - - https://doi-usgs.github.io/nhdplusTools/reference/nhdplusTools_data_dir.html - - - https://doi-usgs.github.io/nhdplusTools/reference/nhdplus_path.html - - - https://doi-usgs.github.io/nhdplusTools/reference/plot_nhdplus.html - - - https://doi-usgs.github.io/nhdplusTools/reference/prepare_nhdplus.html - - - https://doi-usgs.github.io/nhdplusTools/reference/query_usgs_arcrest.html - - - https://doi-usgs.github.io/nhdplusTools/reference/query_usgs_geoserver.html - - - https://doi-usgs.github.io/nhdplusTools/reference/reexports.html - - - https://doi-usgs.github.io/nhdplusTools/reference/rename_geometry.html - - - https://doi-usgs.github.io/nhdplusTools/reference/rescale_catchment_characteristics.html - - - https://doi-usgs.github.io/nhdplusTools/reference/rescale_measures.html - - - https://doi-usgs.github.io/nhdplusTools/reference/rpu.html - - - https://doi-usgs.github.io/nhdplusTools/reference/rpu_boundaries.html - - - https://doi-usgs.github.io/nhdplusTools/reference/stage_national_data.html - - - https://doi-usgs.github.io/nhdplusTools/reference/st_compatibalize.html - - - https://doi-usgs.github.io/nhdplusTools/reference/subset_nhdplus.html - - - https://doi-usgs.github.io/nhdplusTools/reference/subset_rpu.html - - - https://doi-usgs.github.io/nhdplusTools/reference/subset_vpu.html - - - https://doi-usgs.github.io/nhdplusTools/reference/vpu.html - - - https://doi-usgs.github.io/nhdplusTools/reference/vpu_boundaries.html - + +https://doi-usgs.github.io/nhdplusTools/3dhp_demo.html +https://doi-usgs.github.io/nhdplusTools/404.html +https://doi-usgs.github.io/nhdplusTools/articles/advanced_network.html +https://doi-usgs.github.io/nhdplusTools/articles/get_3dhp_data.html +https://doi-usgs.github.io/nhdplusTools/articles/get_data_overview.html +https://doi-usgs.github.io/nhdplusTools/articles/index.html +https://doi-usgs.github.io/nhdplusTools/articles/indexing.html +https://doi-usgs.github.io/nhdplusTools/articles/nhdplushr.html +https://doi-usgs.github.io/nhdplusTools/articles/nhdplusTools.html +https://doi-usgs.github.io/nhdplusTools/articles/plot_nhdplus.html +https://doi-usgs.github.io/nhdplusTools/articles/point_indexing.html +https://doi-usgs.github.io/nhdplusTools/articles/US_data.html +https://doi-usgs.github.io/nhdplusTools/authors.html +https://doi-usgs.github.io/nhdplusTools/awra_2019/index.html +https://doi-usgs.github.io/nhdplusTools/DISCLAIMER.html +https://doi-usgs.github.io/nhdplusTools/index.html +https://doi-usgs.github.io/nhdplusTools/LICENSE-text.html +https://doi-usgs.github.io/nhdplusTools/LICENSE.html +https://doi-usgs.github.io/nhdplusTools/news/index.html +https://doi-usgs.github.io/nhdplusTools/reference/add_plus_network_attributes.html +https://doi-usgs.github.io/nhdplusTools/reference/align_nhdplus_names.html +https://doi-usgs.github.io/nhdplusTools/reference/calculate_arbolate_sum.html +https://doi-usgs.github.io/nhdplusTools/reference/calculate_total_drainage_area.html +https://doi-usgs.github.io/nhdplusTools/reference/disambiguate_flowline_indexes.html +https://doi-usgs.github.io/nhdplusTools/reference/discover_geoconnex_reference.html +https://doi-usgs.github.io/nhdplusTools/reference/discover_nhdplus_id.html +https://doi-usgs.github.io/nhdplusTools/reference/discover_nldi_characteristics.html +https://doi-usgs.github.io/nhdplusTools/reference/download_nhd.html +https://doi-usgs.github.io/nhdplusTools/reference/download_nhdplushr.html +https://doi-usgs.github.io/nhdplusTools/reference/download_nhdplusv2.html +https://doi-usgs.github.io/nhdplusTools/reference/download_rf1.html +https://doi-usgs.github.io/nhdplusTools/reference/download_vaa.html +https://doi-usgs.github.io/nhdplusTools/reference/download_wbd.html +https://doi-usgs.github.io/nhdplusTools/reference/get_3dhp.html +https://doi-usgs.github.io/nhdplusTools/reference/get_boundaries.html +https://doi-usgs.github.io/nhdplusTools/reference/get_catchment_characteristics.html +https://doi-usgs.github.io/nhdplusTools/reference/get_characteristics_metadata.html +https://doi-usgs.github.io/nhdplusTools/reference/get_DD.html +https://doi-usgs.github.io/nhdplusTools/reference/get_DM.html +https://doi-usgs.github.io/nhdplusTools/reference/get_elev_along_path.html +https://doi-usgs.github.io/nhdplusTools/reference/get_flowline_index.html +https://doi-usgs.github.io/nhdplusTools/reference/get_gagesII.html +https://doi-usgs.github.io/nhdplusTools/reference/get_geoconnex_reference.html +https://doi-usgs.github.io/nhdplusTools/reference/get_hr_data.html +https://doi-usgs.github.io/nhdplusTools/reference/get_huc.html +https://doi-usgs.github.io/nhdplusTools/reference/get_huc12.html +https://doi-usgs.github.io/nhdplusTools/reference/get_huc8.html +https://doi-usgs.github.io/nhdplusTools/reference/get_levelpaths.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nhdarea.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nhdplus.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nhdplushr.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_basin.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_characteristics.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_feature.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nldi_index.html +https://doi-usgs.github.io/nhdplusTools/reference/get_nwis.html +https://doi-usgs.github.io/nhdplusTools/reference/get_pathlength.html +https://doi-usgs.github.io/nhdplusTools/reference/get_path_lengths.html +https://doi-usgs.github.io/nhdplusTools/reference/get_path_members.html +https://doi-usgs.github.io/nhdplusTools/reference/get_pfaf.html +https://doi-usgs.github.io/nhdplusTools/reference/get_raindrop_trace.html +https://doi-usgs.github.io/nhdplusTools/reference/get_sorted.html +https://doi-usgs.github.io/nhdplusTools/reference/get_split_catchment.html +https://doi-usgs.github.io/nhdplusTools/reference/get_streamlevel.html +https://doi-usgs.github.io/nhdplusTools/reference/get_streamorder.html +https://doi-usgs.github.io/nhdplusTools/reference/get_terminal.html +https://doi-usgs.github.io/nhdplusTools/reference/get_tocomid.html +https://doi-usgs.github.io/nhdplusTools/reference/get_UM.html +https://doi-usgs.github.io/nhdplusTools/reference/get_UT.html +https://doi-usgs.github.io/nhdplusTools/reference/get_vaa.html +https://doi-usgs.github.io/nhdplusTools/reference/get_vaa_names.html +https://doi-usgs.github.io/nhdplusTools/reference/get_vaa_path.html +https://doi-usgs.github.io/nhdplusTools/reference/get_waterbodies.html +https://doi-usgs.github.io/nhdplusTools/reference/get_waterbody_index.html +https://doi-usgs.github.io/nhdplusTools/reference/get_wb_outlet.html +https://doi-usgs.github.io/nhdplusTools/reference/get_xs_point.html +https://doi-usgs.github.io/nhdplusTools/reference/get_xs_points.html +https://doi-usgs.github.io/nhdplusTools/reference/index.html +https://doi-usgs.github.io/nhdplusTools/reference/make_node_topology.html +https://doi-usgs.github.io/nhdplusTools/reference/make_standalone.html +https://doi-usgs.github.io/nhdplusTools/reference/map_nhdplus.html +https://doi-usgs.github.io/nhdplusTools/reference/navigate_network.html +https://doi-usgs.github.io/nhdplusTools/reference/navigate_nldi.html +https://doi-usgs.github.io/nhdplusTools/reference/nhdplusTools_cache_settings.html +https://doi-usgs.github.io/nhdplusTools/reference/nhdplusTools_data_dir.html +https://doi-usgs.github.io/nhdplusTools/reference/nhdplus_path.html +https://doi-usgs.github.io/nhdplusTools/reference/plot_nhdplus.html +https://doi-usgs.github.io/nhdplusTools/reference/prepare_nhdplus.html +https://doi-usgs.github.io/nhdplusTools/reference/query_usgs_arcrest.html +https://doi-usgs.github.io/nhdplusTools/reference/query_usgs_geoserver.html +https://doi-usgs.github.io/nhdplusTools/reference/reexports.html +https://doi-usgs.github.io/nhdplusTools/reference/rescale_catchment_characteristics.html +https://doi-usgs.github.io/nhdplusTools/reference/rpu.html +https://doi-usgs.github.io/nhdplusTools/reference/rpu_boundaries.html +https://doi-usgs.github.io/nhdplusTools/reference/stage_national_data.html +https://doi-usgs.github.io/nhdplusTools/reference/subset_nhdplus.html +https://doi-usgs.github.io/nhdplusTools/reference/subset_rpu.html +https://doi-usgs.github.io/nhdplusTools/reference/subset_vpu.html +https://doi-usgs.github.io/nhdplusTools/reference/vpu.html +https://doi-usgs.github.io/nhdplusTools/reference/vpu_boundaries.html + diff --git a/man/get_huc.Rd b/man/get_huc.Rd index 829ba9a0..c2e28e98 100644 --- a/man/get_huc.Rd +++ b/man/get_huc.Rd @@ -28,7 +28,7 @@ Watershed Boundary Dataset from October, 2020. See for full source data. -See https://labs.waterdata.usgs.gov/geoserver/web/ for the web service. +See https://api.water.usgs.gov/geoserver/web/ for the web service. `huc12_nhdplusv2` derives from a snapshot of the WBD available from the nhdplusv2. See \link{download_nhdplusv2} for source data documentation.} diff --git a/tests/testthat/test_00_plot_local_nhdplus.R b/tests/testthat/test_00_plot_local_nhdplus.R index 85be6c78..9219e9e5 100644 --- a/tests/testthat/test_00_plot_local_nhdplus.R +++ b/tests/testthat/test_00_plot_local_nhdplus.R @@ -1,7 +1,7 @@ source(system.file("extdata/sample_data.R", package = "nhdplusTools")) test_that("local data", { - + testthat::skip_on_ci() # For test performance Sys.setenv(MAKE_BASIN="FALSE") options("rgdal_show_exportToProj4_warnings"="none") diff --git a/tests/testthat/test_00_plot_nhdplus.R b/tests/testthat/test_00_plot_nhdplus.R index 729a8ac0..1c7b10df 100644 --- a/tests/testthat/test_00_plot_nhdplus.R +++ b/tests/testthat/test_00_plot_nhdplus.R @@ -2,6 +2,7 @@ source(system.file("extdata/sample_data.R", package = "nhdplusTools")) test_that("tile_cache_dir", { + testthat::skip_on_ci() testthat::skip_on_cran() dir <- nhdplusTools:::tile_cache_dir() @@ -25,6 +26,7 @@ test_that("tile_cache_dir", { }) test_that("test_as_outlets", { + testthat::skip_on_ci() expect_equal(nhdplusTools:::as_outlets(NULL), NULL) o <- list(13293970, 13293971) @@ -94,6 +96,7 @@ test_that("test_as_outlets", { }) test_that("test_styles", { + testthat::skip_on_ci() st <- nhdplusTools:::get_styles(NULL) expect_named(st, c("basin", "flowline", "network_wtbd", "off_network_wtbd","outlets")) @@ -125,6 +128,7 @@ test_that("test_styles", { }) test_that("comids", { + testthat::skip_on_ci() Sys.setenv(MAKE_BASIN="FALSE") testthat::skip_on_cran() @@ -156,6 +160,7 @@ test_that("comids", { }) test_that("waterbodies", { + testthat::skip_on_ci() testthat::skip_on_cran() site <- "USGS-05428500" tempd <- tempdir(check = TRUE) @@ -166,7 +171,7 @@ test_that("waterbodies", { expect_equal(names(d), c("plot_bbox", "outlets", "flowline", "basin", "catchment","network_wtbd", "off_network_wtbd")) - + Sys.sleep(2) d <- nhdplusTools:::plot_nhdplus(site, flowline_only = FALSE, cache_data = FALSE) @@ -192,12 +197,15 @@ test_that("waterbodies", { }) test_that("get_waterbody_outlet", { + testthat::skip_on_ci() testthat::skip_on_cran() lake_comid <- 13293262 site <- "USGS-05428500" tempd <- tempdir(check = TRUE) g_temp <- file.path(tempd, "foo.gpkg") + Sys.sleep(2) + d <- nhdplusTools:::get_plot_data(site, gpkg = g_temp, flowline_only = FALSE) out <- nhdplusTools:::get_wb_outlet(lake_comid, d$flowline) diff --git a/tests/testthat/test_01_get_nldi.R b/tests/testthat/test_01_get_nldi.R index a24bcb12..cba5949d 100644 --- a/tests/testthat/test_01_get_nldi.R +++ b/tests/testthat/test_01_get_nldi.R @@ -59,7 +59,7 @@ test_that("navigation works", { "data source specified as flowline or '' is deprecated") nav <- navigate_nldi(nldi_feature = nldi_nwis, - mode = "https://labs.waterdata.usgs.gov/api/nldi/linked-data/nwissite/USGS-08279500/navigation/UM", + mode = "https://api.water.usgs.gov/api/nldi/linked-data/nwissite/USGS-08279500/navigation/UM", data_source = "dumb", distance_km = 1) @@ -68,7 +68,7 @@ test_that("navigation works", { expect_equal(class(nav$origin$comid), "character") nav <- navigate_nldi(nldi_feature = nldi_nwis, - mode = "https://labs.waterdata.usgs.gov/api/nldi/linked-data/nwissite/USGS-08279500/navigation/UM", + mode = "https://api.water.usgs.gov/api/nldi/linked-data/nwissite/USGS-08279500/navigation/UM", data_source = "nwissite", distance_km = 1) @@ -84,6 +84,7 @@ test_that("basin works", { skip_on_cran() skip_on_ci() + skip("nldi split basin not working?") nldi_nwis <- list(featureSource = "nwissite", featureID = "USGS-05428500") @@ -258,7 +259,7 @@ test_that("xs", { skip_on_cran() - skip("service down") + # skip("service down") point <- sf::st_sfc(sf::st_point(x = c(-105.97218, 36.17592)), crs = 4326) @@ -307,8 +308,13 @@ test_that("coverage", { assign("nldi_tier", "borked", envir = nhdplusTools:::nhdplusTools_env) - expect_error(nhdplusTools:::get_nldi_url(), - "only prod or test allowed.") + # may bring back but not relevant now + # expect_error(nhdplusTools:::get_nldi_url(), + # "only prod or test allowed.") + + tier_env <- Sys.getenv("NLDI_TIER") + + Sys.unsetenv("NLDI_TIER") assign("nldi_tier", "test", envir = nhdplusTools:::nhdplusTools_env) @@ -317,6 +323,8 @@ test_that("coverage", { expect_equal(test, "https://labs-beta.waterdata.usgs.gov/api/nldi") + Sys.setenv("NLDI_TIER"= tier_env) + assign("nldi_tier", "prod", envir = nhdplusTools:::nhdplusTools_env) diff --git a/tests/testthat/test_03_get_functions.R b/tests/testthat/test_03_get_functions.R index b7b34ccd..cfbbb25c 100644 --- a/tests/testthat/test_03_get_functions.R +++ b/tests/testthat/test_03_get_functions.R @@ -17,7 +17,7 @@ pt2 = data.frame(loc = "ucsb", geometry = "POINT (-119.8458 34.4146)") %>% # ============================================================================== -test_that("query water labs...",{ +test_that("query water geoserver...",{ testthat::skip_on_cran() #available? df = nhdplusTools:::query_usgs_geoserver() diff --git a/tests/testthat/test_get_vaa.R b/tests/testthat/test_get_vaa.R index 9aa185ce..25bc43e9 100644 --- a/tests/testthat/test_get_vaa.R +++ b/tests/testthat/test_get_vaa.R @@ -39,6 +39,8 @@ test_that("catchment chars", { skip_on_os("linux") skip_on_os("mac") + old_opts <- options(arrow.unsafe_metadata = TRUE) + httptest::without_internet({ suppressMessages(expect_warning(w <- get_characteristics_metadata(cache = FALSE))) expect_null(w) @@ -63,7 +65,9 @@ test_that("catchment chars", { source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) - dat <- get_catchment_characteristics(c("CAT_BFI", "ACC_BFI", "TOT_BFI"), walker_catchment$FEATUREID) + suppressWarnings( + dat <- get_catchment_characteristics(c("CAT_BFI", "ACC_BFI", "TOT_BFI"), walker_catchment$FEATUREID) + ) expect_equal(names(dat), c("characteristic_id", "comid", "characteristic_value", "percent_nodata")) @@ -77,4 +81,5 @@ test_that("catchment chars", { "Variable CAT_CFI not found in metadata.") expect_null(w) + options(old_opts) }) diff --git a/tests/testthat/test_rescale_catchments.R b/tests/testthat/test_rescale_catchments.R index bf3d7db3..3200c637 100644 --- a/tests/testthat/test_rescale_catchments.R +++ b/tests/testthat/test_rescale_catchments.R @@ -3,6 +3,8 @@ test_that("rescale", { skip_on_cran() skip_on_os("mac") + old_opts <- options(arrow.unsafe_metadata = TRUE) + vars <- data.frame(characteristic_id = c("CAT_EWT", "CAT_EWT", "CAT_EWT", "CAT_EWT", "CAT_BASIN_AREA"), summary_statistic = c("area_weighted_mean", "min", "sum", "max", "sum")) @@ -37,10 +39,12 @@ test_that("rescale", { d <- readRDS(list.files(pattern = "rescale_data.rds", recursive = TRUE, full.names = TRUE)) - rescale <- rescale_catchment_characteristics(vars, d$lookup_table, d$split_divides) + suppressWarnings( + rescale <- rescale_catchment_characteristics(vars, d$lookup_table, d$split_divides)) - rescale_2 <- rescale_catchment_characteristics(vars, d$lookup_table, d$split_divides, - d$catchment_characteristic, d$catchment_areas) + suppressWarnings( + rescale_2 <- rescale_catchment_characteristics(vars, d$lookup_table, d$split_divides, + d$catchment_characteristic, d$catchment_areas)) expect_true(is.data.frame(rescale)) expect_equal(length(unique(d$lookup_table$id)), nrow(rescale)) @@ -110,4 +114,6 @@ test_that("rescale", { expect_equal(nrow(rescale), 1) + options(old_opts) + }) diff --git a/vignettes/nhdplusTools.Rmd b/vignettes/nhdplusTools.Rmd index c259515c..6900fd3e 100644 --- a/vignettes/nhdplusTools.Rmd +++ b/vignettes/nhdplusTools.Rmd @@ -180,7 +180,7 @@ plot(start_point, cex = 1.5, lwd = 2, col = "red", add = TRUE) ### Web Service Data Subsetting -`nhdplusTools` supports discovery and data subsetting using web services made available through the [Network Linked Data Index](https://waterdata.usgs.gov/blog/nldi-intro/) (NLDI) and the [National Water Census Geoserver.](https://labs.waterdata.usgs.gov/geoserver) The code below shows how to use the NLDI functions to build a dataset upstream of our `start_comid` that we found above. +`nhdplusTools` supports discovery and data subsetting using web services made available through the [Network Linked Data Index](https://waterdata.usgs.gov/blog/nldi-intro/) (NLDI) and the [Water Mission Area Geoserver.](https://api.water.usgs.gov/geoserver) The code below shows how to use the NLDI functions to build a dataset upstream of our `start_comid` that we found above. The NLDI can be queried with any set of watershed outlet locations that it has in its index. We call these "featureSources". We can query the NLDI for an identifier of a given feature from any of its "featureSources" and find out what our navigation options are as shown below. ```{r discover_nldi}