d.path1grass
Finds shortest path for selected starting and ending node.
Usage
d.path
d.path --help
d.path [-gb]
map=name
[arc_type=string
[,string, ...]]
coordinates=x1,y1,x2,y2
[arc_layer=string]
[node_layer=string]
[arc_column=string]
[arc_backward_column=string]
[node_column=string]
[highlight_color=string]
[--help]
[--verbose]
[--quiet]
[--ui]
Keywords
display, network, shortest path
Overview
d.path enables shortest path vector networking. Costs may be either line lengths, or attributes saved in a database table. Supported are cost assignments for both arcs and nodes, and also different in both directions of a vector line. For areas cost will be calculated along boundary lines.
Note
The user needs to display a vector map before using d.path. If no graphics monitor is open, a file map.png is generated in the current directory.
The ’from’ and ’to’ points are entered by mouse into the map displayed in the GRASS monitor, or if the coordinates option is used they can be specified non-interactively. The actions bound to the mouse buttons are described in the terminal window when running the command.
To calculate shortest path non-interactively and save the path to a new vector map, use the v.net.path module.
Examples
Interactive shortest path routing on road network (North Carolina sample dataset):
g.region vector=roadsmajor -pd.vect roadsmajord.path roadsmajor coordinates=668646.15,224447.16,668348.83,235894.02
Non-interactive shortest path routing on road network (North Carolina sample dataset):
d.path -b roadsmajor coordinates=668646.15,224447.16,668348.83,235894.02
Source code
Available at: d.path source code (history)
Accessed: Monday Feb 24 17:50:25 2025
Main index | Display index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
Releases
10 releases since Debian 4.0 (Etch); the text changed 9 times.