Skip to content

Commit

Permalink
wild stab in the dark to maybe fix test on macos-oldrel
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondben committed Mar 8, 2024
1 parent cf8bb8e commit 3f6561b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/polarview.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @export
bb_polarview_search <- function(acquisition_date = Sys.Date() + -14:0, formats = c("jpg", "geotiff"), polygon = NULL, max_results = 200L, verbose = FALSE) {
if (!is.null(polygon)) {
if (inherits(polygon, "sfc_POLYGON")) polygon <- sf::st_as_text(sf::st_transform(polygon, "epsg:3031"))
if (inherits(polygon, "sfc_POLYGON")) polygon <- sf::st_as_text(sf::st_transform(polygon, "EPSG:3031"))
assert_that(is.string(polygon))
}
assert_that(is.character(formats))
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test_seaice_sources.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ test_that("polarview search works", {
## polygon as sfc
target_sector <- data.frame(lon = c(30, seq(30, 150, length.out = 10), 150, 30),
lat = c(-77, rep(-50, 10), -77, -77))
target_sector <- sf::st_sfc(sf::st_polygon(list(as.matrix(target_sector))), crs = "+proj=longlat")
target_sector <- sf::st_sfc(sf::st_polygon(list(as.matrix(target_sector))), crs = "EPSG:4326")

res1 <- bb_polarview_search(Sys.Date() - 3L, formats = "geotiff", polygon = target_sector)
## polygon as string
res2 <- bb_polarview_search(Sys.Date() - 3L, formats = "geotiff", polygon = "POLYGON ((709163.9 1228308, 2262269 3918365, 3104926 3291029, 3780196 2486274, 4251675 1547483, 4493944 525266.8, 4493944 -525266.8, 4251675 -1547483, 3780196 -2486274, 3104926 -3291029, 2262269 -3918365, 709163.9 -1228308, 709163.9 1228308))")
Expand Down

0 comments on commit 3f6561b

Please sign in to comment.