[GRASS-dev] [GRASS GIS] #3067: r.mapcalc gives wrong result when neighborhood modifier takes a cell above first
GRASS GIS
trac at osgeo.org
Fri Jun 17 12:44:40 PDT 2016
#3067: r.mapcalc gives wrong result when neighborhood modifier takes a cell above
first
----------------------------------------------+-------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: blocker | Milestone: 7.0.5
Component: Raster | Version: svn-trunk
Keywords: r.mapcalc, neighborhood modifier | CPU: Unspecified
Platform: Linux |
----------------------------------------------+-------------------------
When I run G7:r.mapcalc with `x = p[1,0] + p[-1,0]` (r.mapcalc possibly
first taking cell one row below), I get a correct result, but when I swap
the parts if the expression to `x = p[-1,0] + p[1,0]` (r.mapcalc possibly
first taking cell one row above), I get a wrong result. A reproducible
example follows.
{{{
#!bash
> r.in.ascii in=- out=p <<EOF
north: 10
south: 8
east: 20
west: 18
rows: 3
cols: 3
1 0 1
1 1 0
1 1 0
EOF
> g.region rast=p
> r.mapcalc "x1 = p[1,0] + p[-1,0]" && r.out.ascii x1
north: 10
south: 8
east: 20
west: 18
rows: 3
cols: 3
* * *
2 1 1
* * *
> r.mapcalc "x2 = p[-1,0] + p[1,0]" && r.out.ascii x2
north: 10
south: 8
east: 20
west: 18
rows: 3
cols: 3
* * *
2 2 0
* * *
}}}
I get same result with or without r67851 (row cache fix for #2917).
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3067>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list