v.net(1)

πŸ’– v.net(1) β€” GRASS GIS User's Manual πŸ’–

okay bestie, gather round, because we are doing v.net today and she is the network maintenance queen πŸ‘‘ this page is from the GRASS GIS User's Manual, and no cap, she's lowkey the blueprint for like half the v.net.* family. let's go πŸ¦‹


🌸 NAME 🌸

v.net β€” performs network maintenance. that's it, that's the job, and she does it flawlessly πŸ’…

πŸŽ€ KEYWORDS πŸŽ€

vector, network, network maintenance


✨ SYNOPSIS ✨

v.net
v.net --help
v.net [-cs]  [input=name]   [points=name]   [output=name]
operation=string  [arc_layer=string]   [arc_type=string[,string,...]]
[node_layer=string]   [threshold=float]   [file=name]
[turn_layer=string]   [turn_cat_layer=string]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

🫢 Flags

  • -c β€” assign unique categories to new points. it's giving "for operation 'nodes'" 🏷️
  • -s β€” snap points to network. for operation 'connect'. by default, a new line from the point to the network is created (so like, this flag changes the whole vibe of how you connect).
  • --overwrite β€” allow output files to overwrite existing files. she said out with the old πŸ—‘οΈβœ¨
  • --help β€” print usage summary.
  • --verbose β€” verbose module output.
  • --quiet β€” quiet module output 🀫
  • --ui β€” force launching GUI dialog.

πŸ’œ Parameters

  • input=name β€” name of input vector line map (arcs). required for operation 'nodes', 'connect', 'report' and 'nreport'.
  • points=name β€” name of input vector point map (nodes). required for operation 'connect' and 'arcs'.
  • output=name β€” name for output vector map.
  • operation=string [required] β€” operation to be performed. the options are: nodes, connect, arcs, report, nreport, turntable. and here's what each one is on about:
    • nodes: new point is placed on each node (line end) if doesn't exist
    • connect: connect still unconnected points to vector network by inserting new line(s)
    • arcs: new line is created from start point to end point
    • report: print to standard output {line_category start_point_category end_point_category}
    • nreport: print to standard output {point_category line_category[,line_category...]}
    • turntable: create turntable on vector network
  • 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.
  • arc_type=string[,string,...] β€” arc type, i.e. input feature type. options: line, boundary. default: line,boundary.
  • node_layer=string β€” node 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: 2.
  • threshold=float β€” threshold. required for operation 'connect'. connect points in given threshold.
  • file=name β€” name of input file. required for operation 'arcs' (- for standard input).
  • turn_layer=string β€” turntable layer. layer where turntable will be attached. format: layer number[/layer name]. required for operation 'turntable'. default: 3.
  • turn_cat_layer=string β€” layer with unique categories used in turntable. layer with unique categories for every line in arc_layer and point on every node. the categories are used in turntable. format: layer number[/layer name]. required for operation 'turntable'. default: 4.

πŸ¦‹ DESCRIPTION πŸ¦‹

v.net is used for network preparation and maintenance. her main use is to create a vector network from vector lines (arcs) and points (nodes) by creating nodes from intersections in a map of vector lines (the node operator), by connecting a vector lines map with a points map (the connect operator), and by creating new lines between pairs of vector points (the arcs operator). she really said "i contain multitudes" ✨

a GIS network consists of topologically correct lines (arcs). that is, the lines must be connected by shared vertices where real connections exist. in GRASS GIS you also can add nodes to the network β€” these are specially designated vertices used for analyzing network properties or computing cost/distance measures. that is, not all vertices are treated as nodes by default. only v.net.path can use a network without nodes; they are required for all the other network modules. in GRASS, network arcs are stored in one data layer (normally layer 1) and nodes are stored in a different data layer (normally layer 2). two layers, two vibes, one network πŸ’…

v.net offers two ways to add nodes to a network of arcs and one method to add arcs to a set of nodes:

  1. use the connect operation to create nodes from a vector points file and add these nodes to an existing vector network of arcs (i.e., lines/boundaries). this is useful when the goal is to analyze a set of places (points) in relation to a network β€” for example travel costs between places. only points within the thresh (threshold) distance to a line/boundary will be connected as network nodes. there are two ways to connect nodes. by default, v.net will create new lines connecting each point to the closest line of the network. if you use the -s flag, however, the new nodes will be added on the closest line of the network at the point closest to the point you wish to add. when using the connect operation, some lines will share the same category. in order to assign unique costs to each line, a new layer needs to be created with
v.category input=yourmap option=add cat=1 step=1 layer=3
output=newmap

followed by

v.db.addtable map=newmap layer=3 table=tablename

(periodt. πŸ’–)

  1. create nodes and arcs from a vector line/boundary file using the node operation. this is useful if you are mostly interested in the network itself and thus you can use intersections of the network as start and end points. nodes will be created at all intersections of two or more lines. for an arc that consists of several segments connected by vertices (the typical case), only the starting and ending vertices are treated as network nodes.
  2. create straight-line arcs between pairs of nodes with the arcs option. this produces networks like those of airline flights between airports. it is also similar to the kind of network created with social networking software, making it possible to create georeferenced social networks. main character energy, fr fr πŸ›«

while the arcs created with v.net will retain any attribute information associated with the input vector line/boundary file in data layer 1, nodes created and stored in data layer 2 will not have any associated attribute information. so like, the arcs remember everything, the nodes remember nothing. it's giving selective memory 😭

for nodes created using the connect and arcs operations (methods 1 and 3 above), the nodes can be reconnected to the attribute table of the input vector points file using the attribute table manager ("manage layers" tab) or by running v.db.connect.

for nodes created using the nodes operation (method 2 above), it is possible to create an attribute table for the new nodes in layer 2 using the attribute table manager and connect it to layer 2 ("manage layers" tab) or to create a table with v.db.addtable, connect it to layer 2 with v.db.connect, and update the new table with cat values with v.to.db.

the turntable operation creates a turntable with the costs for every possible turn on every possible node (intersection, crossroad) in given layer (arc_layer). U-turns are taken in account too. turntable is created in turn_layer and turn_cat_layer. building the turntable allows you to model e.g. traffic code, where some turns may be prohibited. if features in analyzed network are changed, the turntable must be created again (e.g. it includes v.net connect operation). turntable name consists of output vector map name + "_turntable_" + "t" + "_" + turn_layer + "_" + "tuc" + "_" + turn_cat_layer + "_" + "a" + "_" + arc_layer e. g. roads_turntable_t_3_tuc_4_a_1

these modules are able to work with the turntable: v.net.alloc, v.net.iso, v.net.path, v.net.salesman. for more information about turns in the vector network analyses see the "turns" wiki page. πŸ”₯

once a vector network has been created, it can be analyzed in a number of powerful ways using the suite of v.net.* modules. the shortest route between two nodes, following arcs, can be computed (v.net.path), as can the shortest route that will pass through a set of nodes and return to the starting node (v.net.salesman). least cost routes through the network can be calculated on the basis of distance only or on the basis of distance weighted by an attribute associated with each arc (for example, travel speed along a network segment). a network can be divided into concentric zones of equal travel cost around one or more nodes (v.net.iso) or subdivided so that each node is surrounded by a zone in which all arcs can be reached with the same travel costs as all arcs surrounding each other node (v.net.alloc). in addition to the modules listed above, the GRASS vector networking suite includes numerous other modules for analysis of network costs and connectivity. these include: v.net.allpairs, v.net.bridge, v.net.centrality, v.net.components, v.net.distance, v.net.flow, v.net.spanningtree, v.net.steiner, v.net.timetable, v.net.visibility 🌈


πŸ’€ NOTES πŸ’€

for a vector map prepared for network analysis in GRASS, nodes are represented by the grass-internal geometry type node and arcs by the geometry type line. if vector editing is required to modify the graph, g.gui.vdigit or v.edit can be used. see also the Linear Referencing System available in GRASS GIS. ✨

ok bestie that's part 1 done β€” do NOT close the tab, there's more coming 🫢

✨ EXAMPLES ✨

ok so these examples are all based on the North Carolina dataset πŸ¦‹ like that's the vibe, that's the dataset, no cap.


🌸 Create nodes globally for all line ends and intersections

bestie, watch this β€” we're making nodes for every single line end and intersection in one go:

v.net input=streets_wake output=streets_node operation=nodes
# verify result
v.category streets_node option=report

and yes we verify, because we're not feral πŸ’…


πŸŽ€ Merge in nodes from a separate map within given threshold

now we're pulling nodes in from another map and only keeping the ones within a threshold:

v.net input=streets_wake points=firestations out=streets_net \
      operation=connect threshold=500
# verify result
v.category streets_net option=report
🫢 heads up bestie: the nodes get stored in layer 2 unless you pass node_layer=1. don't say I didn't tell you 😭

πŸ¦‹ Generating network for vector point map

so for generating a network from a given vector point map, you need an input file shaped like this:

[category of edge] [category of start node] [category of end node]

Option 1: save that file (like, say, "points.txt") and then generate the map:

v.net points=geodetic_swwake_pts output=geodetic_swwake_pts_net \
      operation=arcs file=points.txt
# verify result
v.category geodetic_swwake_pts_net option=report

Option 2: read it straight in from the command line, icon behaviour:

v.net points=geodetic_swwake_pts output=geodetic_swwake_pts_net \
      operation=arcs file=- << EOF
1 28000 28005
2 27945 27958
3 27886 27897
EOF
# verify result
v.category geodetic_swwake_pts_net option=report

(see that file=-? that's the "read from stdin" moment. she ate πŸ“)


πŸ‘‘ Generating network with turntable for vector point map

and here's the glow-up β€” generating a vector map with a turntable:

v.net operation=turntable in=railroads out=railroads_ttb

πŸ’– SEE ALSO πŸ’–

g.gui.vdigit, v.edit, Vector Network Analysis Tool

v.net.alloc, v.net.allpairs, v.net.bridge, v.net.centrality, v.net.components, v.net.connectivity, v.net.distance, v.net.flow, v.net.iso, v.net.path, v.net.salesman, v.net.spanningtree, v.net.steiner, v.net.timetable, v.net.visibility

like... that's the whole friend group right there 🫢 the v.net cinematic universe fr fr


🌈 AUTHORS 🌈

  • Radim Blazek, ITC-irst, Trento, Italy
  • Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy and CTU in Prague, Czech Republic (operation 'connect' and 'arcs')
  • Markus Metz: important fixes and improvements

🧚 TURNS SUPPORT

the turns support was implemnented as part of the GRASS GIS turns cost project at Czech Technical University in Prague, Czech Republic. Eliska Kyzlikova, Stepan Turek, Lukas Bocan and Viera Bejdova participated at the project. Implementation: Stepan Turek. Documentation: Lukas Bocan. Mentor: Martin Landa.

(yes I kept "implemnented" exactly as written, that's canon, that's the original spelling, we don't edit the queen πŸ‘‘)


⭐ SOURCE CODE ⭐

available at: v.net source code (history)

accessed: Saturday Jan 17 05:41:25 2026

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

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


and that's a wrap bestie πŸ’… this whole thing is from the GRASS GIS 8.4.2 Reference Manual, page v.net(1), and the source-code link got accessed on Saturday Jan 17 05:41:25 2026 β€” the copyright line is Β© 2003-2025 GRASS Development Team. go build some networks, ily 🫢✨

πŸ“¦ where this page comes from