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>.
16
<b>IMPORTANT: the algorithm doesn't work well with intersecting lines
17
(that includes overlapping)</b>
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
27
<div class="code"><pre>
28
v.buffer input=map output=bufferedmap buffer=1 type=point,line,area,boundary
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).
36
The resulting map containing the visibility graph is given in the output map.
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
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
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
68
v.net.visibility input=areas_7_11_25 output=graph
70
d.vect areas_7_11_25 color=red type=boundary
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
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
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
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
109
echo "symbol basic/star 20 669547.97 208348.20 black red" | d.graph -m
111
d.vect areas_7_11_25 color=red type=boundary
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
122
d.vect archsites col=red
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.
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>
144
Maximilian Maldacker<br>
145
Mentor: Wolf Bergenheim
148
<i>Last changed: $Date: 2014-12-24 15:55:42 +0100 (Wed, 24 Dec 2014) $</i>