.TH r.cross 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBr.cross\fR\fR - Creates a cross product of the category values from multiple raster map layers. .SH KEYWORDS raster, statistics .SH SYNOPSIS \fBr.cross\fR .br \fBr.cross help\fR .br \fBr.cross\fR [\-\fBzq\fR] \fBinput\fR=\fIstring\fR[,\fIstring\fR,...] \fBoutput\fR=\fIname\fR [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-z\fR" 4m .br Non-zero data only .IP "\fB\-q\fR" 4m .br Run quietly .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 "\fBinput\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Names of 2-30 input raster maps .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output raster map .PP .SH DESCRIPTION \fIr.cross\fR creates an \fIoutput\fR raster map layer representing all unique combinations of category values in the raster input layers (\fBinput=\fR\fIname,name,name\fR, ...). At least two, but not more than ten, \fIinput\fR map layers must be specified. The user must also specify a name to be assigned to the \fIoutput\fR raster map layer created by \fIr.cross\fR. .SH OPTIONS The program will be run non-interactively if the user specifies the names of between 2-10 raster map layers be used as \fIinput\fR, and the name of a raster map layer to hold program \fIoutput\fR. .PP With the \fB-z\fR flag zero data values are not crossed. This means that if a zero category value occurs in any input data layer, the combination is assigned to category zero in the resulting map layer, even if other data layers contain non-zero data. In the example given above, use of the \fB-z\fR option would cause 3 categories to be generated instead of 5. .PP If the \fB-z\fR flag is not specified, then map layer combinations in which not all category values are zero will be assigned a unique category value in the resulting map layer. .PP Category values in the new \fIoutput\fR map layer will be the cross-product of the category values from these existing \fIinput\fR map layers. .SH EXAMPLE For example, suppose that, using two raster map layers, the following combinations occur: \fC .DS .br map1 map2 .br ___________ .br 0 1 .br 0 2 .br 1 1 .br 1 2 .br 2 4 .br .DE \fR \fIr.cross\fR would produce a new raster map layer with 5 categories: \fC .DS .br map1 map2 output .br ____________________ .br 0 1 1 .br 0 2 2 .br 1 1 3 .br 1 2 4 .br 2 4 5 .br .DE \fR Note: The actual category value assigned to a particular combination in the \fIresult\fR map layer is dependent on the order in which the combinations occur in the input map layer data and can be considered essentially random. The example given here is illustrative only. .SH SUPPORT FILES The category file created for the \fIoutput\fR raster map layer describes the combinations of input map layer category values which generated each category. In the above example, the category labels would be: \fC .DS .br category category .br value label .br ______________________________ .br 1 layer1(0) layer2(1) .br 2 layer1(0) layer2(2) .br 3 layer1(1) layer2(1) .br 4 layer1(1) layer2(2) .br 5 layer1(2) layer2(4) .br .DE \fR A random color table is also generated for the \fIoutput\fR map layer. .SH NOTES When run non-interactively, \fIr.cross\fR will not protect existing files in the user's mapset. If the user specifies an \fIoutput\fR file name that already exists in his mapset, the existing file will be overwritten by the new \fIr.cross\fR output. .SH SEE ALSO \fIr.covar\fR, \fIr.stats\fR .SH AUTHOR Michael Shapiro, U.S. Army Construction Engineering Research Laboratory .PP \fILast changed: $Date: 2008-08-12 05:34:28 +0200 (Tue, 12 Aug 2008) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team