[GRASS-SVN] r70759 - grass/trunk/vector/v.to.rast

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 15 20:03:42 PDT 2017


Author: annakrat
Date: 2017-03-15 20:03:42 -0700 (Wed, 15 Mar 2017)
New Revision: 70759

Added:
   grass/trunk/vector/v.to.rast/v_to_rast_direction.png
Modified:
   grass/trunk/vector/v.to.rast/main.c
   grass/trunk/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

Modified: grass/trunk/vector/v.to.rast/main.c
===================================================================
--- grass/trunk/vector/v.to.rast/main.c	2017-03-15 13:23:23 UTC (rev 70758)
+++ grass/trunk/vector/v.to.rast/main.c	2017-03-16 03:03:42 UTC (rev 70759)
@@ -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/trunk/vector/v.to.rast/v.to.rast.html
===================================================================
--- grass/trunk/vector/v.to.rast/v.to.rast.html	2017-03-15 13:23:23 UTC (rev 70758)
+++ grass/trunk/vector/v.to.rast/v.to.rast.html	2017-03-16 03:03:42 UTC (rev 70759)
@@ -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>

Added: grass/trunk/vector/v.to.rast/v_to_rast_direction.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/vector/v.to.rast/v_to_rast_direction.png
___________________________________________________________________
Added: svn:mime-type
   + image/png



More information about the grass-commit mailing list