v.net.visibility Computes the visibility graph of a vector map containing lines, areas ( boundaries ) and points. The visibility graph is the graph where the nodes are the end point of the lines, boundaries or simply the points. There is an edge between two nodes if they are 'visible'. Two nodes are visibible if there is no segments in between them, i.e. the edge doesn't intersect any line or boundary in the vector map. This is useful to compute the sortest path in a vector map from any two points. To do this, first you need to compute the visibility graph and from it compute the shortest path using v.net.path or d.path.
IMPORTANT : the algorithm doesn't work well with intersecting lines ( that includes overlapping )If you compute a shortest path after computing the visibility graph you will notice that this path might go through a vertix of a line. If this is not wanted you might to run the map through v.buffer first whith a small value. Example:
v.buffer input=map output=bufferedmap buffer=1 type=point,line,area,boundary
The first argument is the input map. It supports lines, boudaries ( so areas ) and points. For the algorithm to work lines and boundaries must not be intersecting ( that includes overlapping ).
input=map
output=map2
coordinate=25556200,6686400,25556400,6686600
v.net.visibility input=map vis=vis_map output=new_vis_map coordinate=25556200,6686400,25556400,6686600
v.net.visibility input=lines output=graph
d.vect graph
d.vect lines col=red
v.buffer input=lines output=buffered_lines buffer=1 v.net.visibility input=buffered_lines output=graph
d.vect graph
d.vect lines col=red
v.net.visibility input=lines output=graph coordinate=2555678,6686343
d.vect graph
d.vect lines col=red
v.net.visibility input=lines output=graph
d.vect graph
d.vect lines col=red
v.net.visibility input=lines vis=graph output=new_graph coordinate=2555678,6686343
d.erase d.vect new_graph d.vect lines col=red
Last changed: $Date$