[GRASS-user] Re: r.mapcalc and nested if

Milton Cezar Ribeiro miltinho.astronauta at gmail.com
Wed Apr 14 15:13:38 EDT 2010


Hi there,

may be the last command need double ==

r.mapclac 'final=if(first_map==1,0,first_map'

cheers

milton

2010/4/14 Jarek Jasiewicz <jarekj at amu.edu.pl>

> thedok78 pisze:
>
> Sorry, this is the expression:
>> r.mapcalc 'map2=if(map ==1
>>
>> ,if(mode(map[-1,-1],map[-1,0],map[-1,1],map[0,1],map[1,1],map[1,0],map[1,-1],map[0,-1])==1,0,mode(map[-1,-1],map[-1,0],map[-1,1],map[0,1],map[1,1],map[1,0],map[1,-1],map[0,-1]),map))'
>>
>> Thanks
>> Luca
>>
>>
> seem that much easier will be:
>
> r.neighbors input=your_map method=mode size=3 output=mode_output
> r.mapcalc 'first_map=if(your_map==1,output_mode,your_map)'
> r.mapclac 'final=if(first_map=1,0,first_map'
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100414/9f4f2798/attachment.html


More information about the grass-user mailing list