sen2r (version 1.2.1)

sen2r_getElements: Get information from S2 short name

Description

This accessory function extracts metadata included in the name of a Sentinel-2 product which follows the sen2r naming convention (see safe_shortname).

Usage

sen2r_getElements(s2_names, format = "data.table", abort = TRUE)

Arguments

s2_names

A vector of Sentinel-2 product names in the sen2r naming convention.

format

One between data.table (default), data.frame and list.

abort

Logical parameter: if TRUE (default), the function aborts in case any of s2_names is not recognised; if FALSE, a warning is shown, and a list with only the element "type"='unrecognised' is returned.

Value

A data.table, data.frame or list of the output metadata.

Examples

Run this code
# NOT RUN {
# Define product name
fs2nc_examplename <-
  "/path/of/the/product/S2A1C_20170603_022_32TQQ_TOA_20.tif"

# Return metadata
sen2r_getElements(fs2nc_examplename)
# }

Run the code above in your browser using DataCamp Workspace