Skip to content

Commit

Permalink
Document merge option
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemahoney218 committed Aug 20, 2024
1 parent 7c2c0cf commit 0b294d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions R/download.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ rsi_download_rasters <- function(items,
gdalwarp_options <- set_gdalwarp_extent(gdalwarp_options, aoi, NULL)
}

# Which loop gets parallelized is determined based on which has more steps,
# working from the assumption that all downloads take about as long
#
# so if we aren't merging, or if there's more assets than tiles, we'll
# parallelize the outside loop that walks over assets (which, unless the user
# has set up wild nested futures, turns the inside one into a serial process)
asset_iterator <- ifelse(
merge || (n_tiles_out < ncol(download_locations)),
function(...) future.apply::future_lapply(..., future.seed = TRUE),
Expand Down
5 changes: 4 additions & 1 deletion R/get_stac_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@
#' @param composite_function Character of length 1: The name of a
#' function used to combine downloaded images into a single composite
#' (i.e., to aggregate pixel values from multiple images into a single value).
#' Must be one of of "sum", "mean", "median", "min", "max".
#' Options include "merge", which 'stamps' images on top of one another such that
#' the "last" value downloaded for a pixel -- which isn't guaranteed to be the most
#' recent one -- will be the only value used, or any of "sum", "mean", "median",
#' "min", or "max", which consider all values available at each pixel.
#' Set to `NULL` to not composite
#' (i.e., to rescale and save each individual file independently).
#' @inheritParams rstac::stac_search
Expand Down
5 changes: 4 additions & 1 deletion man/get_stac_data.Rd

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

0 comments on commit 0b294d3

Please sign in to comment.