[GRASS-SVN] r70805 - grass/branches/releasebranch_7_2/vector/v.to.rast

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 27 18:31:35 PDT 2017


Author: annakrat
Date: 2017-03-27 18:31:35 -0700 (Mon, 27 Mar 2017)
New Revision: 70805

Added:
   grass/branches/releasebranch_7_2/vector/v.to.rast/v_to_rast_direction.png
Modified:
   grass/branches/releasebranch_7_2/vector/v.to.rast/main.c
   grass/branches/releasebranch_7_2/vector/v.to.rast/v.to.rast.html
Log:
v.to.rast: fix description of option use=dir to not limit it to flow, add better example with picture to manual (merge from trunk, r70759)

Modified: grass/branches/releasebranch_7_2/vector/v.to.rast/main.c
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.to.rast/main.c	2017-03-27 20:10:45 UTC (rev 70804)
+++ grass/branches/releasebranch_7_2/vector/v.to.rast/main.c	2017-03-28 01:31:35 UTC (rev 70805)
@@ -78,7 +78,7 @@
 	       _("use category values"),
 	       _("use value specified by value option"),
 	       _("use z coordinate (points or contours only)"),
-	       _("output as flow direction (lines only)"));
+	       _("line direction in degrees CCW from east (lines only)"));
     use_opt->descriptions = desc;
 
     col = G_define_standard_option(G_OPT_DB_COLUMN);

Modified: grass/branches/releasebranch_7_2/vector/v.to.rast/v.to.rast.html
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.to.rast/v.to.rast.html	2017-03-27 20:10:45 UTC (rev 70804)
+++ grass/branches/releasebranch_7_2/vector/v.to.rast/v.to.rast.html	2017-03-28 01:31:35 UTC (rev 70805)
@@ -36,7 +36,7 @@
 <li>
 <em>z</em>    - use z coordinate (points or contours only)
 <li>
-<em>dir</em>  - output as flow direction in degrees (lines only)
+<em>dir</em>  - line direction in degrees counterclockwise from east (lines only)
 </ul>
 <p>The <em><b>column</b></em> parameter uses an existing column from the vector map
 database table as the category value in the output raster map. Existing table 
@@ -58,7 +58,7 @@
 Points and orphaned centroids will be converted into single cells on the
 resultant raster map.
 </ul>
-<p><p><b>Flow directions</b> are given in degrees counterclockwise from east.
+<p><p><b>Line directions</b> are given in degrees counterclockwise from east.
 <p><p>Raster category labels are supported for all of <em>use=</em> except <em>use=z</em>.
 <p>
 The <b>-d</b> flag applies only to lines and boundaries, the default is 
@@ -92,6 +92,25 @@
 v.to.rast input=streams output=streamsdir use=dir
 </pre></div>
 
+<h3>Calculate slope along path</h3>
+Using slope and aspect maps, compute slope along a bus route (use full NC sample dataset):
+<div class="code"><pre>
+g.region raster=elevation -p
+r.slope.aspect elevation=elevation slope=slope aspect=aspect
+
+# compute direction of the bus route
+v.to.rast input=busroute11 type=line output=busroute11_dir use=dir
+
+# extract steepest slope values and transform them into slope along path
+r.mapcalc "route_slope = if(busroute11, slope)"
+r.mapcalc "route_slope_dir = abs(atan(tan(slope) * cos(aspect - busroute11_dir)))"
+</pre></div>
+
+<center>
+<img src="v_to_rast_direction.png" alt="Slope along path" border=1><br>
+Slope in degrees along bus route
+</center>
+
 <h3>Convert a vector polygon map to raster including descriptive labels (Spearfish)</h3>
 
 <div class="code"><pre>

Copied: grass/branches/releasebranch_7_2/vector/v.to.rast/v_to_rast_direction.png (from rev 70759, grass/trunk/vector/v.to.rast/v_to_rast_direction.png)
===================================================================
(Binary files differ)



More information about the grass-commit mailing list