diff --git a/R/get_stac_data.R b/R/get_stac_data.R index 9a04da2..c0f27ea 100644 --- a/R/get_stac_data.R +++ b/R/get_stac_data.R @@ -242,7 +242,7 @@ get_stac_data <- function(aoi, gdalwarp_options = character() ) - if (is.null(sign_function) && stac_source == "https://planetarycomputer.microsoft.com/api/stac/v1") { + if (is.null(sign_function) && is_pc(stac_source)) { sign_function <- sign_planetary_computer } @@ -962,3 +962,7 @@ figure_out_progress_length <- function(items_urls, mask_band, composite_function } length_progress } + +is_pc <- function(url) { + grepl("planetarycomputer.microsoft.com/api/stac/v1", url) +}