[GRASS5] r.average and FP maps

Glynn Clements glynn.clements at virgin.net
Sat Aug 14 18:04:05 EDT 2004


Markus Neteler wrote:

> > > > > I have tried to average elevations for selected zones
> > > > > with r.average but wasn't quite successful.
> [...]
> > > 
> > > That's fine. Time is not an issue if it worked... at time it is
> > > sort of broken.
> > 
> > In what sense? r.average seems to work OK for FP maps, apart from the
> > warning and the fact that the results will contain inaccuracies due to
> > averaging the quantised values rather than the actual values.
> 
> For me it doesn't work (Spearfish 5.7):
> 
> g.region rast=elevation.10m -p
> r.info -t elevation.10m
> datatype=DCELL
> 
> r.average -c base=fields cover=elevation.10m out=fields_elev_mean
> WARNING: r.stats: cats for elevation.10m sre either missing or have no
>          explicit labels. Using nsteps=255
> r.stats:  100%
> percent complete:  100%
> 
> GRASS 5.7.cvs:~ > r.info -r fields_elev_mean
> min=-2147483648
> max=-2147483648

When was the 5.3 code updated? The initial {get,put}_row.c update had
a couple of bugs which could result in all-null maps. If the 5.3 code
was updated on Thursday or Friday, try again with the latest version.

Here, the following works with the latest 5.3 and also with a slightly
older 5.7, with the original spearfish dataset:

	r.mapcalc 'elev.float = double(elevation.dem)'
	r.average base=fields cover=elev.float output=foo

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




More information about the grass-dev mailing list