~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to vector/v.net.visibility/v.net.visibility.html

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h2>DESCRIPTION</h2>
 
2
 
 
3
<em>v.net.visibility</em> computes the visibility graph of a vector
 
4
map containing lines, areas (boundaries) and points. The visibility
 
5
graph is the graph where the nodes are the end point of the lines,
 
6
boundaries or simply points. There is an edge between two nodes if they
 
7
are 'visible' to each other. Two nodes are visibible if there are no segments
 
8
in between of them, i.e. the edge does not intersect any line or boundary
 
9
in the vector map. This is useful to compute the shortest path in a
 
10
vector map from any two points. To do this, first you need to compute
 
11
the visibility graph and from that to compute the shortest path using
 
12
<em><a href="v.net.path.html">v.net.path</a></em>
 
13
or <em><a href="d.path.html">d.path</a></em>.
 
14
 
 
15
<p>
 
16
<b>IMPORTANT: the algorithm doesn't work well with intersecting lines
 
17
(that includes overlapping)</b>
 
18
 
 
19
<h2>NOTES</h2>
 
20
 
 
21
If you compute a shortest path after computing the visibility graph
 
22
you will notice that this path might go through a vertex of a line. If
 
23
this is not what you wanted you might need to process the map
 
24
in <em><a href="v.buffer.html">v.buffer</a></em>, initially whith a
 
25
small value. Example:
 
26
 
 
27
<div class="code"><pre>
 
28
v.buffer input=map output=bufferedmap buffer=1 type=point,line,area,boundary
 
29
</pre></div>
 
30
 
 
31
<p>
 
32
The first argument is the input map. It supports lines, boundaries 
 
33
(so, areas) and points. For the algorithm  was written to work with lines
 
34
and boundaries not intersecting each other (that includes overlapping).
 
35
<br>
 
36
The resulting map containing the visibility graph is given in the output map.
 
37
<p>
 
38
If you need to add additional points to compute a shortest path 
 
39
between them afterwards you can use the <b>coordinates</b> parameter, e.g.:
 
40
<div class="code"><pre>
 
41
coordinates=25556200,6686400,25556400,6686600
 
42
</pre></div>
 
43
where 25556200,6686400 are the coordinate of the first point and 
 
44
25556400,6686600 are the coordinates of the second point. Of course 
 
45
you can give as many points as you need. They will be added to the 
 
46
visibility graph and edges from them will be computed. You can 
 
47
always add those points after computing the visibility graph. Simply 
 
48
use the <b>visibility</b> parameter. The input will be the original 
 
49
vector map, the vis will be the computed visibility graph and the 
 
50
output the new visibility graph which will be the vis + the new 
 
51
points given with coordinate (edges will be computed as well).
 
52
<div class="code"><pre>
 
53
v.net.visibility input=map visibility=vis_map output=new_vis_map \
 
54
      coordinates=25556200,6686400,25556400,6686600
 
55
</pre></div>
 
56
 
 
57
<h2>EXAMPLES</h2>
 
58
 
 
59
<h3>Example 1</h3>
 
60
 
 
61
<!-- still overly complex result, some simple geometric were better -->
 
62
A simple example (North Carolina sample data) showing how to use the module:
 
63
<div class="code"><pre>
 
64
v.extract input=zipcodes_wake output=areas_7_11_25 cats=7,11,25
 
65
g.region vector=zipcodes_wake
 
66
d.mon wx0
 
67
d.vect areas_7_11_25
 
68
v.net.visibility input=areas_7_11_25 output=graph
 
69
d.vect graph
 
70
d.vect areas_7_11_25 color=red type=boundary
 
71
</pre></div>
 
72
 
 
73
<h3>Example 2</h3>d.er  
 
74
An example on how to use <em><a href="v.buffer.html">v.buffer</a></em>
 
75
along with the module:
 
76
<div class="code"><pre>
 
77
v.buffer input=lines output=buffered_lines buffer=1
 
78
v.net.visibility input=buffered_lines output=graph
 
79
d.vect graph
 
80
d.vect lines col=red
 
81
</pre></div>
 
82
 
 
83
 
 
84
<h3>Example 3</h3>
 
85
An example on how to use the coordinate parameter. This will compute the
 
86
visibility graph of the vector map lines with the point 2555678,6686343:
 
87
<div class="code"><pre>
 
88
v.net.visibility input=lines output=graph coordinates=2555678,6686343
 
89
d.vect graph
 
90
d.vect lines col=red
 
91
</pre></div>
 
92
 
 
93
<h3>Example 4</h3>
 
94
<!-- does not quite ork yet? -->
 
95
An example (North Carolina sample data) on how to use the coordinate
 
96
parameter with the vis parameter.
 
97
Here the vector map graph is computed then a new visibility graph is computed
 
98
from it with the point 669547.97,208348.20 extra:
 
99
<div class="code"><pre>
 
100
v.extract input=zipcodes_wake output=areas_7_11_25 cats=7,11,25
 
101
g.region vector=zipcodes_wake
 
102
d.mon wx0
 
103
d.vect areas_7_11_25
 
104
v.net.visibility input=zipcodes_wake output=graph
 
105
v.net.visibility input=zipcodes_wake visibility=graph output=new_graph \
 
106
      coordinates=669547.97,208348.20
 
107
d.erase
 
108
d.vect areas_7_11_25
 
109
echo "symbol basic/star 20 669547.97 208348.20 black red" | d.graph -m
 
110
d.vect new_graph
 
111
d.vect areas_7_11_25 color=red type=boundary
 
112
</pre></div>
 
113
 
 
114
 
 
115
<h3>Example 5</h3>
 
116
An example for connections of points (Spearfish):
 
117
<div class="code"><pre>
 
118
v.net.visibility input=archsites output=graph
 
119
g.region vector=archsites
 
120
d.mon wx0
 
121
d.vect graph
 
122
d.vect archsites col=red
 
123
</pre></div>
 
124
 
 
125
<h2>KNOWN BUGS</h2>
 
126
In some cases when 3 points or nodes are collinear, some wrong edges 
 
127
are added. This happens only really rarly and shouldn't be a big 
 
128
problem. When two points have the exact same x coordinate and are 
 
129
visible, some wrong edges are added.
 
130
 
 
131
<h2>SEE ALSO</h2>
 
132
 
 
133
<em>
 
134
<a href="d.path.html">d.path</a>,
 
135
<a href="v.net.html">v.net</a>,
 
136
<a href="v.net.alloc.html">v.net.alloc</a>,
 
137
<a href="v.net.iso.html">v.net.iso</a>,
 
138
<a href="v.net.salesman.html">v.net.salesman</a>,
 
139
<a href="v.net.steiner.html">v.net.steiner</a>,
 
140
<a href="v.to.db.html">v.to.db</a>
 
141
</em>
 
142
 
 
143
<h2>AUTHOR</h2>
 
144
Maximilian Maldacker<br>
 
145
Mentor: Wolf Bergenheim
 
146
 
 
147
<p>
 
148
<i>Last changed: $Date: 2014-12-24 15:55:42 +0100 (Wed, 24 Dec 2014) $</i>