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 @@
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
)
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
)