[GRASS-SVN] r74111 - grass-addons/grass7/raster/r.viewshed.cva
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Feb 20 03:02:40 PST 2019
Author: neteler
Date: 2019-02-20 03:02:40 -0800 (Wed, 20 Feb 2019)
New Revision: 74111
Modified:
grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.html
grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py
Log:
r.viewshed.cva addon: fix null propagation of -e flag; manual: change map names to NC dataset
Modified: grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.html
===================================================================
--- grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.html 2019-02-20 09:21:02 UTC (rev 74110)
+++ grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.html 2019-02-20 11:02:40 UTC (rev 74111)
@@ -33,7 +33,6 @@
<h2>NOTES</h2>
-<!-- todo: mention r.geomorphon addon for summit extraction -->
The input vector points map can be manually digitized (with <em>
v.digit</em>) over topographic or cultural features, or can be
created as a series of random points (with <em>r.random</em> or <em>
@@ -42,26 +41,30 @@
viewshed maps will be named according to the cat number of the original
input points. This is also useful for simple creating a large number
of individual viewsheds from points in a vector file.
+<p>
+An automated summit extraction can be done with <b>r.geomorphon</b>.
<h2>EXAMPLES</h2>
+
Undertake a cumulative viewshed analysis from a digitized vector points
-map of prominent peaks in a region:<br>
+map of prominent peaks in a region (North Carolina sample dataset):<br>
<div class="code"><pre>
-g.region raster=elevation_10m_dem -p
+g.region raster=elevation -p
# use v.digit to digitize points or e.g. the r.geomorphon addon for summits
-r.viewshed.cva input=elevation10m_dem output=peaks_CVA_map \
+r.viewshed.cva input=elevation output=peaks_CVA_map \
vector=prominent_peaks_points name_column=cat \
observer_elevation=1.75 target_elevation=0
</pre></div>
-<br>Undertake a cumulative viewshed analysis from a 10% sample of landscape locations in a region:<br>
+<br>Undertake a cumulative viewshed analysis from a 10% sample of
+landscape locations in a region:<br>
<div class="code"><pre>
-g.region raster=elevation_10m_dem
-r.random input=elevation10m_dem n=10% vector_output=rand_points_10p
-r.viewshed.cva input=elevation10m_dem output=peaks_CVA_map \
+g.region raster=elevation -p
+r.random input=elevation n=10% vector=rand_points_10p
+r.viewshed.cva input=elevation output=peaks_CVA_map \
vector=rand_points_10p name_column=cat \
observer_elevation=1.75 target_elevation=0
</pre></div>
@@ -70,6 +73,7 @@
<h2>SEE ALSO</h2>
<em>
+<a href="r.geomorphon.html">r.geomorphon</a>,
<a href="r.viewshed.html">r.viewshed</a>
</em>
Modified: grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py
===================================================================
--- grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py 2019-02-20 09:21:02 UTC (rev 74110)
+++ grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py 2019-02-20 11:02:40 UTC (rev 74111)
@@ -167,11 +167,13 @@
grass.run_command("r.viewshed", quiet=True, overwrite=grass.overwrite(), flags=flagstring,
input=elev, output=tempry, coordinates=site[0] + "," + site[1], **viewshed_options)
# now make a mapcalc statement to add all the viewsheds together to make the outout cumulative viewsheds map
- grass.message(_("Calculating \"Cumulative Viewshed\" map"))
+ grass.message(_("Calculating cumulative viewshed map <%s>") % out)
# when binary viewshed, r.series has to use sum instead of count
rseries_method = 'sum' if 'b' in flagstring else 'count'
grass.run_command("r.series", quiet=True, overwrite=grass.overwrite(),
input=(",").join(vshed_list), output=out, method=rseries_method)
+ if flags['e']:
+ grass.run_command("r.null", quiet=True, map=out, setnull='0')
# Clean up temporary maps, if requested
if flags['k']:
grass.message(_("Temporary viewshed maps will not removed"))
More information about the grass-commit
mailing list