r.resamp.stats fills a grid cell (raster) matrix with aggregated values generated from a set of input layer data points.
Without the -w switch, the aggregate is computed over all of the input cells whose centers lie within the output cell.
With the -w switch, the aggregate uses the values from all input cells which intersect the output cell, weighted according to the proportion of the source cell which lies inside the output cell. This is slower, but produces a more accurate result.
Resampling modules (r.resample, r.resamp.stats, r.resamp.interp, r.resamp.rst) resample the map to match the current region settings.
The notion of weighting doesn't make any sense for the min and max aggregates. However, the -w flag still has significance in that, when multiple destination cells overlap a source cell, the source cell is included in the calculation of all of the destination cells.
By specifying the number of parallel processes with nprocs option, r.resamp.stats can run faster. See the benchmark script in the source code.
To reduce the memory requirements to minimum, set option memory to zero. To take advantage of the parallelization, GRASS needs to be compiled with OpenMP enabled.
Resample elevation raster map to a lower resolution (from 6m to 20m; North Carolina sample dataset):
g.region raster=el_D782_6m -p g.region res=20 -ap # from 6m to 20m: weighted resampling -w r.resamp.stats -w input=el_D782_6m output=el_D782_20m
Overview: Interpolation and Resampling in GRASS
Examples how statistical functions are applied can be found in the r.neighbors module documentation.
Available at: r.resamp.stats source code (history)
Latest change: Wednesday Sep 02 22:25:59 2026 in commit: ba172cdc5e8f3bd458e070d5098b7421a937f932
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2026 GRASS Development Team, GRASS 8.6.0dev Reference Manual