Learn R Programming

sits (version 1.5.3)

sits_cube.local_cube: Create sits cubes from cubes in flat files in a local

Description

Creates data cubes based on files on local directory. Assumes users have downloaded the data from a known cloud collection or the data has been created by sits.

Usage

# S3 method for local_cube
sits_cube(
  source,
  collection,
  ...,
  bands = NULL,
  tiles = NULL,
  start_date = NULL,
  end_date = NULL,
  data_dir,
  parse_info = c("X1", "X2", "tile", "band", "date"),
  delim = "_",
  multicores = 2L,
  progress = TRUE
)

Value

A tibble describing the contents of a data cube.

Arguments

source

Data source: one of "AWS", "BDC", "CDSE", "DEAFRICA", "DEAUSTRALIA", "HLS", "PLANETSCOPE", "MPC", "SDC" or "USGS". This is the source from which the data has been downloaded.

collection

Image collection in data source. To find out the supported collections, use sits_list_collections()).

...

Other parameters to be passed for specific types.

bands

Spectral bands and indices to be included in the cube (optional).

tiles

Tiles from the collection to be included in the cube (see details below).

start_date, end_date

Initial and final dates to include images from the collection in the cube (optional). (Date in YYYY-MM-DD format).

data_dir

Local directory where images are stored.

parse_info

Parsing information for local files.

delim

Delimiter for parsing local files (default = "_")

multicores

Number of workers for parallel processing (integer, min = 1, max = 2048).

progress

Logical: show a progress bar?

Examples

Run this code
if (sits_run_examples()) {
    # --- Create a cube based on a local MODIS data
    # MODIS local files have names such as
    # "TERRA_MODIS_012010_NDVI_2013-09-14.jp2"
    # see the parse info parameter as an example on how to
    # decode local files
    data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
    modis_cube <- sits_cube(
        source = "BDC",
        collection = "MOD13Q1-6.1",
        data_dir = data_dir,
        parse_info = c("satellite", "sensor", "tile", "band", "date")
    )
}

Run the code above in your browser using DataLab