[GRASS-SVN] r48176 - grass/branches/releasebranch_6_4/raster/r.water.outlet

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 7 02:59:41 EDT 2011


Author: neteler
Date: 2011-09-06 23:59:40 -0700 (Tue, 06 Sep 2011)
New Revision: 48176

Added:
   grass/branches/releasebranch_6_4/raster/r.water.outlet/r_water_outlet.png
Modified:
   grass/branches/releasebranch_6_4/raster/r.water.outlet/description.html
   grass/branches/releasebranch_6_4/raster/r.water.outlet/main.c
Log:
NULL support added; NC example added

Modified: grass/branches/releasebranch_6_4/raster/r.water.outlet/description.html
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.water.outlet/description.html	2011-09-07 00:33:20 UTC (rev 48175)
+++ grass/branches/releasebranch_6_4/raster/r.water.outlet/description.html	2011-09-07 06:59:40 UTC (rev 48176)
@@ -42,6 +42,33 @@
 will be a thin silver of land representing the overland
 slope uphill of the point.
 
+<h2>EXAMPLE</h2>
+
+A watershed in the North Carolina sample dataset region:
+
+<div class="code"><pre>
+g.region rast=elev_lid792_1m -p
+# the watershed outlet position should be placed on a stream (from
+# accumulation map):
+r.watershed elev_lid792_1m thresh=5000 accum=accum_5K \
+  drain=draindir_5K basin=basin_5K
+r.water.outlet drainage=draindir_5K basin=basin_A30 \
+  east=638741.43125 north=220269.7
+d.mon x0
+d.rast accum_5K
+d.rast -o basin_A30
+
+# overlay with transparency
+r.colors basin_A30 color=grey
+d.his h=accum_5K i=basin_A30
+</pre></div>
+
+<p>
+<center>
+<img src="r_water_outlet.png" border=0><BR>
+<i>Watershed draped over flow accumulation</i>
+</center>
+
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/branches/releasebranch_6_4/raster/r.water.outlet/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.water.outlet/main.c	2011-09-07 00:33:20 UTC (rev 48175)
+++ grass/branches/releasebranch_6_4/raster/r.water.outlet/main.c	2011-09-07 06:59:40 UTC (rev 48176)
@@ -148,6 +148,8 @@
     for (row = 0; row < nrows; row++) {
 	for (col = 0; col < ncols; col++) {
 	    cell_buf[col] = bas[SEG_INDEX(ba_seg, row, col)];
+	    if (cell_buf[col] == 0)
+		G_set_null_value(&cell_buf[col], 1, CELL_TYPE);
 	}
 	G_put_raster_row(basin_fd, cell_buf, CELL_TYPE);
     }

Added: grass/branches/releasebranch_6_4/raster/r.water.outlet/r_water_outlet.png
===================================================================
(Binary files differ)


Property changes on: grass/branches/releasebranch_6_4/raster/r.water.outlet/r_water_outlet.png
___________________________________________________________________
Added: svn:mime-type
   + image/png



More information about the grass-commit mailing list