[GRASS-dev] [grass-code R][409] diversity func. in r.statistics

Martin Wegmann wegmann at biozentrum.uni-wuerzburg.de
Wed May 30 03:50:50 EDT 2007


On Monday 25 June 2007 15:17:38 Martin Wegmann wrote:
> On Thursday 24 May 2007 22:49:49 Glynn Clements wrote:
> > grass-coder at wald.intevation.org wrote:
> > > code R item #409, was opened at 2007-05-24 16:41
> > > Status: Open
> > > Priority: 3
> > > Submitted By: Martin Wegmann (wegmann)
> > > Assigned to: Nobody (None)
> > > Summary: diversity func. in r.statistics
> > > Issue status: None
> > > GRASS component: raster
> > > Operating system: Linux
> > > Operating system version: debian
> > >
> > >
> > > Initial Comment:
> > > hello,
> > >
> > > it would be very handy to have the c_divr.c Funktion (Diversity of
> > > values) in r.statistics.
> > >
> > > I already tried it with my very limited C skills but failed because
> > > r.statistics is not like r.series pointing to lib/stats, which would
> > > have maked it easier for me.
> >
> > Try the attached file (untested).
>
> thanks - I implemented it and it works so far - but the ouput looks quite
> strange at the moment.

sorry, I was confused by more than one output value; the commands results in 
cat of base + diversity in the new raster - I checked it again with a 
different set of spearfish raster where I could count the cover cats by hand. 
The module works fine - thanks Glynn!

> (spearfish)
> r.mapcalc "cover = int(fields)"
> r.statistics base=landuse cover=cover method=diversity output=test --o
>
> shall I commit it to cvs, when it works or already now that you can test
> it?

Shall I commit it to cvs? 

Martin




More information about the grass-dev mailing list