Description Usage Arguments Value Note Author(s) Examples
The function safe_getMetadata()
scans a Sentinel2 product
(main path, granule path, main / granule xml file or GDAL object)
to retrieve information about the product.
The accessory function rm_invalid_safe()
remove a SAFE archive in the case
it is not recognised by safe_getMetadata()
.
The accessory function safe_isvalid()
scan the SAFE name to understand
if it is a valid SAFE.
1 2 3 4 5 | safe_getMetadata(s2, info = "all", abort = TRUE)
rm_invalid_safe(s2)
safe_isvalid(s2, info = "fileinfo")
|
s2 |
A Sentinel-2 product, being both a |
info |
(optional) A character vector with the list of the metadata which should be provided. Accepted values are:
|
abort |
Logical parameter: if TRUE (default), the function aborts
in case |
safe_getMetadata()
returns a list of the output metadata;
rm_invalid_safe()
returns TRUE if the s2
product was removed,
FALSE elsewhere.
safe_isvalid()
returns TRUE if the product is a valid SAFE, FALSE if not.
License: GPL 3.0
Luigi Ranghetti, phD (2017, 2018) ranghetti.l@irea.cnr.it
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # Define product name
s2_examplename <-
"/path/of/the/product/S2A_MSIL1C_20170603T101031_N0205_R022_T32TQQ_20170603T101026.SAFE"
# Return only the information retrevable from the file names (files are not scanned)
safe_getMetadata(s2_examplename, info="nameinfo")
# Return some specific information without scanning files
safe_getMetadata(s2_examplename, info="nameinfo")[c("level", "id_tile")]
# Return a single information without scanning files
# (in this case, the output is a vector instead than a list)
safe_getMetadata(s2_examplename, info="nameinfo")[["level"]]
## Not run:
# Return all the available information
safe_getMetadata(s2_examplename)
# Return some specific information
safe_getMetadata(s2_examplename, info=c("tiles", "level", "id_tile"))
# Return a single information
safe_getMetadata(s2_examplename, info="clouds")
# Delete it if it is not recognised
rm_invalid_safe(s2_examplename)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.