[GRASS-SVN] r51331 - grass-addons/grass6/raster/r.stream.extract

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Apr 9 15:09:11 EDT 2012


Author: mmetz
Date: 2012-04-09 12:09:11 -0700 (Mon, 09 Apr 2012)
New Revision: 51331

Modified:
   grass-addons/grass6/raster/r.stream.extract/load.c
Log:
r.stream.extract: add additional safety check

Modified: grass-addons/grass6/raster/r.stream.extract/load.c
===================================================================
--- grass-addons/grass6/raster/r.stream.extract/load.c	2012-04-09 19:04:56 UTC (rev 51330)
+++ grass-addons/grass6/raster/r.stream.extract/load.c	2012-04-09 19:09:11 UTC (rev 51331)
@@ -103,6 +103,11 @@
 
 	    /* check for masked and NULL cells */
 	    if (G_is_null_value(ptr, ele_map_type)) {
+		if (acc_fd >= 0) {
+		    if (!G_is_null_value(acc_ptr, acc_map_type))
+			G_fatal_error(_("Accumulation map does not match elevation map!"));
+		}
+
 		FLAG_SET(worked, r, c);
 		FLAG_SET(in_list, r, c);
 		G_set_c_null_value(loadp, 1);
@@ -125,8 +130,10 @@
 		if (acc_fd < 0)
 		    *accp = 1;
 		else {
-		    if (G_is_null_value(acc_ptr, acc_map_type))
+		    if (G_is_null_value(acc_ptr, acc_map_type)) {
+			/* can this be ok after weighing ? */
 			G_fatal_error(_("Accumulation map does not match elevation map!"));
+		    }
 
 		    switch (acc_map_type) {
 		    case CELL_TYPE:



More information about the grass-commit mailing list