From cb38f672b791da587a6d7335efe9aedefd64a26e Mon Sep 17 00:00:00 2001 From: Rob Baker Date: Fri, 28 Jun 2024 09:07:51 -0600 Subject: [PATCH 1/4] update get_park_polygon API (was using a legacy API). Update documentation to specify it returns a convex hull. --- R/geography.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/geography.R b/R/geography.R index 2b89c94..8f41d47 100644 --- a/R/geography.R +++ b/R/geography.R @@ -103,7 +103,7 @@ return(in_park) #' Retrieve the polygon information for the park unit from NPS REST services #' #' @description `get_park_polygon()` retrieves a geoJSON string for a polygon of -#'a park unit. This is not the official boundary. +#'a park unit. This is not the official boundary. Note that the REST API call returns the default "convexHull". This is will work better or worse for some parks, depending on the park shape/geography/number of disjunct areas. #' #' #' @param unit_code is the four-character unit code as designated by NPS. #' @@ -114,7 +114,7 @@ return(in_park) #' } get_park_polygon <- function(unit_code) { # get geography from NPS Rest Services - units_url <- paste0("https://irmaservices.nps.gov/v2/rest/unit/", + units_url <- paste0("https://irmaservices.nps.gov/Unit/v2/api/", unit_code, "/geography") xml <- httr::content(httr::GET(units_url)) From 719b898a6a864f72fe0de4eb3e5fb25426b13ea0 Mon Sep 17 00:00:00 2001 From: Rob Baker Date: Fri, 28 Jun 2024 09:08:10 -0600 Subject: [PATCH 2/4] fix spelling error in code documentation --- R/replace_blanks.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/replace_blanks.R b/R/replace_blanks.R index 3f028d2..6b9a835 100644 --- a/R/replace_blanks.R +++ b/R/replace_blanks.R @@ -69,7 +69,7 @@ replace_blanks <- function(directory = here::here(), missing_val_code = NA) { #extract just the file name my_path <- basename(my_path) - #give each dataframe a name basd on the filename where it originated + #give each dataframe a name based on the filename where it originated names(my_data) <- gsub(".csv", "", my_path) #replace all with the designated missing value code. From fc8a34d5bec0dad5bcac1b5d81bb8e5623c061bb Mon Sep 17 00:00:00 2001 From: Rob Baker Date: Fri, 28 Jun 2024 09:08:28 -0600 Subject: [PATCH 3/4] add changes to get_park_polygon --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index f2e0e6c..31aeca7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # QCkit v0.1.8 (not yet released) +2024-06-28 +* Updated `get_park_polygon()` to use the new API (had been using a legacy API). Added documentation to specify that the function is getting the convexhull for the park, which may not work particularly well for some parks. 2024-06-27 * bug fixes for `generate_ll_from_utm()` * add function `remove_empty_tables()` (and associated unit tests) From 4baccf71cb23c39fdb9c126cd2659d99ceef63c5 Mon Sep 17 00:00:00 2001 From: Rob Baker Date: Fri, 28 Jun 2024 09:14:18 -0600 Subject: [PATCH 4/4] autoupdate via pkgdown and devtools::document --- docs/news/index.html | 14 +++++++------- docs/pkgdown.yml | 4 +--- docs/reference/convert_datetime_format.html | 14 +++++++------- docs/reference/get_park_polygon.html | 4 ++-- docs/reference/index.html | 12 ++++++------ docs/reference/replace_blanks.html | 14 +++++++------- man/get_park_polygon.Rd | 2 +- 7 files changed, 31 insertions(+), 33 deletions(-) diff --git a/docs/news/index.html b/docs/news/index.html index af13b37..836f289 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -3,7 +3,7 @@ - +
- +
@@ -65,7 +65,7 @@

Changelog

-

2024-06-27 * bug fixes for generate_ll_from_utm() * add function remove_empty_tables() (and associated unit tests) * update documentation for replace blanks() to indicate it can replace blanks with more than just NA

+

2024-06-28 * Updated get_park_polygon() to use the new API (had been using a legacy API). Added documentation to specify that the function is getting the convexhull for the park, which may not work particularly well for some parks. 2024-06-27 * bug fixes for generate_ll_from_utm() * add function remove_empty_tables() (and associated unit tests) * update documentation for replace blanks() to indicate it can replace blanks with more than just NA

@@ -167,10 +167,10 @@
+ - - + diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 96f20dc..c6ecf10 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -5,7 +5,5 @@ articles: DRR_Purpose_and_Scope: DRR_Purpose_and_Scope.html Starting-a-DRR: Starting-a-DRR.html Using-the-DRR-Template: Using-the-DRR-Template.html - -last_built: 2024-06-27T19:41Z - +last_built: 2024-06-28T15:11Z diff --git a/docs/reference/convert_datetime_format.html b/docs/reference/convert_datetime_format.html index 039e2c7..640a906 100644 --- a/docs/reference/convert_datetime_format.html +++ b/docs/reference/convert_datetime_format.html @@ -3,7 +3,7 @@ - +
- +
@@ -84,7 +84,7 @@

Arguments

Value

- +

A character vector of date/time format strings that can be parsed by readr or strptime.

@@ -119,10 +119,10 @@

Examples

+ - - + diff --git a/docs/reference/get_park_polygon.html b/docs/reference/get_park_polygon.html index 0235462..346f7ed 100644 --- a/docs/reference/get_park_polygon.html +++ b/docs/reference/get_park_polygon.html @@ -1,6 +1,6 @@ Retrieve the polygon information for the park unit from NPS REST services — get_park_polygon • QCkit - +
- + - +
@@ -125,7 +125,7 @@

Arguments

Value

- +

list of data frames (invisibly)

@@ -168,10 +168,10 @@

Examples

+ - - + diff --git a/man/get_park_polygon.Rd b/man/get_park_polygon.Rd index 706bac9..572b269 100644 --- a/man/get_park_polygon.Rd +++ b/man/get_park_polygon.Rd @@ -11,7 +11,7 @@ get_park_polygon(unit_code) } \description{ \code{get_park_polygon()} retrieves a geoJSON string for a polygon of -a park unit. This is not the official boundary. +a park unit. This is not the official boundary. Note that the REST API call returns the default "convexHull". This is will work better or worse for some parks, depending on the park shape/geography/number of disjunct areas. #' } \examples{