[GRASS-dev] [GRASS GIS] #2917: r.mapcalc neighbour modifier uses wrong row
GRASS GIS
trac at osgeo.org
Wed Feb 24 19:54:54 PST 2016
#2917: r.mapcalc neighbour modifier uses wrong row
--------------------------+---------------------------------
Reporter: marisn | Owner: grass-dev@…
Type: defect | Status: new
Priority: blocker | Milestone: 7.0.4
Component: Raster | Version: svn-releasebranch70
Resolution: | Keywords: r.mapcalc
CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Comment (by glynn):
Replying to [comment:3 mlennert]:
> What I don't really understand (without having taken the time to delve
into the code) is why
>
{{{
r.mapcalc "nd = if(landclass96[1,0]!=landclass96, landclass96[1,0],
null())"
}}}
>
> provokes the bug, but
>
{{{
r.mapcalc "nd_temp = landclass96[1,0]"
r.mapcalc "nd2 = if(nd_temp!=landclass96, nd_temp, null())"
}}}
>
> doesn't.
In the first case, a single command uses two distinct row offsets, which
causes the row cache to be used. In the second case, each command only
uses a single row offset, so the row cache isn't used.
The precise test for whether the row cache is used is whether the number
of cached rows is greater than one and less than or equal to 8. The number
of cached rows is the maximum offset minus the minimum offset plus one.
See setup_map() in raster/r.mapcalc/map.c.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2917#comment:4>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list