Skip to content

Specify a bounding box in assets_download() #12

Description

@OldLipe

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions