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.
Thank you
Stéphanie
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
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?
On Thu, 2009-02-26 at 13:01 +0100, 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?
Dear Stephanie,
please have a look in the manual ( "g.manual r.category" ). The examples
are very helpful.
Kind regards, Nikos
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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
I use r.reclass that's it?
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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-userI 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
Moritz Lennert wrote:
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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-userI 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
Ok. I see it in the manual page of the 6.5 version.
Actually i work with the 6.2 version (i'm at office and i haven't "control" on the installed version) and i think r.cats doesn't have this option. But with r.reclass i achieved.
Here i have a map with integer categories values; i want to recode these categories but keep old values as labels.
Stéphanie
On 26/02/09 14:01, FAROUX STEPHANIE wrote:
Moritz Lennert wrote:
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@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-userI 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
Ok. I see it in the manual page of the 6.5 version.
It's been there since 6.3, which was released almost a year ago...
Actually i work with the 6.2 version (i'm at office and i haven't "control" on the installed version) and i think r.cats doesn't have this option.
No.
But with r.reclass i achieved.
Ok, you could also look at r.support for interactive editing of the labels.
Here i have a map with integer categories values; i want to recode these categories but keep old values as labels.
Depending on what you mean by recode, you could also check out r.recode.
Moritz
stephanie.faroux wrote:
I see the function r.cats which allows to read categories
of a raster map, but how can i define these attributes?
r.cats has been replaced by r.category in grass 6.3+, the new version
can both read and write attribute labels.
Should i pass by a vector map? In the database menu, it
doesn't seem possible to add a table for a raster map.
actually v.to.rast's labelcol= option is slightly broken right now, see
bug #175: http://trac.osgeo.org/grass/ticket/175
(work-around given in the bug report)
it's not nearly as rich as vector attribute management (DB).
see also http://grass.osgeo.org/wiki/Tips_for_Arc_users#Import_ArcASCII_raster_grid_and_connect_to_database
Hamish
Moritz wrote:
I do see that the man page might not be particularly clear
on its usage (the Description part only mentions printing,
not managing labels
fixed in svn.
and the part on dynamic labels is a bit cryptic).
as the result of a bit of cut & paste reorder so things are used before
they are introduced. If anyone is keen, feel free to improve that.
I am note sure about the status of floating point ranges, the man page
says:
5.5:5:9 label description
but I'm not sure I understand that without looking in the code.
(range or discrete values? range would be nice)
I seem to remember that d.legend used to be able to show cat labels for
floating point maps, but also seem to recall that wasn't working the
last time I tried. Probably need to check to see if it works in grass5.4
and go from there.
Hamish
> But with r.reclass i achieved.
Ok, you could also look at r.support for interactive editing of the labels.
or just edit the $MAPSET/cats/ file directly. It's fairly simple, look for
an example in the spearfish dataset files.
Hamish