diff --git a/NEWS.md b/NEWS.md index 4bbd7cba..5ab5c4c8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ nhdplusTools 0.3.15 ========== * Added `discover_nldi_characteristics()` and `get_nldi_characteristics()` +* Changed `navigate_nldi()` to use the new NLDI navigation end point. Distance is now required. * Fixed a bug in `get_flowline_index()` to handle multipart lines. * Added flowline_only input to `plot_nhdplus()` to improve scalability * Added streamorder filtering to `subset_nhdplus()` for download filtering. diff --git a/R/get_nldi.R b/R/get_nldi.R index 9fbf4a11..b51b20b6 100644 --- a/R/get_nldi.R +++ b/R/get_nldi.R @@ -38,7 +38,7 @@ discover_nldi_navigation <- function(nldi_feature, tier = "prod") { query <- paste(nldi_feature[["featureSource"]], nldi_feature[["featureID"]], - "navigate", sep = "/") + "navigation", sep = "/") query_nldi(query, tier) } @@ -129,7 +129,7 @@ type_check <- function(type) { #' } #' navigate_nldi <- function(nldi_feature, mode = "upstreamMain", - data_source = "flowline", distance_km = NULL, + data_source = "flowlines", distance_km = 10, tier = "prod") { nldi_feature <- check_nldi_feature(nldi_feature) @@ -147,11 +147,12 @@ navigate_nldi <- function(nldi_feature, mode = "upstreamMain", } } - if(data_source == "flowline") data_source <- "" + # For backward compatibility + if(data_source == "flowline") data_source <- "flowlines" query <- paste(nldi_feature[["featureSource"]], nldi_feature[["featureID"]], - "navigate", mode, data_source, + "navigation", mode, data_source, sep = "/") if (!is.null(distance_km)) { diff --git a/man/navigate_nldi.Rd b/man/navigate_nldi.Rd index 43b14cba..5056cc00 100644 --- a/man/navigate_nldi.Rd +++ b/man/navigate_nldi.Rd @@ -7,8 +7,8 @@ navigate_nldi( nldi_feature, mode = "upstreamMain", - data_source = "flowline", - distance_km = NULL, + data_source = "flowlines", + distance_km = 10, tier = "prod" ) }