[GRASS5] raster category confusion

Markus Neteler neteler at itc.it
Thu Sep 1 03:53:16 EDT 2005


On Wed, Aug 31, 2005 at 09:05:02PM +0100, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > > > > Do you have some other mapset in the search path ahead of the current
> > > > > mapset?
> > > > 
> > > > GRASS 6.1.cvs (spearfish60):/hardmnt/thuille0/ssi/grassdata/spearfish60 > g.mapsets -p
> > > > neteler PERMANENT user1
> > > > 
> > > > It seems that there is only this single map gives wrong results.
> > > > It's a 32bit RHEL4 box.
> > > 
> > > The only thing I can suggest is using a debugger.
> > 
> > To recall, the problem:
> > 
> > r.mapcalc "one=1"
> 
> 
> > r.cats one
> > Reading one in neteler ... 100%
> > 99
> > 100
> > 120
> > 156
> 
> Forget about r.cats (and categories in general). This:
> 
> > r.stats -1 one
> > 120
> > 156
> > 99
> > 100
> > 120
> > 156
> > 99
> > 100
> 
> is a lot more interesting (and relevant).

OK:

in r.stats:

main.c 
 G_get_range_min_max (&range, &min, &max);
 min =1
 max =1

ok so far.
raw_stats (fd, verbose, with_coordinates, with_xy, with_labels);
           fd     0           0               0          0

Entering raw_stats():
raw_stats.c:49
 rastp[i] = rast[i];
 i=0
 rastp[0]= void

 raw_stats.c:98, when i is 0, then
*((CELL *) rastp[i]) is 120.

Then it prints 120 and so forth.

Should I add some G_debug() in raw_stats?

Markus




More information about the grass-dev mailing list