assets_download() always downloads full assets. For large raster assets, users often only need data for a limited area of interest. Add support for specifying a bounding box to restrict downloads spatially.
Proposed Change
Add an optional bbox argument:
assets_download(items, asset_names = NULL, ... bbox = NULL)
bbox: numeric vector c(xmin, ymin, xmax, ymax) (EPSG:4326, consistent with STAC).
Expected Behavior
- If
bbox is NULL, keep the current behavior.
- If
bbox is provided, download only the spatial subset for raster assets.
- If partial download is not supported, throw an error.
- Validate bbox length and ordering.
Acceptance Criteria
bbox argument implemented and documented.
- Error raised when bbox-based download is not supported.
- Existing behavior unchanged when
bbox is NULL.
- Tests added and passing.
assets_download()always downloads full assets. For large raster assets, users often only need data for a limited area of interest. Add support for specifying a bounding box to restrict downloads spatially.Proposed Change
Add an optional
bboxargument:bbox: numeric vectorc(xmin, ymin, xmax, ymax)(EPSG:4326, consistent with STAC).Expected Behavior
bboxisNULL, keep the current behavior.bboxis provided, download only the spatial subset for raster assets.Acceptance Criteria
bboxargument implemented and documented.bboxisNULL.