From c9970175230e16379d47787cffa9d8e31cf0a0e2 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Thu, 22 Aug 2024 09:26:36 -0500 Subject: [PATCH 1/3] add dnminorhyd to avoid test warning --- tests/testthat/test_02_subset_extras.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test_02_subset_extras.R b/tests/testthat/test_02_subset_extras.R index 4453c434..36fd93ff 100644 --- a/tests/testthat/test_02_subset_extras.R +++ b/tests/testthat/test_02_subset_extras.R @@ -80,7 +80,8 @@ test_that("by rpu", { suppressWarnings(sample_flines <- dplyr::left_join( dplyr::select(sample_flines, COMID, RPUID, TerminalPa, - ArbolateSu, DnHydroseq, Pathlength, FCODE, DnLevelPat), + ArbolateSu, DnHydroseq, Pathlength, FCODE, DnLevelPat, + DnMinorHyd), prepare_nhdplus(sample_flines, 0, 0, 0, FALSE), by = "COMID")) @@ -95,7 +96,8 @@ test_that("big rpu test", { vaa <- get_vaa(atts = c("comid", "pathlength", "lengthkm", "hydroseq", "dnhydroseq", "levelpathi", "rpuid", "vpuid", "fcode", "arbolatesu", - "terminalfl", "terminalpa", "dnlevelpat")) + "terminalfl", "terminalpa", "dnlevelpat", + "dnminorhyd")) vaa_sub <- dplyr::filter(vaa, vpuid == "17") From 33573b4b0d9af088ecf7f9ae197e0131e90600a0 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Thu, 22 Aug 2024 09:28:54 -0500 Subject: [PATCH 2/3] check issue --- NAMESPACE | 1 + R/plot_nhdplus.R | 1 + 2 files changed, 2 insertions(+) diff --git a/NAMESPACE b/NAMESPACE index 7348063b..44924ca8 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -103,6 +103,7 @@ importFrom(dplyr,summarize) importFrom(dplyr,ungroup) importFrom(fst,metadata_fst) importFrom(fst,read.fst) +importFrom(graphics,par) importFrom(httr,GET) importFrom(httr,POST) importFrom(httr,RETRY) diff --git a/R/plot_nhdplus.R b/R/plot_nhdplus.R index 41062be5..de8f0b05 100644 --- a/R/plot_nhdplus.R +++ b/R/plot_nhdplus.R @@ -57,6 +57,7 @@ #' `sf::st_transform(x, 3857)` prior to adding to the plot. #' #' @export +#' @importFrom graphics par #' @examples #' \donttest{ #' options("rgdal_show_exportToProj4_warnings"="none") From 461e45844092f082afecff20f3dc85e8bf4e94d3 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Sun, 15 Sep 2024 20:36:34 -0500 Subject: [PATCH 3/3] avoid crazy slow read from ring direction check fixes #411 --- NEWS.md | 5 +++++ R/get_nhdplushr.R | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index d5afd6dc..ffd3bd61 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +nhdplusTools 1.3.1 +========== + +- no longer check ring direction in `get_nhdplushr()` to avoid very slow run time on some polygon layers. + nhdplusTools 1.3.0 ========== diff --git a/R/get_nhdplushr.R b/R/get_nhdplushr.R index 1b54e858..cb5e7b63 100644 --- a/R/get_nhdplushr.R +++ b/R/get_nhdplushr.R @@ -90,7 +90,7 @@ get_nhdplushr <- function(hr_dir, out_gpkg = NULL, for(layer in layers) { if(!is.null(out_gpkg) && layer %in% layer_names & !overwrite) { - out <- read_sf(out_gpkg, layer) + out <- read_sf(out_gpkg, layer, check_ring_dir = FALSE) } else { layer_set <- lapply(gdbs, get_hr_data, layer = layer, ...)