This accessory function extracts metadata included in the name of a Sentinel-2 product which follows the sen2r naming convention (see safe_shortname).
sen2r_getElements(s2_names, format = "data.table", abort = TRUE)
s2_names | A vector of Sentinel-2 product names in the sen2r naming convention. |
---|---|
format | One between |
abort | Logical parameter: if TRUE (default), the function aborts
in case any of |
A data.table, data.frame or list of the output metadata.
License: GPL 3.0
# Define product name fs2nc_examplename <- "/path/of/the/product/S2A1C_20170603_022_32TQQ_TOA_20.tif" # Return metadata sen2r_getElements(fs2nc_examplename)#> type mission level sensing_date id_orbit extent_name prod_type res file_ext #> 1: tile A 1C 2017-06-03 022 32TQQ TOA 20m tif