[GRASSLIST:5622] cat labels in mapcalc

Hello

I want to use cat labels instead of cat values in r.mapcalc
To create a new map from existing map's one category label
I tried this expression: r.mapcalc dene='if(@f28hey_cat=="R",1,0) # (R is cat label from f28hey_cat.)

Does anyone have an idea?

thanks in advance

--
Ahmet Temiz
Geological Engineer
General Directorate
of Disaster Affairs
TURKEY

______________________________________
Scanned and protected by Inflex
http://pldaniels.com/inflex

______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.

Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.

orkun wrote:

I want to use cat labels instead of cat values in r.mapcalc
To create a new map from existing map's one category label
I tried this expression:
r.mapcalc dene='if(@f28hey_cat=="R",1,0) # (R is cat label from f28hey_cat.)

r.mapcalc doesn't have a string type, and the "@" operator is only
valid if the category labels are numbers.

The above expression is equal to 1 if the category label from the map
"f28hey_cat" is equal to the cell value from the map "R". Double
quotes simply force a sequence of characters to be interpreted as a
map name.

--
Glynn Clements <glynn.clements@virgin.net>