d.path(1)

πŸ’– d.path πŸ’–

okay bestie, welcome to d.path(1) from the GRASS GIS User's Manual β€” yes, the same one that ships with GRASS 8.4.2. this little icon finds the shortest path between a starting node and an ending node you pick. it's giving map-girlie-main-character energy and honestly? obsessed. πŸ¦‹


✨ NAME ✨

d.path β€” finds shortest path for selected starting and ending node. that's it, that's the girl. πŸŽ€


🏷️ KEYWORDS 🏷️

display, network, shortest path β€” the three vibes. slay.


🌸 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. lat/long girlies, this one's for you. 🌍
  • -b β€” render bold lines. thick. bold. iconic. πŸ’…
  • --help β€” print usage summary. your little cheat sheet bestie. 🫢
  • --verbose β€” verbose module output. she talks a LOT and we love that for her. 😭
  • --quiet β€” quiet module output. she's mysterious. she's silent. she ate. 🀫
  • --ui β€” force launching GUI dialog. no terminal, just vibes. ✨

πŸŽ€ 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,boundary
    • both by default, as she deserves. πŸ’–
  • coordinates=x1,y1,x2,y2 [required] β€” starting and ending coordinates. this is literally the whole point. πŸ“
  • arc_layer=string β€” arc layer. vector features can have category values in different layers, and this number determines which layer to use. when used with direct OGR access, this is the layer name.
    • Default: 1
  • node_layer=string β€” node layer. same situation: vector features can have category values in different layers, and this number determines which layer to use. with direct OGR access, this is the layer name.
    • Default: 2
  • arc_column=string β€” arc forward/both direction(s) cost column (number). πŸ’Έ
  • arc_backward_column=string β€” arc backward direction cost column (number). because sometimes going back costs differently, and honestly? relatable. πŸ™ˆ
  • node_column=string β€” node cost column. πŸ’°
  • highlight_color=string β€” highlight color.
    • Default: red
    • classic. bold. never misses. πŸ”₯

🌈 DESCRIPTION 🌈

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. no cap, she does all of that. 🧚


πŸ’€ NOTE πŸ’€

bestie, listen. 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. so like… it'll still work, but it's doing it quietly in a PNG instead of showing off on 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. so read the terminal, she's telling you things. 🫢

to calculate shortest path non-interactively and save the path to a new vector map, use the v.net.path module. that's the other girl. she files receipts. πŸ“

πŸ”₯ 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

notice the -b? bold lines. she understood the assignment. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

  • v.net.path

go say hi, she's the sibling module. πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Radim Blazek, ITC-Irst, Trento, Italy. thank you king, we stan. 🫢


🧚 SOURCE CODE 🧚

available at: d.path source code (history)

accessed: Saturday Jan 17 05:40:36 2026

main index | display index | topics index | keywords index | graphical index | full index

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


and that's the whole page bestie!! 🌈✨ this was d.path(1) from the GRASS GIS User's Manual, running on GRASS 8.4.2 β€” no cap, go find your shortest path, you're gonna ate. πŸ’–πŸ¦‹πŸŽ€πŸ’…

πŸ“¦ where this page comes from