[GRASS-SVN] r39993 - grass/trunk/raster/r.watershed/ram

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 14 04:51:27 EST 2009


Author: mmetz
Date: 2009-12-14 04:51:25 -0500 (Mon, 14 Dec 2009)
New Revision: 39993

Modified:
   grass/trunk/raster/r.watershed/ram/close_maps.c
   grass/trunk/raster/r.watershed/ram/do_astar.c
   grass/trunk/raster/r.watershed/ram/do_cum.c
Log:
small fix, cosmetics

Modified: grass/trunk/raster/r.watershed/ram/close_maps.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/close_maps.c	2009-12-14 06:36:29 UTC (rev 39992)
+++ grass/trunk/raster/r.watershed/ram/close_maps.c	2009-12-14 09:51:25 UTC (rev 39993)
@@ -82,7 +82,7 @@
 
 	    if (min < 0) {
 		if (min < (-stddev - 1)) {
-		    clr_min = min;
+		    clr_min = min - 1;
 		    clr_max = -stddev - 1;
 		    Rast_add_d_color_rule(&clr_min, 0, 0, 0, &clr_max, 0,
 					      0, 0, &colors);
@@ -127,7 +127,7 @@
 
 	    if (max > 0 && max > stddev + 1) {
 		clr_min = stddev + 1;
-		clr_max = max;
+		clr_max = max + 1;
 		Rast_add_d_color_rule(&clr_min, 0, 0, 0, &clr_max, 0, 0,
 					  0, &colors);
 	    }

Modified: grass/trunk/raster/r.watershed/ram/do_astar.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/do_astar.c	2009-12-14 06:36:29 UTC (rev 39992)
+++ grass/trunk/raster/r.watershed/ram/do_astar.c	2009-12-14 09:51:25 UTC (rev 39993)
@@ -110,7 +110,7 @@
 		    /* set flow direction */
 		    asp[index_up] = drain[upr - r + 1][upc - c + 1];
 		}
-		else if (is_in_list == 1 && is_worked == 0) {
+		else if (is_in_list && is_worked == 0) {
 		    /* neighbour is edge in list, not yet worked */
 		    if (asp[index_up] < 0) {
 			asp[index_up] = drain[upr - r + 1][upc - c + 1];

Modified: grass/trunk/raster/r.watershed/ram/do_cum.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/do_cum.c	2009-12-14 06:36:29 UTC (rev 39992)
+++ grass/trunk/raster/r.watershed/ram/do_cum.c	2009-12-14 09:51:25 UTC (rev 39993)
@@ -29,6 +29,7 @@
 	    dr = r + asp_r[ABS(aspect)];
 	    dc = c + asp_c[ABS(aspect)];
 	}
+	/* skip user-defined depressions */
 	else
 	    dr = dc = -1;
 	if (dr >= 0 && dr < nrows && dc >= 0 && dc < ncols) { /* if ((dr = astar_pts[killer].downr) > -1) { */
@@ -343,7 +344,7 @@
 	    }
 	    /* start new stream */
 	    value = ABS(value) + 0.5;
-	    if (!is_swale && (int)value >= threshold && stream_cells < 1 &&
+	    if (!is_swale && (int)value >= threshold && stream_cells < 3 &&
 		swale_cells < 1) {
 		FLAG_SET(swale, r, c);
 		is_swale = 1;



More information about the grass-commit mailing list