Why when using the terra::project function, is there no 'mean' or 'max' or 'min' etc method for how one raster is projected to another resolution and alignment?


From the documentation:

character. Method used for estimating the new cell values of a SpatRaster. One of:

near: nearest neighbor. This method is fast, and it can be the preferred method if the cell values represent classes. It is not a good choice for continuous values. This is used by default if the first layer of x is categorical.

bilinear: bilinear interpolation. This is the default if the first layer of x is numeric (not categorical).

cubic: cubic interpolation.

cubicspline: cubic spline interpolation.

Given these are relatively simple compared to the above methods, this feels like a deliberate choice.

1 Answer 1


The aim of a reprojection is to produce a grid on the new projection that accurately represents the values of the source grid on the new grid.

Interpolation methods like bilinear, cubic, etc try to do that by assuming a smoothness of the surface and guessing what the value at a projected grid cell might be.

Doing something like a "max" or "mean" would be putting a processing step on top of a projection step. For one, you'd have to specify the spatial range of the mean or max, and that's not really pertinent to a coordinate reprojection. If you want to do some sort of focal max or mean then its probably best done with inputs and outputs on the same coordinate basis.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.