1r.what(1)                     Grass User's Manual                    r.what(1)
2
3
4

NAME

6       r.what   - Queries raster map layers on their category values and cate‐
7       gory labels.
8

KEYWORDS

10       raster
11

SYNOPSIS

13       r.what
14       r.what help
15       r.what      [-fci]      input=string[,string,...]       [cache=integer]
16       [null=string]   [east_north=east,north[,east,north,...]]
17
18   Flags:
19       -f  Show the category label in the grid cell(s)
20
21       -c  Turn on cache reporting
22
23       -i  Output integer category values, not cell values
24
25   Parameters:
26       input=string[,string,...]
27           Name of existing raster map(s) to query
28
29       cache=integer
30           Size of point cache Default: 500
31
32       null=string
33           Char string to represent no data cell Default: *
34
35       east_north=east,north[,east,north,...]
36           Coordinates for query
37

DESCRIPTION

39       r.what outputs the category values and (optionally) the category labels
40       associated with user-specified locations on raster input map(s).  Loca‐
41       tions  are  specified as geographic x,y coordinate pairs (i.e., pair of
42       eastings and northings); the user can  also  (optionally)  associate  a
43       label with each location.
44
45       The  input  coordinates can be entered directly on the command line, or
46       redirected via stdin from an input text file,  script,  or  piped  from
47       another program (like d.where).
48
49       If  none of the above input methods are used and the module is run from
50       the terminal prompt, the program will interactively query the user  for
51       point locations and labels.
52
53       Each  line  of  the  input  consists  of an easting, a northing, and an
54       optional label, which are separated by spaces. In interactive mode, the
55       word "end" must be typed after the last pair of input coordinates.
56
57       r.what output consists of the input geographic location and label, and,
58       for each user-named raster map layer, the category value, and  (if  the
59       -f  label  flag  is  specified)  the category label associated with the
60       cell(s) at this geographic location.
61

EXAMPLES

63   Input from stdin on the command line
64       Input coordinates may be given directly from stdin, for example:
65        (input data appears between the "EOF" markers)
66       r.what input=soils,aspect << EOF
67       635342.21 7654321.09 site 1
68       653324.88 7563412.42 site 2
69       EOF
70       635342.21|7654321.09|site 1|45|21
71       653324.88|7563412.42|site 2|44|20
72
73       echo "635342.21 7654321.09" | r.what input=soils,aspect
74       635342.21|7654321.09|45|21
75
76
77   Input from a text file containing coordinates
78       The contents of an ASCII text file can be redirected to r.what as  fol‐
79       lows.  If  we have a file called input_coord.txt containing the coordi‐
80       nates and labels given in the example above:
81       r.what input=soils,aspect < input_coord.txt
82       635342.21|7654321.09|site 1|45|21
83       653324.88|7563412.42|site 2|44|20
84
85
86   Input coordinates given as a module option
87       The module's east_north parameter can be used to enter coordinate pairs
88       directly.  The maximum number of pairs will be limited by your system's
89       maximum input line length (e.g. 4096 characters).
90       r.what                                               input=soils,aspect
91       east_north=635342.21,7654321.09,653324.88,7563412.42
92       635342.21|7654321.09|45|21
93       653324.88|7563412.42|44|20
94
95
96   Input coordinates piped from another program
97       The  input  coordinates  may be "piped" from the stdout of another pro‐
98       gram.  For example:
99       d.where | r.what input=soils,aspect
100       635342.21|7654321.09|45|21
101       653324.88|7563412.42|44|20
102        In the next example, vector  point  coordinates  are  piped  from  the
103       v.out.ascii  module . The standard UNIX program "tr" is used to convert
104       the column separators in v.out.ascii's output into spaces for r.what.
105       v.out.ascii bugsites fs=' ' | r.what input=soils,aspect
106
107
108   Output containing raster map category labels
109       Here we use the -f label flag to enable the output of  category  labels
110       associated  with  the  raster  cell(s), as well as values. (categorical
111       maps only)
112       r.what -f input=soils,aspect << EOF
113       635342.21 7654321.09 site 1
114       653324.88 7563412.42 site 2
115       EOF
116       635342.21|7654321.09|site 1|45|NaC|21|30 degrees NW
117       653324.88|7563412.42|site 2|44|NdC|20|15 degrees NW
118
119

NOTE

121       The maximum number of raster map layers that can be queried at one time
122       is 150.
123

SEE ALSO

125         d.where,  r.cats,  r.report,  r.stats,  r.series,  r.univar,  v.what,
126       v.what.rast, v.what.vect
127

AUTHOR

129       Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
130
131       Last changed: $Date: 2007/03/23 22:54:16 $
132
133       Full index
134
135
136
137GRASS 6.2.2                                                          r.what(1)
Impressum