.TH r.median 1grass "" "GRASS 6.4.2" "Grass User's Manual" .SH NAME \fI\fBr.median\fR\fR - Finds the median of values in a cover map within areas assigned the same category value in a user-specified base map. .SH KEYWORDS raster, statistics .SH SYNOPSIS \fBr.median\fR .br \fBr.median help\fR .br \fBr.median base\fR=\fIname\fR \fBcover\fR=\fIname\fR \fBoutput\fR=\fIname\fR [--\fBoverwrite\fR] [--\fBverbose\fR] [--\fBquiet\fR] .SS Flags: .IP "\fB--overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB--verbose\fR" 4m .br Verbose module output .IP "\fB--quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBbase\fR=\fIname\fR" 4m .br Name of base raster map .IP "\fBcover\fR=\fIname\fR" 4m .br Name of cover raster map .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output raster map .PP .SH DESCRIPTION \fIr.median\fR calculates the median category of data contained in a \fBcover\fR raster map layer for areas assigned the same category value in the user-specified \fBbase\fR raster map layer. These median values are stored in the new \fBoutput\fR map layer. .PP The \fBoutput\fR map is actually a \fIreclass\fR of the \fBbase\fR map. The \fBbase\fR map is an existing raster map layer in the user's current mapset search path. For each group of cells assigned the same category value in the \fBbase\fR map, the median of the values assigned these cells in the \fBcover\fR map will be computed. .PP The \fBcover\fR map is an existing raster map layer containing the values to be used to compute the median within each category of the \fBbase\fR map. .SH NOTES The user should use the results of \fIr.median\fR with care. Since this utility assigns a value to each cell which is based on global information (i.e., information at spatial locations other than just the location of the cell itself), the resultant map layer is only valid if the geographic region and mask settings are the same as they were at the time that the result map was created. .PP Results are affected by the current region settings and mask. .SH EXAMPLE Median K-factor (erosion) for Spearfish fields: \fC .DS .br g.region rast=fields -p .br r.median base=fields cover=soils.Kfactor output=K.by.farm.median .br r.univar K.by.farm.median .br .DE \fR .SH SEE ALSO \fIg.region\fR, \fIr.average\fR, \fIr.category\fR, \fIr.clump\fR, \fIr.describe\fR, \fIr.mapcalc\fR, \fIr.mfilter\fR, \fIr.mode\fR, \fIr.neighbors\fR, \fIr.reclass\fR, \fIr.statistics\fR, \fIr.stats\fR, \fIr.univar\fR .SH AUTHOR Michael Shapiro, U.S.Army Construction Engineering Research Laboratory .PP \fILast changed: $Date: 2008-05-16 21:09:06 +0200 (Fri, 16 May 2008) $\fR .PP Full index .PP © 2003-2011 GRASS Development Team