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