[GRASS-SVN] r36857 -
grass/branches/releasebranch_6_4/raster/r.colors
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Apr 22 02:04:13 EDT 2009
Author: hamish
Date: 2009-04-22 02:04:13 -0400 (Wed, 22 Apr 2009)
New Revision: 36857
Modified:
grass/branches/releasebranch_6_4/raster/r.colors/stats.c
Log:
backport bugfix r36855 from trunk. Glynn:"Fix stats calculation with -a"
Modified: grass/branches/releasebranch_6_4/raster/r.colors/stats.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.colors/stats.c 2009-04-22 06:03:09 UTC (rev 36856)
+++ grass/branches/releasebranch_6_4/raster/r.colors/stats.c 2009-04-22 06:04:13 UTC (rev 36857)
@@ -91,8 +91,11 @@
if (statf->geom_abs) {
double a = log(fabs(min) + 1);
double b = log(fabs(max) + 1);
+ int has_zero = min * max < 0;
min = a < b ? a : b;
max = a > b ? a : b;
+ if (has_zero)
+ min = 0;
}
statf->count = 1000;
More information about the grass-commit
mailing list