r.resamp.stats(1grass)
π r.resamp.stats π
okay bestie, welcome to the GRASS User's Manual glow-up of r.resamp.stats, and honestly? this one's a baddie. she takes your raster map layers and resamples them onto a coarser grid using aggregation. downsizing but make it math. β¨
β¨ NAME β¨
r.resamp.stats β Resamples raster map layers to a coarser grid using aggregation.
π KEYWORDS π
raster, resample, univariate statistics, aggregation
π¦ SYNOPSIS π¦
r.resamp.stats
r.resamp.stats --help
r.resamp.stats [-nw] input=name output=name [method=string]
[quantile=float] [--overwrite] [--help] [--verbose] [--quiet]
[--ui]
πΈ Flags πΈ
-nβ Propagate NULLs-wβ Weight according to area (and yes, she's slower for it π )--overwriteβ Allow output files to overwrite existing files--helpβ Print usage summary--verboseβ Verbose module output--quietβ Quiet module output--uiβ Force launching GUI dialog
π Parameters π
input=name[required]β Name of input raster mapoutput=name[required]β Name for output raster mapmethod=stringβ Aggregation method- Options:
average,median,mode,minimum,maximum,range,quart1,quart3,perc90,sum,variance,stddev,quantile,count,diversity - Default:
average
- Options:
quantile=floatβ Quantile to calculate formethod=quantile- Options:
0.0-1.0 - Default:
0.5
- Options:
π DESCRIPTION π
so r.resamp.stats fills a grid cell (raster) matrix with aggregated values generated from a set of input layer data points. she's gluing a bunch of little cells together into a bigger cell and giving you one number that represents the whole squad. no cap.
Without the -w switch, the aggregate is computed over all of the input cells whose centers lie within the output cell. if your center's inside the destination zone, you're in the census, periodt.
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. highkey worth it if you care about the truth. π«Ά
π NOTES π
okay so the resampling modules β r.resample, r.resamp.stats, r.resamp.interp, r.resamp.rst β all resample the map to match the current region settings. set your region first or she will simply serve you the wrong vibe.
The notion of weighting doesn't make any sense for the min and max aggregates. however (and this is the plot twist), 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. iconic behavior fr fr.
π EXAMPLE π
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
Resampling of 6m DEM (left) to 20m DEM (right) with weighted resampling (subset)
β SEE ALSO β
g.region,r.resample,r.resamp.rst,r.resamp.filter,r.resamp.interp,r.neighbors
Overview: Interpolation and Resampling in GRASS
Examples how statistical functions are applied can be found in the r.neighbors module documentation.
π§ AUTHOR π§
Glynn Clements
π SOURCE CODE π
Available at: r.resamp.stats source code (history)
Latest change: Friday Aug 08 09:39:19 2025 in commit: ed72c71d8580e872cd6fd345c84a15c324764465
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
π that's the whole page bestie, go aggregate something gorgeous π
and that's a wrap!! this manual is Β© 2003-2026 GRASS Development Team, straight out of the GRASS 8.5.0 Reference Manual β stay slaying, r.resamp.stats girlies ππβ¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms