[GRASS-SVN] r35493 - in grass/trunk/raster/r.watershed: front ram seg

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jan 20 05:50:15 EST 2009


Author: mmetz
Date: 2009-01-20 05:50:15 -0500 (Tue, 20 Jan 2009)
New Revision: 35493

Modified:
   grass/trunk/raster/r.watershed/front/main.c
   grass/trunk/raster/r.watershed/front/r.watershed.html
   grass/trunk/raster/r.watershed/ram/init_vars.c
   grass/trunk/raster/r.watershed/seg/init_vars.c
Log:
Input maps depression and blocking terrain: use non-NULL and non-zero cells, previously prepared maps should work as before. Updated documentation.

Modified: grass/trunk/raster/r.watershed/front/main.c
===================================================================
--- grass/trunk/raster/r.watershed/front/main.c	2009-01-20 07:54:16 UTC (rev 35492)
+++ grass/trunk/raster/r.watershed/front/main.c	2009-01-20 10:50:15 UTC (rev 35493)
@@ -63,7 +63,7 @@
     opt2 = G_define_option();
     opt2->key = "depression";
     opt2->label = _("Input map: locations of real depressions");
-    opt2->description = _("All non-NULL cells are considered as real depressions");
+    opt2->description = _("All non-NULL and non-zero cells are considered as real depressions");
     opt2->required = NO;
     opt2->type = TYPE_STRING;
     opt2->gisprompt = "old,cell,raster";
@@ -91,7 +91,7 @@
     opt5->label =
 	_("Input map: terrain blocking overland surface flow, for USLE");
     opt5->description =
-	_("All non-NULL cells are considered as blocking terrain");
+	_("All non-NULL and non-zero cells are considered as blocking terrain");
     opt5->required = NO;
     opt5->type = TYPE_STRING;
     opt5->gisprompt = "old,cell,raster";

Modified: grass/trunk/raster/r.watershed/front/r.watershed.html
===================================================================
--- grass/trunk/raster/r.watershed/front/r.watershed.html	2009-01-20 07:54:16 UTC (rev 35492)
+++ grass/trunk/raster/r.watershed/front/r.watershed.html	2009-01-20 10:50:15 UTC (rev 35493)
@@ -53,14 +53,18 @@
 
 <dt><em>elevation</em> 
 
-<dd>Input map: Elevation on which entire analysis is based.
+<dd>Input map: Elevation on which entire analysis is based. NULL (nodata) 
+cells are ignored, zero and negative values are valid elevation data. 
+Gaps in the elevation map that are located within the area of interest 
+must be filled beforehand, e.g. with <em>r.fillnulls</em>, to avoid 
+distortions.
 
 <dt><em>depression</em> 
 
 <dd>Input map:  Map layer of actual depressions or sinkholes in the
 landscape that are large enough to slow and store surface runoff from 
-a storm event.  Any non-NULL (not nodata) values indicate depressions. 
-Water will flow into depressions, but not out of depressions.
+a storm event.  All cells that are not NULL and not zero indicate 
+depressions. Water will flow into but not out of depressions.
 
 <dt><em>flow</em> 
 
@@ -81,7 +85,8 @@
 
 <dd>Input map: terrain that will block overland surface flow.  Terrain
 that will block overland surface flow and restart the slope length
-for the RUSLE.  Any non-NULL (not nodata) values indicate blocking terrain.
+for the RUSLE.  All cells that are not NULL and not zero indicate blocking 
+terrain.
 
 <dt><em>threshold</em> 
 
@@ -166,7 +171,7 @@
 <dd>Output map: slope steepness (S) factor for the Universal Soil
 Loss Equation (RUSLE).  Equations taken from article entitled
 <em>Revised Slope Steepness Factor for the Universal Soil
-Loss Equation</em> (McCool et al. 1987).  Since the LS factor is a small 
+Loss Equation</em> (McCool et al. 1987).  Since the S factor is a small 
 number (usually less than one), the GRASS output map is of type DCELL.
 </dd>
 </dl>
@@ -290,9 +295,13 @@
 to run the program.  Masking out unimportant areas can significantly 
 reduce processing time if the watersheds of interest occupy a small 
 percentage of the overall area.
-
 <p>
-Zero (0) and negative data values will be treated as elevation data (not no_data).
+Gaps (NULL cells) in the elevation map that are located within the area 
+of interest will heavily influence flow accumulation: water will 
+flow into but not out of these gaps. These gaps must be filled beforehand, 
+e.g. with <em>r.fillnulls</em>.
+<p>
+Zero (0) and negative values will be treated as elevation data (not no_data).
 
 <h4>Further processing of output layers</h4>
 <p>
@@ -460,8 +469,10 @@
 <a href="g.region.html">g.region</a>,
 <a href="r.cost.html">r.cost</a>,
 <a href="r.drain.html">r.drain</a>,
+<a href="r.fillnulls.html">r.fillnulls</a>,
 <a href="r.flow.html">r.flow</a>,
 <!-- <a href="r.flowmd.html">r.flowmd</a>, -->
+<a href="r.mask.html">r.mask</a>,
 <a href="r.neighbors.html">r.neighbors</a>,
 <a href="r.param.scale.html">r.param.scale</a>,
 <a href="r.resamp.interp.html">r.resamp.interp</a>,

Modified: grass/trunk/raster/r.watershed/ram/init_vars.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/init_vars.c	2009-01-20 07:54:16 UTC (rev 35492)
+++ grass/trunk/raster/r.watershed/ram/init_vars.c	2009-01-20 10:50:15 UTC (rev 35493)
@@ -211,7 +211,7 @@
 	    G_get_c_raster_row(fd, buf, r);
 	    for (c = 0; c < ncols; c++) {
 		asp_value = buf[c];
-		if (!G_is_c_null_value(&asp_value))
+		if (!G_is_c_null_value(&asp_value) && asp_value)
 		    asp[SEG_INDEX(asp_seg, r, c)] = 1;
 	    }
 	}
@@ -228,7 +228,7 @@
 	    G_get_c_raster_row(fd, buf, r);
 	    for (c = 0; c < ncols; c++) {
 		block_value = buf[c];
-		if (!G_is_c_null_value(&block_value))
+		if (!G_is_c_null_value(&block_value) && block_value)
 		    FLAG_SET(swale, r, c);
 	    }
 	}

Modified: grass/trunk/raster/r.watershed/seg/init_vars.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/init_vars.c	2009-01-20 07:54:16 UTC (rev 35492)
+++ grass/trunk/raster/r.watershed/seg/init_vars.c	2009-01-20 10:50:15 UTC (rev 35493)
@@ -241,7 +241,7 @@
 	    G_get_c_raster_row(fd, buf, r);
 	    for (c = 0; c < ncols; c++) {
 		asp_value = buf[c];
-		if (!G_is_c_null_value(&asp_value)) {
+		if (!G_is_c_null_value(&asp_value) && asp_value) {
 		    cseg_put(&asp, &one, r, c);
 		}
 		else {
@@ -270,7 +270,7 @@
 	    G_get_c_raster_row(fd, buf, r);
 	    for (c = 0; c < ncols; c++) {
 		block_value = buf[c];
-		if (!G_is_c_null_value(&block_value)) {
+		if (!G_is_c_null_value(&block_value) && block_value) {
 		    bseg_put(&swale, &one, r, c);
 		}
 		else {



More information about the grass-commit mailing list