Details Ticket 912


Comment | Reply | Take | Open


Serial Number 912
Subject probably r.mapcalc bug
Area bug
Queue grass
Requestors neteler@itc.it
Owner none
Status resolved
Last User Contact Never contacted
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Wed Jun 5 16:06:00 2002 (6 yr ago)
Created Fri Feb 8 13:47:22 2002 (7 yr ago)

Transaction History Ticket 912


Fri, Feb 8 2002 13:47:22    Request created by guest  
Subject: probably r.mapcalc bug

grass downloaded at: CVS Server, Germany
grass sources source: yes, I am using the latest GRASS from CVS

Hi,

eventually we have found a bug in r.mapcalc. At least it is somewhat
inconvenient...

GRASS 5.0.0pre3 > r.mapcalc 'tmp5=if(pascolo.albmug.00 >0,1,0)'
EXECUTING tmp5 = ...  100%
CREATING SUPPORT FILES FOR tmp5

 -> no result

GRASS 5.0.0pre3 > r.mapcalc 'tmp5=if(pascolo.albmug.00 >0.,1,0)'
EXECUTING tmp5 = ...  100%
CREATING SUPPORT FILES FOR tmp5

 -> no result


GRASS 5.0.0pre3 > r.mapcalc 'tmp5=if(pascolo.albmug.00 >1,1,0)'
EXECUTING tmp5 = ...  100%
CREATING SUPPORT FILES FOR tmp5
range: 1 1
 
 -> result

The map contains:

r.info pascolo.albmug.00 
 |   Type of Map:  raster              Number of Categories: 255  
 |   Data Type:    FCELL       
 |   Range of data:    min =  0.000000 max = 150.000000 
 |   Data Description:                                                      
|
 |    generated by r.recode                                                 
r.stats -c pascolo.albmug.00
r.stats:  100%
0-0.588235 32065
0.588235-1.176471 3208
1.176471-1.764706 1266
[...]
94.117647-94.705882 207
99.411765-100 374
149.411765-150 157
* 1044154

Actually I don't understand the behaviour of r.mapcalc in the first case.

Generally, it seems that,
 - there is something strange with if-conditions (see above)
 - r.mapcalc *silently* does not operate on NULL values (there should be 
   a warning)
 - does not print a message about the file type (INT,FCELL) when doing
   a calculation (e.g. when dividing two INT maps, the result is INT.
   but many users may not realize this and don't know that they have to
   multiply with 1.0 to receive a FCELL)

Regards

 Markus
Tue, Mar 26 2002 10:33:18    Comments added by mneteler  
The INT/INT behaviour has been changed by Glynn: Now a warning is generated.
Markus
Wed, Jun 5 2002 16:06:00    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