[GRASS-user] r.mapcalc and the neighborhood modifier

Paulo van Breugel p.vanbreugel at gmail.com
Mon Aug 18 03:48:57 PDT 2014


Hi Rainer,

I came across this email and was wondering if you found a solution for this
problem?
Cheers,

Paulo


On Tue, Jul 16, 2013 at 12:50 PM, Rainer M Krug <Rainer at krugs.de> wrote:

> Hi
>
> I would like to create a new raster layer, based on the neighborhood
> modifier, but where the offset is not constant, but the cell value in a
> different map.
>
> Reasoning: I am modeling seed dispersal into neighboring cells and the
> direction is based on the aspect. I created the aspect in agnps format
> ("flowdir") and I created two layers (flowdir_dx and flowdir_dy)
> indicating the x and y offset
> based on flowdir.
>
> Now when simulating the flow, I want to use:
>
> ,----
> | r.mapcalc expression="test = seeds[flowdir_dy, flowdir_dx]" --overwrite
> `----
>
> but I get the following error:
> ,----
> | syntax error, unexpected NAME, expecting INTEGER or '-'
> | Parse error
> | ERROR: parse error
> `----
>
> I assume from that error message, that I can not supply a map go get the
> values for the neighborhood modifier, but have to use constant values.
>
> I could put these into if statements, but I wanted to avoid these if
> possible.
>
> Is there a way that I can use the offset from a map?
>
> Cheers,
>
> Rainer
>
> --
> Rainer M. Krug
>
> email: RMKrug<at>gmail<dot>com
>
> _______________________________________________
> 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/20140818/9a75b565/attachment.html>


More information about the grass-user mailing list