[GRASS-SVN] r52095 - grass/trunk/vector/v.net.distance
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 16 02:56:12 PDT 2012
Author: mmetz
Date: 2012-06-16 02:56:12 -0700 (Sat, 16 Jun 2012)
New Revision: 52095
Added:
grass/trunk/vector/v.net.distance/vnetdistance.png
Modified:
grass/trunk/vector/v.net.distance/main.c
grass/trunk/vector/v.net.distance/v.net.distance.html
Log:
v.net.distance: update documentation
Modified: grass/trunk/vector/v.net.distance/main.c
===================================================================
--- grass/trunk/vector/v.net.distance/main.c 2012-06-16 08:35:47 UTC (rev 52094)
+++ grass/trunk/vector/v.net.distance/main.c 2012-06-16 09:56:12 UTC (rev 52095)
@@ -4,11 +4,12 @@
* MODULE: v.net.distance
*
* AUTHOR(S): Daniel Bundala
+ * Markus Metz
*
* PURPOSE: Computes shortest distance via the network between
- * the given sets of features.
+ * two given sets of features.
*
- * COPYRIGHT: (C) 2009-2010 by Daniel Bundala, and the GRASS Development Team
+ * COPYRIGHT: (C) 2009-2010, 2012 by Daniel Bundala, and the GRASS Development Team
*
* This program is free software under the
* GNU General Public License (>=v2).
Modified: grass/trunk/vector/v.net.distance/v.net.distance.html
===================================================================
--- grass/trunk/vector/v.net.distance/v.net.distance.html 2012-06-16 08:35:47 UTC (rev 52094)
+++ grass/trunk/vector/v.net.distance/v.net.distance.html 2012-06-16 09:56:12 UTC (rev 52095)
@@ -1,13 +1,13 @@
<h2>DESCRIPTION</h2>
<em>v.net.distance</em> finds the nearast element in set <em>to</em>
-for every element in set <em>from</em>.
+for every point in set <em>from</em>.
<h2>NOTES</h2>
These two sets are given by the respective <b>layer</b>, <b>where</b>
and <b>cats</b> parameters. The type of <em>to</em> features is specified
-by <b>to_type</b> parameter and all <em>from</em> features are <em>points</em>.
+by <b>to_type</b> parameter. All <em>from</em> features are <em>points</em>.
A table is linked to <b>output</b> map containing various information
about the relation. More specifically, the table has three columns:
<em>cat</em>, <em>tcat</em> and <em>dist</em> storing category of each
@@ -19,18 +19,35 @@
Note that every line may contain more than one category value since a
single line may be on the shortest path for more than one <em>from</em>
feature. And so the shortest paths can be easily obtained by querying
-lines with corresponding category number.<br>
+lines with corresponding category number.
+<p>
The costs of arcs in forward and backward direction are specified by
<b>afcolumn</b> and <b>abcolumn</b> columns respectively. If
<b>abcolumn</b> is not given, the same cost is used in both directions.
<h2>EXAMPLES</h2>
Find shortest path and distance from every school to the nearest hospital
-and show path from school number one.
-<div class="code"><pre>
-v.net.distance input=city output=nearest from_where="type=school" to_where="type=hospital" afcolumn=SHAPE_LEN
-d.vect nearest cats=1
+and show all paths.
+
+<p>
+Streets are grey lines, schools are green circles, hospitals are red
+crosses, shortest paths are blue lines:
+<p><img src="vnetdistance.png" alt="v.net.distance example" border="1">
+
+<p><div class="code"><pre>
+# connect schools to streets as layer 2
+v.net input=streets_wake points=schools_wake output=streets_net1 operation=connect thresh=400 alayer=1 nlayer=2
+
+# connect hospitals to streets as layer 3
+v.net input=streets_net1 points=hospitals output=streets_net2 operation=connect thresh=400 alayer=1 nlayer=3
+
+# inspect the result
+v.category in=streets_net2 op=report
+
+# shortest paths from schools (points in layer 2) to nearest hospitals (points in layer 3)
+v.net.distance in=streets_net2 out=schools_to_hospitals flayer=2 tlayer=3
</pre></div>
+
<p>
<h2>SEE ALSO</h2>
@@ -44,6 +61,7 @@
<h2>AUTHORS</h2>
Daniel Bundala, Google Summer of Code 2009, Student<br>
-Wolf Bergenheim, Mentor
+Wolf Bergenheim, Mentor<br>
+Markus Metz
<p><i>Last changed: $Date$</i>
Added: grass/trunk/vector/v.net.distance/vnetdistance.png
===================================================================
(Binary files differ)
Property changes on: grass/trunk/vector/v.net.distance/vnetdistance.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
More information about the grass-commit
mailing list