[GRASS5] [bug #1436] (grass) r.mapcalc seems to treat [0,1] like [0,2]

this bug's URL: http://intevation.de/rt/webrt?serial_num=1436
-------------------------------------------------------------------------

Subject: r.mapcalc seems to treat [0,1] like [0,2]

Platform: GNU/Linux/i386
grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: 5.0.0

If I do the following:

r.null grown null=0
r.mapcalc "grown=if(grown[0,0], grown[0,0], if(grown[0,1], grown[0,1]))"

r.mapcalc seems to treat [0,1] like [0,2] ..
(I'm trying to make a single-pixel wide line a two-pixel wide line)

An explanitory picture of the output can be found at:
http://www.mathlab.sunysb.edu/~mibowman/los_mc.png

thanks
Hamish
<ihatejunkyabastards@yahoo.com>

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

Subject: r.mapcalc seems to treat [0,1] like [0,2]

Oops. Due to a missing break statement, the code shifts integer maps
twice, so the column offset is effectively doubled.

You can fix this manually, by adding a break statement at line 225 in
src/raster/r.mapcalc3/map.c (see the other two clauses for
comparison), or by applying the attached patch.

--
Glynn Clements <glynn.clements@virgin.net>

(attachments)

grass-map.c.diff (271 Bytes)