Skip to content

Commit

Permalink
Merge pull request #77 from poissonconsulting/reqName
Browse files Browse the repository at this point in the history
  • Loading branch information
joethorley authored Oct 29, 2024
2 parents 7b6b104 + 650d4a4 commit 14beb33
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
4 changes: 1 addition & 3 deletions R/add-gm-elevation-to-point.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ add_gm_elevation_to_point <- function(x, digits, key) {
#' }
fwa_add_gm_elevation_to_point <- function(x, chunk_size = 300L, digits = 7,
key = Sys.getenv("GOOGLE_MAPS_ELEVATION_API_KEY")) {
if (!requireNamespace("googleway", quietly = TRUE)) {
err("Package 'googleway' must be installed to get elevations from Google Maps.")
}
rlang::check_installed("googleway", reason = "to get elevations from Google Maps.")

chk_s3_class(x, "sf")
chk_s3_class(sf::st_geometry(x), "sfc_POINT")
Expand Down
4 changes: 1 addition & 3 deletions R/mapview-rms-to-rms.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ join_points <- function(x, y) {
#' @inheritParams fwa_mapview
#' @export
fwa_mapview_rms_to_rms <- function(x, y, zcol = "rm", npoint = 250) {
if (!requireNamespace("mapview", quietly = TRUE)) {
err("Package 'mapview' must be installed.")
}
rlang::check_installed("mapview")

chk_s3_class(x, "sf")
chk_s3_class(sf::st_geometry(x), "sfc_POINT")
Expand Down
4 changes: 1 addition & 3 deletions R/mapview-rms.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ thin_points <- function(x, npoint) {
#' @export
fwa_mapview_rms <- function(x, layer = NULL, zcol = "rm", legend = FALSE, npoint = 250,
...) {
if (!requireNamespace("mapview", quietly = TRUE)) {
err("Package 'mapview' must be installed.")
}
rlang::check_installed("mapview")

chk_s3_class(x, "sf")
chk_s3_class(sf::st_geometry(x), "sfc_POINT")
Expand Down
9 changes: 2 additions & 7 deletions R/mapview.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@
#' @param ... Additional arguments passed to `mapview::mapview()`.
#' @export
fwa_mapview <- function(x, layer = NULL, zcol = NULL, legend = FALSE, ...) {
if (!requireNamespace("mapview", quietly = TRUE)) {
err("Package 'mapview' must be installed.")
}

if (!requireNamespace("hms", quietly = TRUE)) {
err("Package 'hms' must be installed.")
}
rlang::check_installed("mapview")
rlang::check_installed("hms")

chk_s3_class(x, "sf")

Expand Down

0 comments on commit 14beb33

Please sign in to comment.