[GRASS-user] categories in raster map

Moritz Lennert mlennert at club.worldonline.be
Thu Feb 26 07:50:03 EST 2009


On 26/02/09 13:34, FAROUX STEPHANIE wrote:
> FAROUX STEPHANIE wrote:
>> Moritz Lennert wrote:
>>> On 26/02/09 11:47, FAROUX STEPHANIE wrote:
>>>> Hello,
>>>> I see the function r.cats which allows to read categories of a 
>>>> raster map, but how can i define these attributes? Should i pass by 
>>>> a vector map? In the database menu, it doesn't seem possible to add 
>>>> a table for a raster map.
>>>
>>> Raster maps have categories and labels. Categories have to be 
>>> numerical, labels can be anything. Each pixel needs to have a 
>>> category value (or NULL) and optionally you can have one (and only 
>>> one) label per category value.
>>>
>>> BTW, r.cats is now replaced by r.category.
>>>
>>> If you want to link a cell with many attributes, you will have to use 
>>> vector grids (v.mkgrid or r.to.vect as you suggestà).
>>>
>>> Moritz
>>>
>> Thank you. And how do you put labels on categories please?
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
> I use r.reclass that's it?

No, r.reclass "changes" category values, not labels.

I think it would be better if you explained a bit more clearly what you 
want to do, i.e. what do you have and what would you like to have.

Normally, r.category seems to be what you are looking for, using the 
rules= option.

I do see that the man page might not be particularly clear on its usage 
(the Description part only mentions printing, not managing labels and 
the part on dynamic labels is a bit cryptic). But the section "Input 
from a file" should give you what you need.

Moritz


More information about the grass-user mailing list