View source: R/raster_gradient.R
grad_terra | R Documentation |
Gradient of terra raster using bilinear interpolation
grad_terra(rast = NULL, pts, xgrid = NULL, ygrid = NULL, zmat = NULL)
rast |
SpatRast object |
pts |
Matrix with two columns (one for each coordinate) |
xgrid |
Grid of x values (if rast not provided) |
ygrid |
Grid of y values (if rast not provided) |
zmat |
Matrix of raster values (if rast not provided) |
The gradient has a closed form solution if bilinear interpolation is used, as described in Appendix C of Michelot (2019, PhD thesis). https://etheses.whiterose.ac.uk/23688/
Matrix with same dimensions as pts, where the first column gives the gradient along the first dimension, and the second column along the second dimension.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.