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]
r.what [-fci] input=name[,name,...]
[< inputfile] [cache=value] [null=string]
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) the flag setting on the command line, using the form:
-
r.what [-f] 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 user can also 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 [-f] input=name[,name,...]
[< inputfile]
If the user does not redirect an input file containing these coordinates into the program, the program will query the user for point locations and labels.
Alternately, 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.
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. 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
NOTES
The maximum number of raster map layers that can be queried at one time is 14.
SEE ALSO
d.sites, d.where, r.cats, r.report, r.stats, parser
AUTHOR
Michael Shapiro, U.S. Army Construction Engineering Research Laboratory