.TH r.what 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBr.what\fR\fR - Queries raster map layers on their category values and category labels. .SH KEYWORDS raster, querying .SH SYNOPSIS \fBr.what\fR .br \fBr.what help\fR .br \fBr.what\fR [\-\fBnfric\fR] \fBinput\fR=\fIstring\fR[,\fIstring\fR,...] [\fBcache\fR=\fIinteger\fR] [\fBnull\fR=\fIstring\fR] [\fBfs\fR=\fIcharacter\fR] [\fBeast_north\fR=\fIeast,north\fR[,\fIeast,north\fR,...]] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-n\fR" 4m .br Output header row .IP "\fB\-f\fR" 4m .br Show the category labels of the grid cell(s) .IP "\fB\-r\fR" 4m .br Output color values as RRR:GGG:BBB .IP "\fB\-i\fR" 4m .br Output integer category values, not cell values .IP "\fB\-c\fR" 4m .br Turn on cache reporting .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Name of existing raster map(s) to query .IP "\fBcache\fR=\fIinteger\fR" 4m .br Size of point cache .br Default: \fI500\fR .IP "\fBnull\fR=\fIstring\fR" 4m .br Char string to represent no data cell .br Default: \fI*\fR .IP "\fBfs\fR=\fIcharacter\fR" 4m .br Field separator .br Special characters: newline, space, comma, tab .br Default: \fI|\fR .IP "\fBeast_north\fR=\fIeast,north[,\fIeast,north\fR,...]\fR" 4m .br Coordinates for query .PP .SH DESCRIPTION \fIr.what\fR outputs the category values and (optionally) the category labels associated with user-specified locations on raster input map(s). Locations are specified as geographic x,y coordinate pairs (i.e., pair of eastings and northings); the user can also (optionally) associate a label with each location. .PP The input coordinates can be entered directly on the command line, or redirected via stdin from an input text file, script, or piped from another program (like \fId.where\fR). .PP If none of the above input methods are used and the module is run from the terminal prompt, the program will interactively query the user for point locations and labels. .PP Each line of the input consists of an easting, a northing, and an optional label, which are separated by spaces. In interactive mode, the word \(dqend" must be typed after the last pair of input coordinates. .PP \fIr.what\fR output consists of the input geographic location and label, and, for each user-named raster map layer, the category value, and (if the \fB-f\fR label flag is specified) the category label associated with the cell(s) at this geographic location. .SH EXAMPLES .SS Input from stdin on the command line Input coordinates may be given directly from stdin, for example: .br (input data appears between the "EOF" markers) \fC .DS .br r.what input=soils,aspect << EOF .br 635342.21 7654321.09 site 1 .br 653324.88 7563412.42 site 2 .br EOF .br .br 635342.21|7654321.09|site 1|45|21 .br 653324.88|7563412.42|site 2|44|20 .br .DE \fR \fC .DS .br echo "635342.21 7654321.09" | r.what input=soils,aspect .br .br 635342.21|7654321.09|45|21 .br .DE \fR .SS Input from a text file containing coordinates The contents of an ASCII text file can be redirected to \fIr.what\fR as follows. If we have a file called \fIinput_coord.txt\fR containing the coordinates and labels given in the example above: \fC .DS .br r.what input=soils,aspect < input_coord.txt .br .br 635342.21|7654321.09|site 1|45|21 .br 653324.88|7563412.42|site 2|44|20 .br .DE \fR .SS Input coordinates given as a module option The module's \fBeast_north\fR parameter can be used to enter coordinate pairs directly. The maximum number of pairs will be limited by your system's maximum input line length (e.g. 4096 characters). \fC .DS .br r.what input=soils,aspect east_north=635342.21,7654321.09,653324.88,7563412.42 .br .br 635342.21|7654321.09|45|21 .br 653324.88|7563412.42|44|20 .br .DE \fR .SS Input coordinates piped from another program The input coordinates may be "piped" from the stdout of another program. For example: \fC .DS .br d.where | r.what input=soils,aspect .br .br 635342.21|7654321.09|45|21 .br 653324.88|7563412.42|44|20 .br .DE \fR In the next example, vector point coordinates are piped from the \fIv.out.ascii\fR module . The standard UNIX program "tr" is used to convert the column separators in \fIv.out.ascii\fR's output into spaces for \fIr.what\fR. \fC .DS .br v.out.ascii bugsites fs=' ' | r.what input=soils,aspect .br .DE \fR .SS Output containing raster map category labels Here we use the \fB-f\fR label flag to enable the output of category labels associated with the raster cell(s), as well as values. (categorical maps only) \fC .DS .br r.what \-f input=soils,aspect << EOF .br 635342.21 7654321.09 site 1 .br 653324.88 7563412.42 site 2 .br EOF .br .br 635342.21|7654321.09|site 1|45|NaC|21|30 degrees NW .br 653324.88|7563412.42|site 2|44|NdC|20|15 degrees NW .br .DE \fR .SH NOTE The maximum number of raster map layers that can be queried at one time is 400. .SH SEE ALSO \fI d.where, r.category, r.report, r.stats, r.series, r.univar, v.what, v.what.rast, v.what.vect \fR .SH AUTHOR Michael Shapiro, U.S. Army Construction Engineering Research Laboratory .PP \fILast changed: $Date: 2010-09-16 09:25:59 +0200 (Thu, 16 Sep 2010) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team