Skip to content

Commit

Permalink
Robustify planetary computer check (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemahoney218 authored Jan 7, 2024
1 parent e4102c8 commit 1b3ce07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/get_stac_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}

0 comments on commit 1b3ce07

Please sign in to comment.