Skip to content

Commit cb62a80

Browse files
authored
Merge pull request nationalparkservice#79 from RobLBaker/master
Update to unit service API endpoints
2 parents 41da793 + cb6e4cc commit cb62a80

7 files changed

Lines changed: 15 additions & 12 deletions

File tree

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# NPSutils 1.1.0
2+
## 2025-09-15
3+
* Update Unit service API to use current version (instead of discontinued legacy endpoint)
24
## 2025-05-16
35
* Add a vignette going over basic functions and how to use NPSutils
46
## 2025-05-08

R/getParkUnitInfo.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ get_unit_code <- function(unit) { # input must have quotes to indicate strings
2626
f <- file.path(tempdir(), "irmadownload.xml")
2727
if (!file.exists(f)) {
2828
# access all park codes from NPS xml file
29-
curl::curl_download("https://irmaservices.nps.gov/v2/rest/unit/", f)
29+
curl::curl_download("https://irmaservices.nps.gov/unit/v2/api/", f)
3030
}
3131
result <- XML::xmlParse(file = f) # parse xml
3232
dat <- XML::xmlToDataFrame(result)
@@ -55,7 +55,7 @@ get_park_code <- function(park) {
5555
f <- file.path(tempdir(), "irmadownload.xml")
5656
if (!file.exists(f)) {
5757
# access all park codes from NPS xml file
58-
curl::curl_download("https://irmaservices.nps.gov/v2/rest/unit/", f)
58+
curl::curl_download("https://irmaservices.nps.gov/unit/v2/api/", f)
5959
}
6060
result <- XML::xmlParse(file = f)
6161
dat <- XML::xmlToDataFrame(result)
@@ -85,7 +85,7 @@ get_unit_code_info <- function(code) {
8585
f <- file.path(tempdir(), "irmadownload.xml")
8686
if (!file.exists(f)) {
8787
# access all park codes from NPS xml file
88-
curl::curl_download(paste0("https://irmaservices.nps.gov/v2/rest/unit/", f))
88+
curl::curl_download(paste0("https://irmaservices.nps.gov/unit/v2/api/", f))
8989
}
9090
result <- XML::xmlParse(file = f)
9191
dat <- XML::xmlToDataFrame(result)
@@ -131,7 +131,7 @@ get_unit_info <- function(code = NULL,
131131
f <- file.path(tempdir(), "irmadownload.xml")
132132
if (!file.exists(f)) {
133133
# access all park codes from NPS xml file
134-
curl::curl_download("https://irmaservices.nps.gov/v2/rest/unit/", f)
134+
curl::curl_download("https://irmaservices.nps.gov/unit/v2/api/", f)
135135
}
136136
result <- XML::xmlParse(file = f)
137137
dat <- XML::xmlToDataFrame(result)

docs/news/index.html

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pkgdown: 2.1.1
33
pkgdown_sha: ~
44
articles:
55
NPSutils: NPSutils.html
6-
last_built: 2025-05-19T15:48Z
6+
last_built: 2025-09-15T21:47Z
77
urls:
88
reference: https://nationalparkservice.github.io/NPSutils/reference
99
article: https://nationalparkservice.github.io/NPSutils/articles

docs/reference/get_data_packages.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/load_data_packages.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/rm_local_packages.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)