Details Ticket 1436


Comment | Reply | Take | Open


Serial Number 1436
Subject r.mapcalc seems to treat [0,1] like [0,2]
Area bug
Queue grass
Requestors ihatejunkyabastards@yahoo.com
Owner none
Status resolved
Last User Contact Mon Nov 25 09:55:14 2002 (6 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Fri Nov 29 09:30:31 2002 (6 yr ago)
Created Fri Nov 22 01:13:05 2002 (6 yr ago)

Transaction History Ticket 1436


Fri, Nov 22 2002 01:13:05    Request created by guest  
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>
Sun, Nov 24 2002 13:54:33    Mail sent by glynn.clements@virgin.net  
Return-Path <glynn.clements@virgin.net>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn.clements@virgin.net>
MIME-Version 1.0
Content-Type multipart/mixed; boundary="B8Auq6fQrJ"
Content-Transfer-Encoding 7bit
Message-ID <15840.49813.153063.783381@cerise.nosuchdomain.co.uk>
Date Sun, 24 Nov 2002 12:14:13 +0000
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #1436] (grass) r.mapcalc seems to treat [0,1] like [0,2]
In-Reply-To <20021122001305.B530713A18@lists.intevation.de>
References <20021122001305.B530713A18@lists.intevation.de>
X-Mailer VM 6.94 under 21.4 (patch 10) "Military Intelligence" XEmacs Lucid
X-Spam-Status No, hits=-3.0 required=5.0 tests=EMAIL_ATTRIBUTION,IN_REP_TO,PATCH_UNIFIED_DIFF,REFERENCES, SPAM_PHRASE_00_01 version=2.43
X-Spam-Level
--B8Auq6fQrJ
Content-Type: text/plain; charset=us-ascii
Content-Description: message body and .signature
Content-Transfer-Encoding: 7bit


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>


--B8Auq6fQrJ
Content-Type: text/plain
Content-Description: r.mapcalc map.c patch
Content-Disposition: inline;
	filename="grass-map.c.diff"
Content-Transfer-Encoding: 7bit

--- src/raster/r.mapcalc3/map.c~	Thu Oct 10 20:12:24 2002
+++ src/raster/r.mapcalc3/map.c	Sun Nov 24 12:10:58 2002
@@ -222,6 +222,7 @@
 			}
 			for ( ; i < columns; i++)
 				SET_NULL_C(&ibuf[i]);
+			break;
 
 		case FCELL_TYPE:
 			for (i = 0; i < columns - col; i++)

--B8Auq6fQrJ--


Mon, Nov 25 2002 09:55:14    Mail sent by guest  
Right. That fixes the problem.


Thanks,
Hamish
Fri, Nov 29 2002 09:30:31    Status changed to resolved by mneteler  
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request