[GRASS-user] How to find the second largest value in a series of rasters.

Marcello Gorini gorini at gmail.com
Fri Dec 9 19:02:09 EST 2011


Marcello:


> > My problem is that I also need to find the *second largest* value and the
> > corresponding raster number which contains the second largest value.
> >
> > I am doing that by iterating over all classes through a shell script,
> but it
> > obviously takes much more time than using a simple r.series command.
> >
> > Can anyone share any idea on how to accomplish that using r.series or
> > something similar?
>
>
Glynn:


> There isn't an efficient way to do this using existing tools. If you
> need the efficiency, I suggest adding a "second largest" aggregate to
> lib/stats (based upon c_max.c and c_maxx.c), and updating r.series to
> use it.
>
>
Thanks for pointing me the way. I think it is a little beyond my skills,
but I might give it a try.

Cheers,
Marcello.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20111209/fd4a868e/attachment.html


More information about the grass-user mailing list