[GRASS-dev] [GRASS GIS] #2020: r.volume gives wrong results on G7

GRASS GIS trac at osgeo.org
Tue Jul 2 08:04:55 PDT 2013


#2020: r.volume gives wrong results on G7
----------------------+-----------------------------------------------------
 Reporter:  madi      |       Owner:  grass-dev@…              
     Type:  defect    |      Status:  new                      
 Priority:  normal    |   Milestone:  7.0.0                    
Component:  Raster    |     Version:  svn-trunk                
 Keywords:  r.volume  |    Platform:  Linux                    
      Cpu:  x86-64    |  
----------------------+-----------------------------------------------------

Comment(by mmetz):

 Replying to [comment:3 hamish]:
 > The problem is with the handling NULL cells in the input map, or rather
 not handling them. It's this line in main.c:   `sum[i] += data_buf[col];`
 > Every now and then the value which is added is -2147483648 instead of in
 the range of ~ 0-36. That happens when the clump map exists but the input
 map does not. So for your test data the slope map is 1 cell smaller than
 the basins map around the edges of the area, and those cells which are
 non-NULL in the basins map but NULL in the slope map return corrupted
 values.

 > fwiw between devbr6 and trunk there don't seem to be any module changes
 beyond the conversion of G_() to Rast_() in the function names.

 > I notice even in grass7 it's still trying to make an old grass5
 sites_list points map, and also that the input map is always opened and
 read as a CELL map, even when it is floating point, so the results will
 be.. less correct than they might otherwise be due to
 rounding/quantization errors. For 0.0-1.0 normalized data that might be
 fatal. (conversion of the input to int(map*1000) with r.mapcalc gives the
 same error for NULLs in 'sum' though)

 NULL handling fixed and fp support added to r.volume in trunk r56984.

 Markus M

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2020#comment:4>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list