[GRASS-SVN] r36856 - grass/branches/develbranch_6/raster/r.colors

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 22 02:03:09 EDT 2009


Author: hamish
Date: 2009-04-22 02:03:09 -0400 (Wed, 22 Apr 2009)
New Revision: 36856

Modified:
   grass/branches/develbranch_6/raster/r.colors/stats.c
Log:
backport bugfix r36855 from trunk. Glynn:"Fix stats calculation with -a"

Modified: grass/branches/develbranch_6/raster/r.colors/stats.c
===================================================================
--- grass/branches/develbranch_6/raster/r.colors/stats.c	2009-04-22 04:37:49 UTC (rev 36855)
+++ grass/branches/develbranch_6/raster/r.colors/stats.c	2009-04-22 06:03:09 UTC (rev 36856)
@@ -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