other versions
- jessie 6.4.4-1
- stretch 7.2.0-2
- testing 7.6.0-1
- unstable 7.6.0-1
- experimental 7.6.1-1~exp1
r.category(1grass) | Grass User's Manual | r.category(1grass) |
NAME¶
r.category - Manages category values and labels associated with user-specified raster map layers.KEYWORDS¶
raster, categorySYNOPSIS¶
r.categoryParameters:¶
- map=name
-
- cats=range[,range,...]
-
- vals=float[,float,...]
-
- fs=character|space|tab
-
- raster=name
-
- rules=name
-
- format=string
-
- coefficients=mult1,offset1,mult2,offset2
-
DESCRIPTION¶
r.category prints the category values and labels for the raster map layer specified by map=name to standard output. You can also use it to set category labels for a raster map. The user can specify all needed parameters on the command line, and run the program non-interactively. If the user does not specify any categories (e.g., using the optional cats=range[,range,...] argument), then all the category values and labels for the named raster map layer that occur in the map are printed. The entire map is read using r.describe, to determine which categories occur in the map. If a listing of categories is specified, then the labels for those categories only are printed. The cats may be specified as single category values, or as ranges of values. The user may also (optionally) specify that a field separator other than a space or tab be used to separate the category value from its corresponding category label in the output, by using the fs=character|space|tab option (see example below). If no field separator is specified by the user, a tab is used to separate these fields in the output, by default. The output is sent to standard output in the form of one category per line, with the category value first on the line, then an ASCII TAB character (or whatever single character or space is specified using the fs parameter), then the label for the category.NOTES¶
Any ASCII TAB characters which may be in the label are replaced by spaces. The output from r.category can be redirected into a file, or piped into another program.Input from a file¶
The rules option allows the user to assign category labels from values found in a file. The label can refer to a single category, range of categories, floating point value, or a range of floating point values. The format is given as follows.Default and dynamic category labels¶
Default and dynamic category labels can be created for categories that are not explicitly labeled. The coefficient line can be followed by explicit category labels which override the format label generation.0:no data
2: .
5: . ## explicit category labels
7: .
5.5:5:9 label description
or
15:30 label description
- $1 refers to the value num*5.0+1000 (ie, using the first 2 coefficients)
- $2 refers to the value num*5.0+1005 (ie, using the last 2 coefficients)
EXAMPLES¶
- Example output:
- Example defining category labels:
-
TODO¶
Respect the fs= field separator setting for input rules.SEE ALSO¶
UNIX Manual entries for awk and sort r.coin, r.describe, d.what.rast, r.supportAUTHORS¶
Michael Shapiro, U.S. Army Construction Engineering Research LaboratoryGRASS 6.4.4 |