This accessory function extract some useful metadata from a vector of raster paths.

raster_metadata(raster_paths, meta = "all", format = "data.table")

Arguments

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 data.table (default), data.frame and list.

Value

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

Note

License: GPL 3.0

Examples

if (FALSE) { # Define product names examplenames <- c( system.file("tif/L7_ETMs.tif", package="stars"), system.file("nc/bcsd_obs_1999.nc", package = "stars") ) # Return metadata as data.table raster_metadata(examplenames) # Return metadata as list raster_metadata(examplenames, format = "list") # Return only two metadata raster_metadata(examplenames, c("res", "unit")) # Output with an invalid raster examplenames <- c(examplenames, system.file("extdata/gdal_formats.json", package="sen2r")) raster_metadata(examplenames) }