Learn R Programming

sits (version 1.5.3)

sits_as_stars: Convert a data cube into a stars object

Description

Uses the information about files, bands and dates in a data cube to produce an object of class stars. User has to select a tile from the data cube. By default, all bands and dates are included in the stars object. Users can select bands and dates.

Usage

sits_as_stars(
  cube,
  tile = cube[1L, ]$tile,
  bands = NULL,
  dates = NULL,
  proxy = FALSE
)

Value

An space-time stars object.

Arguments

cube

A sits cube.

tile

Tile of the data cube.

bands

Bands of the data cube to be part of stars object.

dates

Dates of the data cube to be part of stars object.

proxy

Produce a stars proxy object.

Author

Gilberto Camara, gilberto.camara.inpe@gmail.com

Examples

Run this code
if (sits_run_examples()) {
    # convert sits cube to an sf object (polygon)
    data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
    cube <- sits_cube(
        source = "BDC",
        collection = "MOD13Q1-6.1",
        data_dir = data_dir
    )
    stars_object <- sits_as_stars(cube)
}

Run the code above in your browser using DataLab