Scroll to navigation

v.net.distance(1grass) Grass User's Manual v.net.distance(1grass)

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 nearast element from set to for every element 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 and 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 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.

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: 2011-11-08 10:42:51 +0100 (Tue, 08 Nov 2011) $
Full index
© 2003-2011 GRASS Development Team
GRASS 6.4.2