[GRASS-user] extended statistics for v.rast.stats

Maciej Sieczka tutey at o2.pl
Wed Oct 10 03:25:56 EDT 2007


Hamish wrote:
> Hi,
> 
> I just added extended statistics support to v.rast.stats in 6.3cvs.
> This follows the 'r.univar -e' extended statistics mode and gives 1st
> quartile, median, 3rd quartile, and given percentile (default is 90th).
> 
> Beware if the region is too big 'r.univar -e' can fail with a memory
> error as it loads the entire map into memory. I don't see a nice way
> to test for that in the v.rast.stats script so the script will attempt to
> continue after such a failure, with unknown results. Solutions welcome.

Hi

To prevent an error-snowball effect I set the following in
the beginning of the script:

#exit if an uninitialised variable is used:
set -u
#exit if any statement returns a non-true value:
set -e

There's also a very usefull "set -o pipefail" (change
pipeline exit status to be that of the last command in the
pipe to fail, or 0 if all commands in pipeline complete
successfully), but it might be a bashism AFAICT (at least
dash does not support it).

Maciek




More information about the grass-user mailing list