[GRASS-user] raster query on the basis of its labels

temiz temiz at deprem.gov.tr
Wed Jan 10 13:16:40 EST 2007


Jachym Cepicky wrote:
> hi,
>
>     if( @map, 1,0)
>
> should work
>
> jachym
>
> On Tue, Jan 09, 2007 at 01:44:51PM -0500, temiz wrote:
>   
>> hello
>>
>> I want to query my raster map on the basis of its labels using regular 
>> expression.
>> something like:
>> r.mapcalc map="if(labels~'xxx',1,0)"
>>
>> is it poosible ?
>>
>> regards
>>
>> -- 
>> Ahmet Temiz
>>
>>
>> -- 
>> This message has been scanned for viruses and
>> dangerous content by MailScanner, and is
>> believed to be clean.
>>
>> _______________________________________________
>> grassuser mailing list
>> grassuser at grass.itc.it
>> http://grass.itc.it/mailman/listinfo/grassuser
>>     
>
>   
thank you
But I think I need to give you more detail

my raster map is actually a geological map and includes so many rock 
type categories ( over 100).

something like this: (of course they are not separete fields)
~~~~~~~~
97      Tkisd         claystone-siltstone-sandstone (rock type )  eocene
~~~~~~~
if I want to query my raster map on its rock type. Say,  to display rock 
group containing claystone. what should I do  ?

I can do it on vector map using sql.
But I have to stay in raster side. Because I analyse the areas 
containing claystone and its slope angle higher than 20 deg
(another raster map).

shortly I need a command  like this:
r.mapcalc result="if((@map ~ 'claystone' && slp> 30),1,0))    # regular 
expression on a text  and this claystone exists
in many rock group. So using cat numbers is not practical.

I think r.mapcalc makes query on numerical values.

so what might be solution be ?

regards



-- 
Ahmet Temiz


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the grass-user mailing list