[GRASS-SVN] r67115 - grass/branches/releasebranch_7_0/vector/v.net.distance

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 14 03:09:28 PST 2015


Author: hellik
Date: 2015-12-14 03:09:28 -0800 (Mon, 14 Dec 2015)
New Revision: 67115

Modified:
   grass/branches/releasebranch_7_0/vector/v.net.distance/v.net.distance.html
Log:
v.net.distance: add example with streams and points (NC sample data set) - (merge from trunk: r67114)

Modified: grass/branches/releasebranch_7_0/vector/v.net.distance/v.net.distance.html
===================================================================
--- grass/branches/releasebranch_7_0/vector/v.net.distance/v.net.distance.html	2015-12-14 11:05:19 UTC (rev 67114)
+++ grass/branches/releasebranch_7_0/vector/v.net.distance/v.net.distance.html	2015-12-14 11:09:28 UTC (rev 67115)
@@ -38,6 +38,9 @@
 lowest non-zero distance for each node.
 
 <h2>EXAMPLES</h2>
+
+<h3>Shortest path and distance between school and nearest hospital</h3>
+
 Find shortest path and distance from every school to the nearest hospital 
 and show all paths.
 
@@ -60,6 +63,79 @@
 v.net.distance in=streets_net2 out=schools_to_hospitals flayer=2 tlayer=3
 </pre></div>
 
+<h3>Distance between point source of pollution and sample points along streams</h3>
+
+Example with streams of the NC sample data set.
+
+<p><div class="code"><pre>
+# add coordinates of pollution point source of pollution as vector
+pollution.txt:
+634731.563206905|216390.501834892
+
+v.in.ascii input=C:\data\pollution.txt output=pollution
+
+# add table to vector
+v.db.addtable map=pollution
+
+# add coordinates of sample points as vector
+samples.txt:
+634813.332814905|216333.590706166
+634893.462007813|216273.763350851
+634918.660011082|216254.949609689
+
+v.in.ascii input=C:\data\samples.txt output=samples
+
+# add table to vector
+v.db.addtable map=samples
+
+# connect samples and pollution to streams
+v.net -c input=streams points=samples output=streams_samples operation=connect node_layer=3 threshold=10
+v.net -c input=streams_samples points=pollution output=streams_samples_pollution operation=connect node_layer=4 threshold=10
+
+# check vector layers
+v.category input=streams_samples_pollution option=report               
+Layer/table: 1/streams_samples_pollution
+type       count        min        max
+point          0          0          0
+line        8562      40102     101351
+boundary       0          0          0
+centroid       0          0          0
+area           0          0          0
+face           0          0          0
+kernel         0          0          0
+all         8562      40102     101351
+Layer: 3
+type       count        min        max
+point          3          1          3
+line           0          0          0
+boundary       0          0          0
+centroid       0          0          0
+area           0          0          0
+face           0          0          0
+kernel         0          0          0
+all            3          1          3
+Layer: 4
+type       count        min        max
+point          1          1          1
+line           0          0          0
+boundary       0          0          0
+centroid       0          0          0
+area           0          0          0
+face           0          0          0
+kernel         0          0          0
+all            1          1          1
+
+# calculate distance between sample points and pollution point source
+v.net.distance input=streams_samples_pollution output=distance_samples_to_pollution from_layer=3 to_layer=4
+
+# check results
+v.report map=distance_samples_to_pollution at vnettest option=length               
+cat|tcat|dist|length
+1|1|100.0|100.0
+2|1|200.0|200.0
+3|1|231.446|231.446
+</pre></div>
+
 <p>
 <h2>SEE ALSO</h2>
 



More information about the grass-commit mailing list