[GRASSLIST:3328] Re: r.stats

Glynn Clements glynn.clements at virgin.net
Mon Mar 11 23:53:49 EST 2002


Gordon Keith wrote:

> > > Particular problems I am having:
> > > > r.statistics base=facies cover=gabo20_slope method=average
> > >
> > > out=avg_slope
> > > Sorry, <z> is not a valid flag
> >
> > this problem was fixed recently (2002-03-04), the
> > next (!) CVS snapshot
> > http://grass.itc.it/grass5/source/snapshot_release/
> > will contain the fix (or you get it from CVS directly).
> 
> I've got the snapshot and r.statistics now runs, but does not seem to 
> produce meaningful results for method=average,min,max or sum,

[snip]

> r.statistics method=mode,median,avedev,stddev,variance,skewness, or 
> kurtosis seem to give meaningful results for some data sets, but not 
> for others. So I'm not happy about trusting any results.
> 
> In particular where the raster is an aspect map generated by 
> r.slope.aspect the statistics for all classes seems to be identical.
> 
> Should I abandon r.statistics?

r.statistics doesn't work with floating-point maps at present. If you
convert the map to integer[1], you should get meaningful results.

[1] e.g. with "r.mapcalc 'out=int(in * 1000)'"

Ultimately, r.statistics needs a re-think with regard to handling
floating-point data.

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



More information about the grass-user mailing list