r.resamp.stats(1)

πŸ’– r.resamp.stats πŸ’–

okay bestie, welcome to the GRASS GIS User's Manual page for r.resamp.stats(1) β€” yes it's a manual page, no it's not boring, we're making it cute. sit down, grab a strawberry πŸ“, and let's make your rasters coarser together.


✨ NAME ✨

r.resamp.stats β€” resamples raster map layers to a coarser grid using aggregation. it's giving glow-down but make it statistics πŸ’…


πŸŽ€ KEYWORDS πŸŽ€

raster, resample, univariate statistics, aggregation

the vibe check passed: it's a raster thing, it resamples, and it does stats. iconic.


🌸 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. (the NULLs get to stay, they're main characters too 😭)
  • -w β€” Weight according to area (slower). slow and accurate, a true slow burn romance
  • --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 map
  • output=name [required] β€” Name for output raster map
  • method=string β€” Aggregation method
    • Options: average, median, mode, minimum, maximum, range, quart1, quart3, perc90, sum, variance, stddev, quantile, count, diversity
    • Default: average
  • quantile=float β€” Quantile to calculate for method=quantile
    • Options: 0.0-1.0
    • Default: 0.5

🌈 DESCRIPTION 🌈

so, r.resamp.stats fills a grid cell (raster) matrix with aggregated values generated from a set of input layer data points. basically it takes a whole bunch of little cells and squishes them into bigger ones, and instead of just picking one value it aggregates them. slay.

Without the -w switch, the aggregate is computed over all of the input cells whose centers lie within the output cell. simple. clean. no notes.

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. the way that it's slower but better?? it's giving "worth it" πŸ’…


πŸ”₯ NOTES πŸ”₯

Resampling modules (r.resample, r.resamp.stats, r.resamp.interp, r.resamp.rst) resample the map to match the current region settings. so like, check your region first bestie, fr fr.

The notion of weighting doesn't make any sense for the min and max aggregates. (like, what's a weighted minimum. be serious.) 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.


⭐ 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 GIS

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)

Accessed: Saturday Jan 17 05:40:58 2026

Main index | Raster index | Topics index | Keywords index | Graphical index | Full index


okay that's the whole page, no cap. this was the GRASS GIS 8.4.2 Reference Manual πŸ’– β€” Β© 2003-2025 GRASS Development Team β€” running on GRASS 8.4.2 🌈 and it's still r.resamp.stats(1) to the very end, periodt. go resample something, bestie, you got this πŸŽ€βœ¨

πŸ“¦ where this page comes from