1r.stats(1) Grass User's Manual r.stats(1)
2
3
4
6 r.stats - Generates area statistics for raster map layers.
7
9 raster
10
12 r.stats
13 r.stats help
14 r.stats [-1AacplnNgxCri] input=string[,string,...] [fs=charac‐
15 ter|space|tab] [nv=string] [output=string] [nsteps=integer]
16 [--verbose] [--quiet]
17
18 Flags:
19 -1
20 One cell (range) per line
21
22 -A
23 Print averaged values instead of intervals
24
25 -a
26 Print area totals
27
28 -c
29 Print cell counts
30
31 -p
32 Print APPROXIMATE percents (total percent may not be 100%)
33
34 -l
35 Print category labels
36
37 -n
38 Suppress reporting of any NULLs
39
40 -N
41 Suppress reporting of NULLs when all values are NULL
42
43 -g
44 Print grid coordinates (east and north)
45
46 -x
47 Print x and y (column and row)
48
49 -C
50 Report for cats fp ranges (fp maps only)
51
52 -r
53 Print raw indexes of fp ranges (fp maps only)
54
55 -i
56 Read fp map as integer (use map's quant rules)
57
58 --verbose
59 Verbose module output
60
61 --quiet
62 Quiet module output
63
64 Parameters:
65 input=string[,string,...]
66 Raster input maps(s)
67
68 fs=character|space|tab
69 Output field separator
70 Default: space
71
72 nv=string
73 String representing no data cell value
74 Default: *
75
76 output=string
77 Output file name
78
79 nsteps=integer
80 Number of fp subranges to collect stats from
81 Default: 255
82
84 r.stats calculates the area present in each of the categories of user-
85 selected raster map layer(s). Area statistics are given in units of
86 square meters and/or cell counts. This analysis uses the current geo‐
87 graphic region and mask settings. Output can be sent to a file in the
88 user's current working directory. If a single map layer is specified
89 on the command line, a list of areas in square meters (assuming the
90 map's coordinate system is in meters) for each category in the raster
91 map layer will be printed. (If the -c option is chosen, areas will be
92 stated in number of cells.) If multiple raster map layers are specified
93 on the command line, a cross-tabulation table of areas for each combi‐
94 nation of categories in the map layers will be printed.
95
96 For example, if one raster map layer were specified, the output would
97 look like:
98 1:1350000.00
99 2:4940000.00
100 3:8870000.00
101 If three raster map layers a, b, and c, were specified, the output
102 would look like:
103 0:0:0:8027500.00
104 0:1:0:1152500.00
105 1:0:0:164227500.00
106 1:0:1:2177500.00
107 1:1:0:140092500.00
108 1:1:1:3355000.00
109 2:0:0:31277500.00
110 2:0:1:2490000.00
111 2:1:0:24207500.00
112 2:1:1:1752500.00
113 3:0:0:17140000.00
114 3:1:0:11270000.00
115 3:1:1:2500.00
116 Within each grouping, the first field represents the category value
117 of map layer a, the second represents the category values associated
118 with map layer b, the third represents category values for map layer c,
119 and the last field gives the area in square meters for the particular
120 combination of these three map layers' categories. For example, above,
121 combination 3,1,1 covered 2500 square meters. Fields are separated by
122 colons.
123
125 r.stats works in the current geographic region with the current mask.
126
127 If a nicely formatted output is desired, pipe the output into a command
128 which can create columnar output. For example, the command:
129
130 r.stats input=a,b,c | pr -3 | cat -s
131
132 will create a three-column output
133 1:4:4:10000.00 2:1:5:290000.00 2:4:5:2090000.00
134 1:4:5:1340000.00 2:2:5:350000.00 3:1:2:450000.00
135 2:1:1:1090000.00 2:4:1:700000.00 3:1:3:5280000.00
136 2:1:3:410000.00 2:4:3:10000.00 3:1:5:3140000.00
137 The output from r.stats on more than one map layer is sorted.
138
139 Note that the user has only the option of printing out cell statistics
140 in terms of cell counts and/or area totals. Users wishing to use dif‐
141 ferent units than are available here should use the GRASS program
142 r.report.
143
145 g.region, r.coin, r.describe, r.report, r.statistics, r.univar
146
148 Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
149
150 Last changed: $Date: 2007-12-17 14:53:55 +0100 (Mon, 17 Dec 2007) $
151
152 Full index
153
154 © 2003-2008 GRASS Development Team
155
156
157
158GRASS 6.3.0 r.stats(1)