[GRASS-SVN] r52746 - grass/trunk/raster/r.cost

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 20 00:51:44 PDT 2012


Author: mmetz
Date: 2012-08-20 00:51:43 -0700 (Mon, 20 Aug 2012)
New Revision: 52746

Modified:
   grass/trunk/raster/r.cost/main.c
Log:
r.cost fix for #545

Modified: grass/trunk/raster/r.cost/main.c
===================================================================
--- grass/trunk/raster/r.cost/main.c	2012-08-20 07:29:08 UTC (rev 52745)
+++ grass/trunk/raster/r.cost/main.c	2012-08-20 07:51:43 UTC (rev 52746)
@@ -474,6 +474,12 @@
 			break;
 		    }
 		}
+		if (p < 0) {
+		    G_warning(_("Negative cell value found at row %d, col %d. "
+				"Setting negative value to null_cost value"),
+			      row, i);
+		    p = null_cost;
+		}
 		costs.cost_in = p;
 		segment_put(&cost_seg, &costs, row, i);
 		ptr2 = G_incr_void_ptr(ptr2, dsize);
@@ -632,7 +638,7 @@
 	Vect_close(&In);
 
 	if (!have_stop_points)
-	    G_warning(_("No stop points found in vector <%s>"), opt7->answer);
+	    G_warning(_("No stop points found in vector <%s>"), opt8->answer);
     }
 
     /* read raster with start points */



More information about the grass-commit mailing list