Просмотр исходного кода

v.to.rast: fix description of option use=dir to not limit it to flow, add better example with picture to manual

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@70759 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 7 лет назад
Родитель
Сommit
c2d9758bdf

+ 1 - 1
vector/v.to.rast/main.c

@@ -78,7 +78,7 @@ int main(int argc, char *argv[])
 	       _("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);

+ 21 - 2
vector/v.to.rast/v.to.rast.html

@@ -36,7 +36,7 @@ specified alone when using the <em>dir</em> option.
 <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 @@ original vector line. This tends to be more aggressive than area-only conversion
 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=vect_map output=raster_map attribute_column=SPEED type=line
 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>

BIN
vector/v.to.rast/v_to_rast_direction.png