From 2bfd26151394385007deee3537d6f3bf788e1d1f Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Fri, 13 Nov 2020 10:18:43 -0600 Subject: [PATCH 1/3] avoid CRAN failures when geoserver down --- R/index_nhdplus.R | 2 ++ tests/testthat/test_plot_nhdplus.R | 1 + 2 files changed, 3 insertions(+) diff --git a/R/index_nhdplus.R b/R/index_nhdplus.R index e1c72e31..497b0a6e 100644 --- a/R/index_nhdplus.R +++ b/R/index_nhdplus.R @@ -68,6 +68,7 @@ matcher <- function(coords, points, search_radius, max_matches = 1) { #' @importFrom magrittr "%>%" #' @export #' @examples +#' \donttest{ #' sample_flines <- sf::read_sf(system.file("extdata", #' "petapsco_flowlines.gpkg", #' package = "nhdplusTools")) @@ -94,6 +95,7 @@ matcher <- function(coords, points, search_radius, max_matches = 1) { #' search_radius = 0.2, #' max_matches = 10) #' +#' } get_flowline_index <- function(flines, points, search_radius = 0.1, diff --git a/tests/testthat/test_plot_nhdplus.R b/tests/testthat/test_plot_nhdplus.R index 3389fcbd..8c30662d 100644 --- a/tests/testthat/test_plot_nhdplus.R +++ b/tests/testthat/test_plot_nhdplus.R @@ -294,6 +294,7 @@ test_that("bbox", { }) test_that("comids", { + testthat::skip_on_cran() fline <- sf::read_sf(sample_data, "NHDFlowline_Network") comids <- nhdplusTools::get_UT(fline, 13293970) d <- nhdplusTools:::get_plot_data(comids) From 594f360d6184d32f8f2944bdd1b327aeb4a6ea73 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Fri, 13 Nov 2020 10:33:54 -0600 Subject: [PATCH 2/3] docs --- NEWS.md | 1 + docs/news/index.html | 2 ++ docs/pkgdown.yml | 2 +- docs/reference/get_flowline_index.html | 6 ++++-- man/get_flowline_index.Rd | 2 ++ 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 09ef2a3c..a2be07e9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ nhdplusTools 0.3.16 ========== * `subset_nhdplus()` now validates geometry and ensures all outputs are in NAD83 * `subset_nhdplus()` queries the NHDPlus database rather than loading then filtering +* `get_levelpaths()` rewritten for performance. Package now uses `data.table`. nhdplusTools 0.3.15 ========== diff --git a/docs/news/index.html b/docs/news/index.html index 8438d429..8b2f70e0 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -152,6 +152,8 @@

subset_nhdplus() now validates geometry and ensures all outputs are in NAD83
  • subset_nhdplus() queries the NHDPlus database rather than loading then filtering
  • +
  • +get_levelpaths() rewritten for performance. Package now uses data.table.
  • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index df3d2689..80d553a2 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -6,7 +6,7 @@ articles: nhdplusTools: nhdplusTools.html plot_nhdplus: plot_nhdplus.html point_indexing: point_indexing.html -last_built: 2020-11-05T01:06Z +last_built: 2020-11-13T16:32Z urls: reference: https://usgs-r.github.io/nhdplusTools//reference article: https://usgs-r.github.io/nhdplusTools//articles diff --git a/docs/reference/get_flowline_index.html b/docs/reference/get_flowline_index.html index 6d415ffe..388552c2 100644 --- a/docs/reference/get_flowline_index.html +++ b/docs/reference/get_flowline_index.html @@ -209,7 +209,8 @@

    Details handling of precision parameter.

    Examples

    -
    sample_flines <- sf::read_sf(system.file("extdata", +
    # \donttest{ +sample_flines <- sf::read_sf(system.file("extdata", "petapsco_flowlines.gpkg", package = "nhdplusTools")) get_flowline_index(sample_flines, @@ -229,7 +230,7 @@

    Examp get_flowline_index(sample_flines, sf::st_sfc(sf::st_point(c(-76.87479, 39.48233)), - crs = 4326), precision = 30)

    #> # A tibble: 1 x 5 + crs = 4326), precision = 30)
    #> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1
    #> # A tibble: 1 x 5 #> id COMID REACHCODE REACH_meas offset #> <int> <int> <chr> <dbl> <dbl> #> 1 1 11689978 02060003001472 52.3 0.0000458
    @@ -253,6 +254,7 @@

    Examp #> 9 1 11690490 02060003000580 0 0.00285 #> 10 3 11688948 02060003000516 0 0.00321 #> # ... with 20 more rows

    +# }