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