[GRASS-SVN] r57064 - grass/trunk/raster/r.neighbors

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 11 04:30:42 PDT 2013


Author: glynn
Date: 2013-07-11 04:30:42 -0700 (Thu, 11 Jul 2013)
New Revision: 57064

Modified:
   grass/trunk/raster/r.neighbors/main.c
Log:
Don't add 0.5 to floating-point output maps


Modified: grass/trunk/raster/r.neighbors/main.c
===================================================================
--- grass/trunk/raster/r.neighbors/main.c	2013-07-10 14:14:16 UTC (rev 57063)
+++ grass/trunk/raster/r.neighbors/main.c	2013-07-11 11:30:42 UTC (rev 57064)
@@ -36,7 +36,7 @@
     stat_func_w *method_w;	/* routine to compute new value (weighted) */
     ifunc cat_names;		/* routine to make category names */
     int copycolr;		/* flag if color table can be copied */
-    int half;			/* whether to add 0.5 to result */
+    int half;			/* whether to add 0.5 to result (redundant) */
     char *name;			/* method name */
     char *text;			/* menu display - full description */
 };
@@ -77,7 +77,6 @@
     stat_func *method_fn;
     stat_func_w *method_fn_w;
     int copycolr;
-    int half;
     ifunc cat_names;
     int map_type;
     double quantile;
@@ -314,7 +313,6 @@
 	    out->method_fn = menu[method].method;
 	    out->method_fn_w = NULL;
 	}
-	out->half = menu[method].half;
 	out->copycolr = menu[method].copycolr;
 	out->cat_names = menu[method].cat_names;
 	if (out->copycolr)
@@ -411,9 +409,6 @@
 			memcpy(values_tmp, values, n * sizeof(DCELL));
 			(*out->method_fn)(rp, values_tmp, n, &out->quantile);
 		    }
-
-		    if (out->half && !Rast_is_d_null_value(rp))
-			*rp += 0.5;
 		}
 	    }
 	}



More information about the grass-commit mailing list