Learn R Programming

rstac (version 0.9.1-5)

assets_function: Assets functions

Description

This function returns the date, band and URL fields for each assets of an STACItemCollection object. For the URL you can add the GDAL library drivers for the following schemes: HTTP/HTTPS files, S3 (AWS S3) and GS (Google Cloud Storage).

Usage

assets_list(
  items,
  asset_names = NULL,
  sort = TRUE,
  gdal_vsi_resolution = TRUE,
  assets_names = deprecated()
)

assets_select(items, asset_names)

# S3 method for STACItemCollection assets_select(items, asset_names)

# S3 method for STACItem assets_select(items, asset_names)

assets_filter(items, ..., fn = NULL)

# S3 method for STACItemCollection assets_filter(items, ..., fn = NULL)

# S3 method for STACItem assets_filter(items, ..., fn = NULL)

Value

a list with the attributes of date, bands and paths.

Arguments

items

a STACItemCollection object representing the result of /stac/search, /collections/{collectionId}/items.

asset_names

a character with the assets names to be filtered. If NULL (default) all assets will be returned..

sort

a logical if true the dates will be sorted in increasing order. By default, the dates are sorted.

gdal_vsi_resolution

a logical if true, gdal drivers are included in the URL of each asset. The following schemes are supported: HTTP/HTTPS files, S3 (AWS S3) and GS (Google Cloud Storage).

assets_names

[Deprecated] use asset_names parameter instead.

...

additional arguments. See details.

fn

a function that will be used to filter the attributes listed in the properties.

Examples

Run this code
# \donttest{
# STACItemCollection object
stac_item <- stac("https://brazildatacube.dpi.inpe.br/stac/") %>%
 stac_search(collections = "CB4_64_16D_STK-1", limit = 100,
        datetime = "2017-08-01/2018-03-01",
        bbox = c(-48.206,-14.195,-45.067,-12.272)) %>%
 get_request() %>% items_fetch(progress = FALSE)

stac_item %>% assets_list(assets_names = c("EVI", "NDVI"))
# }

Run the code above in your browser using DataLab