| sits_cube_copy {sits} | R Documentation |
Copies the metadata and data of a cube to a different directory. This function can be use to transfer data on the cloud to a local machine. The region of interest (roi) should be either an "sf" object, a box in XY coordinates ("xmin", "xmax", "ymin", "ymax") or a box in lat-long coordinates ("lon_min", "lon_max", "lat_min", "lat_max").
sits_cube_copy(cube, name, dest_dir, bands = sits_bands(cube), roi = NULL)
cube |
Input data cube |
name |
Output cube name |
dest_dir |
Destination directory |
bands |
Bands to include in output (optional) |
roi |
Region of interest (either "sf", "xy", or "latlong") |
Output data cube
data_dir <- system.file("extdata/raster/cbers", package = "sits")
cbers_022024 <- sits_cube(
source = "LOCAL",
name = "cbers_022024",
origin = "BDC",
collection = "CB4_64-1",
band = "NDVI",
data_dir = data_dir,
parse_info = c("X1", "X2", "tile", "band", "date")
)
cbers_022024_copy <- sits_cube_copy(cbers_022024,
name = "cb_022024_cp",
dest_dir = tempdir()
)