View source: R/raster_metadata.R
raster_metadata | R Documentation |
This accessory function extract some useful metadata from a vector of raster paths.
raster_metadata(raster_paths, meta = "all", format = "data.table")
raster_paths |
A vector of raster paths. |
meta |
Vector with the desired metadata: one or more values among 'res', 'size', 'bbox', 'proj', 'unit', 'outformat', 'type'. Alternatively meta = 'all' (default) allows to return all metadata. |
format |
One between |
A data.table, data.frame or list of the output metadata.
License: GPL 3.0
Luigi Ranghetti, phD (2019)
L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.cageo.2020.104473")}, URL: https://sen2r.ranghetti.info/.
# Define product names
examplenames <- c(
system.file("tif/L7_ETMs.tif", package="stars"),
system.file("extdata/out/S2A2A_20190723_022_Barbellino_BOA_10.tif",
package = "sen2r")
)
# Return metadata as data.table
raster_metadata(examplenames)
# Return some metadata as data.table
raster_metadata(examplenames, c("res", "size", "bbox", "outformat"))
# Return some metadata as list
raster_metadata(examplenames, c("res", "size", "bbox", "proj"), format = "list")
# Output with an invalid raster
examplenames <- c(
examplenames,
system.file("extdata/settings/gdal_formats.json", package="sen2r")
)
raster_metadata(examplenames, c("bbox", "proj"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.