Turns the result of search() into a data cube.
Arguments
- x
An
sfobject returned bysearch().- to
Character naming the target backend, either
"sits"or"stars".- ...
Extra arguments forwarded to the selected backend (see Details).
Details
The backends accept the following arguments through ...:
"sits":output_dir(directory for the per-band VRTs),bands(embedding bands,A00-A63, defaults to all 64),roi(optional crop, any object accepted bysearch()), and any further argument passed on tosits::sits_cube()(e.g.multicores,progress). Returns asitscube."stars":output_dir(directory for the intermediate VRTs, defaults to a temporary directory),bands,roi,proxy(read lazily as astars_proxy, defaults toTRUE), and any further argument passed on tostars::read_stars(). Returns onestarsobject for a single tile, or a named list ofstarsobjects keyed by tile id.
Note
To materialise the tiles as GeoTIFFs on disk instead, use download().
Examples
if (FALSE) { # \dontrun{
tiles <- alphaearth::search(
roi = my_roi,
start_date = "2020",
end_date = "2021"
)
# read the tiles as a stars cube
cube <- alphaearth::as_cube(
x = tiles,
to = "stars",
bands = c("A00", "A01")
)
# read the tiles as a sits cube
cube <- alphaearth::as_cube(
x = tiles,
to = "sits",
bands = c("A00", "A01")
)
} # }