Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .github/workflows/pkgdown.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# NPSutils 1.2.0 ("Apostle Islands Ice Caves")
## 2026-07-23
* Fix error in `map_wkt` that was causing the function to fail when type = "all" but either points or polygons were absent.
* Update `mak_wkt` unit tests.

## 2026-07-23
* Fix typo in readme.md
* remove pkgdown github action (unapproved for DGEC)
* Fix typo in `load_data_packages` details documentation

## 2026-04-22
* Update documentation (mostly URLs) and metadata (e.g. add code.json file) in preparation for migration to DGEC

Expand Down
2 changes: 1 addition & 1 deletion R/load_data_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @description `load_data_packages()` loads one to many data packages and returns a list. If only one data package is loaded, the list will be a list of tibbles where each tibble is a data (.csv) file from the data package. If multiple data packages are loaded, the list will be a list of lists where each nested list contains a list of tibble and each tibble is a data file (.csv). See `simplify` below for details on handling these lists.
#'
#' @details currently `load_data_packages()` only supports EML metadata and .csv files. The reference_id
#' @details currently `load_data_packages()` only supports EML metadata and .csv files.
#' '
#' @param reference_id the immediate directory/directories where your data packages reside. For data packages downloaded from DataStore using `get_data_package()` or `get_data_packages()` default settings, this is the DataStore reference ID for your data package(s). Alternatively, you can set `reference_id` to "`load_all`", which will load all the data packages in the directory specified in via `directory` (typically ./data).
#' @param directory is the location of a folder that contains all of the data packages (where data packages are a folder containing .csv data files and a single .xml EML metadata file). If these data packages were downloaded from DataStore using the default settings for `get_data_packages`, this folder is "./data" and you can use the default settings for `directory`.
Expand Down
27 changes: 17 additions & 10 deletions R/map_wkt.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#' }
map_wkt <- function(df,
wellknowntext = "footprintWKT",
type = "all",
type = c("all", "points", "polygons"),
remove.duplicates = TRUE) {
type <- tolower(type)
type <- match.arg(type)
#filter to just wellknowntext column:
wkt_grepl <- paste0('\\b', wellknowntext, '\\b')
df <- df[grepl(wkt_grepl, colnames(df))]
Expand Down Expand Up @@ -69,15 +71,20 @@ map_wkt <- function(df,
updateWhenIdle = TRUE)) %>%
leaflet::addPolygons(data = df_polys, color = "red",) #odd stray ,
} else if(type == "all") {
map <- leaflet::leaflet(df,
options = leaflet::leafletOptions(preferCanvas = TRUE)) %>%
#addTiles(group = "OSM (default)") %>%; prevent unwanted map updates:
leaflet::addProviderTiles(leaflet::providers$Esri.WorldGrayCanvas,
options = leaflet::providerTileOptions(
updateWhenZooming = FALSE,
updateWhenIdle = TRUE)) %>%
leaflet::addCircles(data = df_pts, color = "blue",) %>%
leaflet::addPolygons(data = df_polys, color = "red",) #odd stray ,
map <- leaflet::leaflet(df,
options = leaflet::leafletOptions(preferCanvas = TRUE)) %>%
leaflet::addProviderTiles(leaflet::providers$Esri.WorldGrayCanvas,
options = leaflet::providerTileOptions(
updateWhenZooming = FALSE,
updateWhenIdle = TRUE))

if (nrow(df_pts) > 0) {
map <- map %>% leaflet::addCircles(data = df_pts, color = "blue")
}
if (nrow(df_polys) > 0) {
map <- map %>% leaflet::addPolygons(data = df_polys, color = "red")
}

}
return(map)
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pak::pkg_install("doi-nps/NPSutils")

# alternatively:
# install.packages("remotes")
remotes::install_github("doi-nps/NPSutils)
remotes::install_github("doi-nps/NPSutils")
```

NPSutils is also available as part of the
Expand All @@ -32,5 +32,5 @@ NPSutils is also available as part of the
pak::pkg_install("doi-nps/NPSdataverse")

# alternatiely:
remotes::install_github("doi-nps/NPSdataverse)
remotes::install_github("doi-nps/NPSdataverse")
```
24 changes: 13 additions & 11 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading