d.path(1grass)
π d.path β the manual, but make it make sense π
okay bestie, gather round, because today we're talking about d.path(1grass), straight out of the GRASS User's Manual. She's a display module, she finds shortest paths, and she is lowkey iconic. Let's get into it β¨
πΈ NAME πΈ
d.path β finds shortest path for selected starting and ending node. that's it, that's the whole job. main character energy fr π
π·οΈ KEYWORDS π·οΈ
display, network, shortest path β iykyk π¦
β¨ SYNOPSIS β¨
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]
π Flags π
-gβ use geodesic calculation for longitude-latitude locations. fancy math for the round-earth girlies π-bβ render bold lines. thicc. bold. unmissable π--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output (she's not talking, periodt)--uiβ force launching GUI dialog
π«Ά Parameters π«Ά
map=nameβ [required] name of vector map. or, plot twist, a data source for direct OGR access πarc_type=string[,string,...]β arc type. options:line,boundary. default:line,boundarycoordinates=x1,y1,x2,y2β [required] starting and ending coordinates. that's four numbers: start x, start y, end x, end y πarc_layer=stringβ arc layer. so here's the tea: vector features can have category values in different layers, and this number decides which layer to use. when you're doing direct OGR access, this is the layer name instead. default:1node_layer=stringβ node layer. same whole situation as arc layer: vector features can have category values in different layers, this number picks which one. with direct OGR access it's the layer name. default:2arc_column=stringβ arc forward/both direction(s) cost column, and it's a numberarc_backward_column=stringβ arc backward direction cost column (number)node_column=stringβ node cost columnhighlight_color=stringβ highlight color. default:redπ
π DESCRIPTION π
d.path enables shortest path vector networking β she's doing the routing, bestie. π«
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 usingd.path. if no graphics monitor is open, a filemap.pngis generated in the current directory. so yeah, she'll make her own little picture if you don't give her a screen π
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. different module, different vibe π
π₯ EXAMPLES π₯
Interactive shortest path routing on road network (North Carolina sample dataset):
g.region vector=roadsmajor -p
d.vect roadsmajor
d.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
π SEE ALSO π
v.net.path
π AUTHOR π
Radim Blazek, ITC-Irst, Trento, Italy. a legend, no cap π«‘
π§ SOURCE CODE π§
available at: d.path source code (history)
latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1
Main index | Display index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie β she lives in GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, from the GRASS 8.5.0 Reference Manual. d.path(1grass) out. slay, go find your shortest path, and text me when you get there πβ¨ππ¦π
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms