1r.cross(1) Grass User's Manual r.cross(1)
2
3
4
6 r.cross - Creates a cross product of the category values from multiple
7 raster map layers.
8
10 raster
11
13 r.cross
14 r.cross help
15 r.cross [-qz] input=string[,string,...] output=name [--overwrite]
16
17 Flags:
18 -q Quiet
19
20 -z Non-zero data only
21
22 --overwrite
23
24 Parameters:
25 input=string[,string,...]
26 Names of 2-10 input raster maps
27
28 output=name
29 Name for output raster map
30
32 r.cross creates an output raster map layer representing all unique com‐
33 binations of category values in the raster input layers
34 (input=name,name,name, ...). At least two, but not more than ten,
35 input map layers must be specified. The user must also specify a name
36 to be assigned to the output raster map layer created by r.cross.
37
39 The program will be run non-interactively if the user specifies the
40 names of between 2-10 raster map layers be used as input, and the name
41 of a raster map layer to hold program output.
42
43 With the -z flag zero data values are not crossed. This means that if
44 a zero category value occurs in any input data layer, the combination
45 is assigned to category zero in the resulting map layer, even if other
46 data layers contain non-zero data. In the example given above, use of
47 the -z option would cause 3 categories to be generated instead of 5.
48
49 If the -z flag is not specified, then map layer combinations in which
50 not all category values are zero will be assigned a unique category
51 value in the resulting map layer.
52
53 Category values in the new output map layer will be the cross-product
54 of the category values from these existing input map layers.
55
57 For example, suppose that, using two raster map layers, the following
58 combinations occur:
59 map1 map2
60 ___________
61 0 1
62 0 2
63 1 1
64 1 2
65 2 4
66 r.cross would produce a new raster map layer with 5 categories:
67 map1 map2 output
68 ____________________
69 0 1 1
70 0 2 2
71 1 1 3
72 1 2 4
73 2 4 5
74 Note: The actual category value assigned to a particular combination
75 in the result map layer is dependent on the order in which the combina‐
76 tions occur in the input map layer data and can be considered essen‐
77 tially random. The example given here is illustrative only.
78
80 The category file created for the output raster map layer describes the
81 combinations of input map layer category values which generated each
82 category. In the above example, the category labels would be:
83 category category
84 value label
85 ______________________________
86 1 layer1(0) layer2(1)
87 2 layer1(0) layer2(2)
88 3 layer1(1) layer2(1)
89 4 layer1(1) layer2(2)
90 5 layer1(2) layer2(4)
91 A random color table is also generated for the output map layer.
92
94 When run non-interactively, r.cross will not protect existing files in
95 the user's mapset. If the user specifies an output file name that
96 already exists in his mapset, the existing file will be overwritten by
97 the new r.cross output.
98
100 r.covar, r.stats
101
103 Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
104
105 Last changed: $Date: 2003/05/06 13:09:27 $
106
107 Full index
108
109
110
111GRASS 6.2.2 r.cross(1)