#### NAME
v.net.distance - Computes shortest distance via the network between
the given sets of features.
Finds the shortest paths from a feature 'to' to every feature 'from'
and various information about this realtion are uploaded to the
attribute table.
#### KEYWORDS
vector, network, shortest path
#### SYNOPSIS
v.net.distance
v.net.distance help
v.net.distance [-g] input=__name__ output=__name__ [from_layer=__integer__]
[from_cats=__range__] [from_where=__sql_query__] [to_layer=__integer__]
[to_cats=__range__] [to_where=__sql_query__] [to_type=__string__[,__string__,...]]
afcolumn=__name__ [abcolumn=__name__] [--overwrite] [--verbose] [--quiet]
Flags:
-g
Use geodesic calculation for longitude-latitude locations
--overwrite
Allow output files to overwrite existing files
--verbose
Verbose module output
--quiet
Quiet module output
Parameters:
input=__name__
Name of input vector map
output=__name__
Name for output vector map
from_layer=__integer__
From layer number or name
A single vector map can be connected to multiple database tables.
This number determines which table to use.
Default: __1__
from_cats=__range__
From category values
Example: 1,3,7-9,13
from_where=__sql_query__
From WHERE conditions of SQL statement without 'where' keyword
Example: income = 10000
to_layer=__integer__
Layer number
To layer number or name
Default: __1__
to_cats=__range__
To category values
Example: 1,3,7-9,13
to_where=__sql_query__
To WHERE conditions of SQL statement without 'where' keyword
Example: income = 10000
to_type=__string[,string__,...]
To feature type
Options: __point,line,boundary__
Default: __point__
afcolumn=__name__
Arc forward/both direction(s) cost column
abcolumn=__name__
Arc backward direction cost column
#### DESCRIPTION
__v.net.distance__ finds the nearest element in set __to__ for every point in
set __from__.
#### NOTES
These two sets are given by the respective layer, where and cats
parameters. The type of __to__ features is specified by to_type parameter.
All __from__ features are __points__. A table is linked to output map
containing various information about the relation. More specifically,
the table has three columns: __cat__, __tcat__ and __dist__ storing category of
each __from__ feature, category of the nearest __to__ feature and the distance
between them respectively. Furthemore, output map contains the shorest
path between each __cat__, __tcat__ pair. Each path consist of several lines.
If a line is on the shorest path from a point then the category of this
point is assigned to the line. 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 __from__ feature. And so the shortest paths can be easily
obtained by querying lines with corresponding category number.
The costs of arcs in forward and backward direction are specified by
afcolumn and abcolumn columns respectively. If abcolumn is not given,
the same cost is used in both directions.
__v.net.distance__ will not work if you are trying to find the nearest
neighbors within a group of nodes, i.e. where __to__ and __from__ are the same
set of nodes, as the closest node will be the node itself and the
result will be zero-length paths. In order to find nearest neighbors
within a group of nodes, you can either loop through each node as __to__
and all other nodes as __from__ or create a complete distance matrix with
v.net.allpairs and select the lowest non-zero distance for each node.
#### EXAMPLES
Find shortest path and distance from every school to the nearest
hospital and show path from school number one.
v.net.distance input=city output=nearest from_where="type=school" \
to_where="type=hospital" afcolumn=SHAPE_LEN
d.vect nearest cats=1
#### SEE ALSO
__v.net.path,__ __v.net.allpairs,__ __v.net.distance,__ __v.net.alloc__
#### AUTHORS
Daniel Bundala, Google Summer of Code 2009, Student
Wolf Bergenheim, Mentor
__Last__ __changed:__ __$Date:__ __2013-05-23__ __13:01:55__ __-0700__ __(Thu,__ __23__ __May__ __2013)__ __$__
Full index
© 2003-2013 GRASS Development Team
| |