[GRASS-SVN] r43551 - grass/trunk/raster/r.surf.contour

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 21 02:54:54 EDT 2010


Author: mmetz
Date: 2010-09-21 06:54:54 +0000 (Tue, 21 Sep 2010)
New Revision: 43551

Modified:
   grass/trunk/raster/r.surf.contour/main.c
Log:
masking and clean-up

Modified: grass/trunk/raster/r.surf.contour/main.c
===================================================================
--- grass/trunk/raster/r.surf.contour/main.c	2010-09-21 05:34:03 UTC (rev 43550)
+++ grass/trunk/raster/r.surf.contour/main.c	2010-09-21 06:54:54 UTC (rev 43551)
@@ -85,7 +85,7 @@
 	for (r = 0; r < nrows; r++) {
 	    Rast_get_d_row_nomask(file_fd, alt_row, r);
 	    for (c = 0; c < ncols; c++)
-		if (Rast_is_d_null_value(&(alt_row[c])))
+		if (Rast_is_d_null_value(&(alt_row[c])) || alt_row[c] == 0)
 		    FLAG_SET(mask, r, c);
 	}
 	Rast_close(file_fd);
@@ -108,8 +108,8 @@
 	    }
 	    find_con(r, c, &d1, &d2, &con1, &con2);
 	    if (con2 > 0)
-		alt_row[c] = (DCELL) (d2 * con1 / (d1 + d2) +
-				     d1 * con2 / (d1 + d2) /* + 0.5 */);
+		alt_row[c] = d2 * con1 / (d1 + d2) + 
+		             d1 * con2 / (d1 + d2);
 	    else
 		alt_row[c] = con1;
 	}



More information about the grass-commit mailing list