NAME

r.what - Queries raster map layers on their category values and category labels.
(GRASS Raster Program)

SYNOPSIS

r.what
r.what help
r.what [-fci] input=name[,name,...] [cache=value] [null=string] [east_north=east,north[,east,north,...]]
r.what input=name[,name,...] [other options] < inputfile

DESCRIPTION

r.what 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.

The program will be run non-interactively if the user specifies the program parameter values and (optionally) a flag setting on the command line, using the form:

r.what [-fci] input=name[,name,...]
where each input name is the name of a raster map layer whose category values are to be queried, and the (optional) flag -f directs r.what to also output category labels. The location or locations of sites to be queried are entered with the east_north option. Multiple sites to be queried are entered separated by a comma. Alternately, the user can redirect a user-created ASCII input file containing a list of geographic coordinate pairs and (optionally) user-named labels, into r.what using the form:
r.what [-fci] input=name[,name,...] < inputfile
If the user does not enter coordinates with the east_north option or redirect an input file containing these coordinates into the program, the program will query the user for point locations and labels.

Thus, the user can simply type:

r.what
on the command line, without program arguments. In this case, the user will be prompted for the flag setting and parameter values using the standard GRASS parser.

OPTIONS

Flags:

-f
Also output the category label(s) associated with the cell(s) at the user-specified location(s).
-c
Turn on cache reporting.
-i
Output integer category values, not cell values.

Parameters:

input=name[,name,name,...]
The name(s) of one or more existing raster map layers to be queried.
cache=value
Size of point cache.
null=string
Character string to represent no data cell.
east_north=east,north[,east,north,...]
Coordinates for query

EXAMPLES

The contents of the ASCII inputfile to r.what can be typed in at the keyboard, redirected from a file, or piped from another program (like d.where). 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 end is typed to end input of coordinates to r.what. For example:
635342.21 7654321.09 site 1
653324.88 7563412.42 site 2
end
r.what output consists of the input geographic location and label, and, for each user-named raster map layer, the category value, and (if -f is specified) the category label associated with the cell(s) at this geographic location. Sample input (in regular font) to and output (in plain text) from r.what are given below.
r.what input=soils,aspect
635342.21 7654321.09 site 1
653324.88 7563412.42 site 2
end
635342.21|7654321.09|site 1|45|21
653324.88|7563412.42|site 2|44|20

r.what -f input=soils,aspect
635342.21 7654321.09 site 1
653324.88 7563412.42 site 2
end
635342.21|7654321.09|site 1|45|NaC|21|30 degrees NW
653324.88|7563412.42|site 2|44|NdC|20|15 degrees NW
Coordinates for query may be entered on the command line directly:
r.what input=soils,aspect east_north=635342.21,7654321.09,653324.88,7563412.42
635342.21|7654321.09|site 1|45|21
653324.88|7563412.42|site 2|44|20

NOTE

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

SEE ALSO

d.sites, d.where, r.cats, r.report, r.stats, r.series, parser

AUTHOR

Michael Shapiro, U.S. Army Construction Engineering Research Laboratory

Last changed: $Date: 2003/08/25 03:55:49 $