浏览代码

Fix stats calculation with -a

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36855 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 16 年之前
父节点
当前提交
26193230cf
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      raster/r.colors/stats.c

+ 3 - 0
raster/r.colors/stats.c

@@ -91,8 +91,11 @@ void get_fp_stats(const char *name, const char *mapset,
     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;