Learn R Programming

sits (version 0.13.0)

sits_cube_copy: Creates the contents of a data cube

Description

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").

Usage

sits_cube_copy(cube, name, dest_dir, bands = sits_bands(cube), roi = NULL)

Arguments

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")

Value

Output data cube

Examples

Run this code
# NOT RUN {
data_dir <- system.file("extdata/raster/cbers", package = "sits")

cbers_022024 <- sits_cube(
    source = "LOCAL",
    name = "cbers_022024",
    satellite = "CBERS-4",
    band = "NDVI",
    sensor = "AWFI",
    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()
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab