crop.all {climodr} | R Documentation |
Cropping tiff data
Description
Crops input data to the extent size and reprojects them into project Coordinate reference system.
Usage
crop.all(
envrmt = .GlobalEnv$envrmt,
method = "MB_Timeseries",
crs = NULL,
ext = NULL,
overwrite = FALSE,
...
)
Arguments
envrmt |
variable name of your envrmt list created using climodr's 'envi.create' function. Default = envrmt. |
method |
character. Use "MB_Timeseries" for now. More methods are planned and will be added in future. |
crs |
Coordinate reference system Used to crop all images in folder_path. If crs it will automatically reprojected into this one. Default: crs of smallest Extent. |
ext |
SpatRaster, SpatVector or SpatExtent. Extent all data is cropped into. Default: Smallest Extent in folder_path. |
overwrite |
logical. Should existing files with the same filename be overwritten? Default = FALSE |
... |
arguments passed down from other functions. |
Value
SpatRaster-Stack. Also saved to /workflow/rworkflow
See Also
'fin.csv', 'calc.indices'
Examples
#create climodr environment and allow terra-functions to use 70% of RAM
envrmt <- envi.create(proj_path = tempdir(),
memfrac = 0.7)
# Load the climodr example data into the current climodr environment
clim.sample(envrmt = envrmt)
# Crop all raster bands
crop.all(envrmt = envrmt,
method = "MB_Timeseries",
overwrite = TRUE)