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,boundary
  • coordinates=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: 1
  • node_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: 2
  • arc_column=string β€” arc forward/both direction(s) cost column, and it's a number
  • arc_backward_column=string β€” arc backward direction cost column (number)
  • node_column=string β€” node cost column
  • highlight_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 using d.path. if no graphics monitor is open, a file map.png is 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