diff --git a/NEWS.md b/NEWS.md index 5690290..5b43105 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,6 @@ # NPSutils 1.1.0 +## 2025-09-15 + * Update Unit service API to use current version (instead of discontinued legacy endpoint) ## 2025-05-16 * Add a vignette going over basic functions and how to use NPSutils ## 2025-05-08 diff --git a/R/getParkUnitInfo.R b/R/getParkUnitInfo.R index 8a41d6c..c5b7560 100644 --- a/R/getParkUnitInfo.R +++ b/R/getParkUnitInfo.R @@ -26,7 +26,7 @@ get_unit_code <- function(unit) { # input must have quotes to indicate strings f <- file.path(tempdir(), "irmadownload.xml") if (!file.exists(f)) { # access all park codes from NPS xml file - curl::curl_download("https://irmaservices.nps.gov/v2/rest/unit/", f) + curl::curl_download("https://irmaservices.nps.gov/unit/v2/api/", f) } result <- XML::xmlParse(file = f) # parse xml dat <- XML::xmlToDataFrame(result) @@ -55,7 +55,7 @@ get_park_code <- function(park) { f <- file.path(tempdir(), "irmadownload.xml") if (!file.exists(f)) { # access all park codes from NPS xml file - curl::curl_download("https://irmaservices.nps.gov/v2/rest/unit/", f) + curl::curl_download("https://irmaservices.nps.gov/unit/v2/api/", f) } result <- XML::xmlParse(file = f) dat <- XML::xmlToDataFrame(result) @@ -85,7 +85,7 @@ get_unit_code_info <- function(code) { f <- file.path(tempdir(), "irmadownload.xml") if (!file.exists(f)) { # access all park codes from NPS xml file - curl::curl_download(paste0("https://irmaservices.nps.gov/v2/rest/unit/", f)) + curl::curl_download(paste0("https://irmaservices.nps.gov/unit/v2/api/", f)) } result <- XML::xmlParse(file = f) dat <- XML::xmlToDataFrame(result) @@ -131,7 +131,7 @@ get_unit_info <- function(code = NULL, f <- file.path(tempdir(), "irmadownload.xml") if (!file.exists(f)) { # access all park codes from NPS xml file - curl::curl_download("https://irmaservices.nps.gov/v2/rest/unit/", f) + curl::curl_download("https://irmaservices.nps.gov/unit/v2/api/", f) } result <- XML::xmlParse(file = f) dat <- XML::xmlToDataFrame(result) diff --git a/docs/news/index.html b/docs/news/index.html index 1e5c8a2..6401ee4 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -36,8 +36,9 @@

Changelog

NPSutils 1.1.0

-

2025-05-16

-
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index b96a050..165e415 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -3,7 +3,7 @@ pkgdown: 2.1.1 pkgdown_sha: ~ articles: NPSutils: NPSutils.html -last_built: 2025-05-19T15:48Z +last_built: 2025-09-15T21:47Z urls: reference: https://nationalparkservice.github.io/NPSutils/reference article: https://nationalparkservice.github.io/NPSutils/articles diff --git a/docs/reference/get_data_packages.html b/docs/reference/get_data_packages.html index b1515b7..469ed70 100644 --- a/docs/reference/get_data_packages.html +++ b/docs/reference/get_data_packages.html @@ -43,7 +43,7 @@

Usage
get_data_packages(
   reference_id,
   secure = FALSE,
-  path = here::here(),
+  path = here::here(),
   force = FALSE,
   dev = FALSE
 )
@@ -51,7 +51,7 @@ 

Usage get_data_package( reference_id, secure = FALSE, - path = here::here(), + path = here::here(), force = FALSE, dev = FALSE )

diff --git a/docs/reference/load_data_packages.html b/docs/reference/load_data_packages.html index 98bb59e..1b8b7d9 100644 --- a/docs/reference/load_data_packages.html +++ b/docs/reference/load_data_packages.html @@ -42,14 +42,14 @@

Read contents of data package(s) and return a list of tibbles list of tibble

Usage

load_data_packages(
   reference_id,
-  directory = here::here("data"),
+  directory = here::here("data"),
   assign_attributes = FALSE,
   simplify = TRUE
 )
 
 load_data_package(
   reference_id,
-  directory = here::here("data"),
+  directory = here::here("data"),
   assign_attributes = FALSE,
   simplify = TRUE
 )
diff --git a/docs/reference/rm_local_packages.html b/docs/reference/rm_local_packages.html index 0ce1122..ad29de3 100644 --- a/docs/reference/rm_local_packages.html +++ b/docs/reference/rm_local_packages.html @@ -43,7 +43,7 @@

Usage