Description Usage Arguments Details Author(s) See Also
View source: R/projectRaster_rigorous.R
Performs an area-weighted resampling of raster datasets.
1 2 3 4 5 6 7 8 | projectRaster_rigorous(
from,
to,
method = "mode",
na.rm = FALSE,
verbose = FALSE,
...
)
|
from |
Raster* The sources raster to be resampled. |
to |
Raster* A target raster that the from will be resampled to (extent, resolution, projection). |
method |
Character. Default is "mode". See details. |
na.rm |
Logical. Remove NAs before calculating cell stats? |
verbose |
logical. Enable verbose execution? Default is FALSE. |
... |
Currently unsupported. |
This function is designed to solve the problem of resampling/reprojecting rasters using area-based, not point based (e.g. nearest neighbor, bilinear, cubic convolution), resampling. The output pixel is a function of the areas of the input pixels, so this should be used for resampling from a finer resolution to a coarser resolution.
The method defaults to "mode", which will return the value covering the largest area of the output pixel area. Other methods will be added in the future.
A word of warning: this algorithm is SLOW. The function uses focal_hpc, so we highly recommend using it with a foreach engine running (e.g. use sfQuickInit() ). Keep in mind this is a "dirty" parallel problem, so different chunks may execute at different speeds and have different memory footprints.
Jonathan A. Greenberg
projectRaster
, extract
, aggregate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.