[GRASS-user] How to find the second largest value in a series of
sylvain.maillard at gmail.com
Fri Dec 9 20:06:07 EST 2011
what about computing the first largest value, making your categorical map,
and using it as a mask ?
if you mask all cell containing the first largest value, then the second
largest value will become the first largest value of the masked raster
my 2 ct
2011/12/10 Marcello Gorini <gorini at gmail.com>
>> > My problem is that I also need to find the *second largest* value and
>> > 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?
>> 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.
> grass-user mailing list
> grass-user at lists.osgeo.org
-------------- section suivante --------------
Une pi?ce jointe HTML a ?t? enlev?e...
More information about the grass-user