.TH r.cross .SH NAME \fIr.cross\fR \- Creates a cross product of the category values from multiple raster map layers. .br .I (GRASS Raster Program) .SH SYNOPSIS \fBr.cross\fR .br \fBr.cross help\fR .br \fBr.cross \fR[\fB-qz\fR] \fBinput\*=\fIname,name\fR[,\fIname\fR,...] \fBoutput\*=\fIname\fR .SH DESCRIPTION .I r.cross creates an .I output raster map layer representing all unique combinations of category values in the raster input layers (input\*=\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, using the form: .LP .RS \fBr.cross \fR[\fB-qz\fR] \fBinput\*=\fIname,name\fR[,\fIname\fR,...] \fBoutput\*=\fIname\fR .RE .LP where each input \fIname\fR specifies the name of a raster map layer to be used in calculating the cross product, the output \fIname\fR specifies the name of a raster map layer to hold program output, and the options \fI-q\fR and \fI-z\fR respectively specify that the program is to run quietly and exclude zero data values. .LP Alternately, the user can simply type \fBr.cross\fR on the command line, without program arguments. In this case, the user will be prompted for needed input and output map names and flag settings using the standard GRASS parser interface described in the manual entry for \fIparser\fR. .LP \fBFlags:\fR .IP \fB-q\fR 18 Run quietly. Supresses output of program percent-complete messages. If this flag is not used, these messages are printed out. .IP \fB-z\fR 18 Do not cross zero data values. 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 -z option would cause 3 categories to be generated instead of 5. If the -z 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. .LP \fBParameters:\fR .IP "\fBinput\*=\fIname,name\fR[,\fIname\fR,...]" 18 The names of between two and ten existing raster map layers to be used as input. 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. .IP \fBoutput\*=\fIname\fR 18 The name assigned to the new raster map layer created by \fIr.cross\fR, containing program output. .SH EXAMPLE For example, suppose that, using two raster map layers, the following combinations occur: .RS .TS ll nn. map1 map2 _ 0 1 0 2 1 1 1 2 2 4 .TE .RE \fIr.cross\fR would produce a new raster map layer with 5 categories: .RS .TS lll nnn. map1 map2 output _ 0 1 1 0 2 2 1 1 3 1 2 4 2 4 5 .TE .RE 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: .RS .TS ll ll nl. category category value label _ 1 layer1(0) layer2(1) 2 layer1(0) layer2(2) 3 layer1(1) layer2(1) 4 layer1(1) layer2(2) 5 layer1(2) layer2(4) .TE .RE 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 .I r.corr, .I r.covar, .I r.stats, and .I parser .SH "AUTHOR" Michael Shapiro, U.S. Army Construction Engineering Research Laboratory