[GRASS-user] r.mapcalc question

Christian Schwartze christian.schwartze at uni-jena.de
Thu Jan 28 08:31:08 EST 2010


dir_x and dir_y are maps, and as far as I know they can not use in map[x,y] 
since it expects relative coordinates for the moving window...even though 
your raster values are in [0,1,-1]

Christian.

--------------------------------------------------
From: "Achim Kisseler" <ak7 at jupiter.uni-freiburg.de>
Sent: Thursday, January 28, 2010 2:13 PM
To: <grass-users at lists.osgeo.org>
Subject: [GRASS-user] r.mapcalc question

> Hello grass-users,
>
> I have a problem running a r.mapcalc procedure:
>
> given two maps
> dir_x,
> dir_y
>
> with 0,1,-1 entries
>
> I want to run:
>
> r.mapcalc "the_map=if(isnull(the_map),the_map[dir_x,dir_y],null())"
>
> in order to make a r.water.outlet on many many areas at the same time.
>
> The error I get is:
> syntax error, unexpected NAME, expecting INTEGER or '-'
>
> why does dir_x/dir_y does not return an integer here? Using int(dir_x) 
> also does not work.
>
> Until now I use a r.mapcalc command with many "if", checking the direction 
> of every pixel every time. But this is quite slow.
>
> Achim
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user 



More information about the grass-user mailing list