[GRASS-user] A question before I embark on a programming exercise

Moritz Lennert mlennert at club.worldonline.be
Fri Nov 14 03:36:20 PST 2014


On 14/11/14 11:21, Rainer M Krug wrote:
> Glynn Clements <glynn at gclements.plus.com> writes:
>
>> Moritz Lennert wrote:
>>
>>> r.mapcalc down_id = if(dir=1, id[1,1], if(dir=2, id[0,1], if(dir=3,
>>> id[-1,1] .... etc
>>
>> r.mapcalc follows C expression syntax; "="is assignment, "==" is the
>> equality test.
>
> In this case shouldn't it be
>
> ,----
> | r.mapcalc down_id = if(dir==1, id[1,1], if(dir==2, id[0,1], if(dir==3, id[-1,1] .... etc
> `----
>
> with "==" after the dir?

Yes, that's what Glynn is saying. Sorry, I wrote this example too quickly.

Moritz


More information about the grass-user mailing list