Scans a directory for raster files (e.g., .tif, .tiff, .vrt) and removes those that contain only zero values.
Uses ngr_spk_rast_not_empty() to check each raster.
Usage
ngr_spk_rast_rm_empty(
path = NULL,
delete = TRUE,
regexp = "\\.(tif|tiff|vrt)$",
quiet = FALSE
)Arguments
- path
character A single path to search for raster files.
- delete
logical Whether to delete the empty files. Default is
TRUE.- regexp
character A regular expression passed to
fs::dir_ls()to select raster files. Default is '\.(tif|tiff|vrt)$'.- quiet
logical If
FALSE, prints messages about files that are or can be removed. Default isFALSE.
Value
character A character vector of paths to the raster files that were empty. Returns invisibly.