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).
v.net offers two ways to add nodes to a network of arcs and one method to add arcs to a set of nodes:
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.
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 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, and v.net.visibility.
v.net input=streets_wake output=streets_node operation=nodes # verify result v.category streets_node option=report
v.net input=streets_wake points=firestations out=streets_net \ operation=connect threshold=500 # verify result v.category streets_net option=report
[category of edge] [category of start node] [category of end node]
Option 1: Save the file (e.g. "points.txt") and 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 in from command line:
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
v.net operation=turntable in=railroads out=railroads_ttb
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
Last changed: $Date$