r.resamp.stats.1grass man page

r.resamp.stats — Resamples raster map layers to a coarser grid using aggregation.


raster, resample


r.resamp.stats --help
r.resamp.stats [-nw] input=name output=name [method=string] [quantile=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Propagate NULLs
Weight according to area (slower)
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input raster map
output=name [required]
Name for output raster map
Aggregation method
Options: average, median, mode, minimum, maximum, quart1, quart3, perc90, sum, variance, stddev, quantile
Default: average
Quantile to calculate for method=quantile
Options: 0.0-1.0
Default: 0.5


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.


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


Glynn Clements

Last changed: $Date: 2015-10-29 16:52:52 +0100 (Thu, 29 Oct 2015) $

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

© 2003-2016 GRASS Development Team, GRASS GIS 7.0.4 Reference Manual


GRASS 7.0.4 Grass User's Manual