1v.split(1) GRASS GIS User's Manual v.split(1)
2
3
4
6 v.split - Splits vector lines to shorter segments.
7
9 vector, geometry, densification, node, segment, vertex
10
12 v.split
13 v.split --help
14 v.split [-nf] input=name [layer=string] output=name [length=float]
15 [units=string] [vertices=integer] [--overwrite] [--help] [--ver‐
16 bose] [--quiet] [--ui]
17
18 Flags:
19 -n
20 Add new vertices, but do not split
21 Applies only to ’length’ option
22
23 -f
24 Force segments to be exactly of given length, except for last one
25 Applies only to ’length’ option
26
27 --overwrite
28 Allow output files to overwrite existing files
29
30 --help
31 Print usage summary
32
33 --verbose
34 Verbose module output
35
36 --quiet
37 Quiet module output
38
39 --ui
40 Force launching GUI dialog
41
42 Parameters:
43 input=name [required]
44 Name of input vector map
45 Or data source for direct OGR access
46
47 layer=string
48 Layer number or name (’-1’ for all layers)
49 A single vector map can be connected to multiple database tables.
50 This number determines which table to use. When used with direct
51 OGR access this is the layer name.
52 Default: -1
53
54 output=name [required]
55 Name for output vector map
56
57 length=float
58 Maximum segment length
59
60 units=string
61 Length units
62 Options: map, meters, kilometers, feet, surveyfeet, miles, naut‐
63 miles
64 Default: map
65
66 vertices=integer
67 Maximum number of vertices in segment
68
70 v.split splits vector lines into shorter segments using a maximal dis‐
71 tance between nodes. The resulting length of all segments is expected
72 to be equal and not higher than the given length parameter.
73
75 v.split does not change the layer, nor the category information, nor
76 the attribute table links of the original file. It just splits each
77 line in segments and attributes the same category to all segments of
78 the same original line. As the attribute table is linked to the fea‐
79 tures with their category as key, all segments originating from the
80 same original line are linked to the same line in the original attri‐
81 bute table which is just copied to the new map.
82
83 Notes on individual segment information
84 When running v.to.db on a map produced by v.split, v.to.db will add
85 length information for each segment in its respective attribute line,
86 but since all the segments of the same original line share the same at‐
87 tribute table line, it only gets updated once.
88
89 To obtain the length of each segment, the user will have to attribute
90 different category values to each of them. The best way to do this on a
91 separate layer, using v.category
92 v.category v_split op=add layer=2 output=v_split_2
93 and then run the following commands on the new layer 2:
94 v.db.addtable v_split_2 layer=2
95 v.db.addcolumn map=v_split_2 column="length double precision" layer=2
96 v.to.db map=v_split_2 type=line option=length columns=length units=meters layer=2
97 To link the new segments in the new layer to the original segments,
98 use:
99 v.db.addcolumn map=v_split_2 layer=2 column="cat_1 int"
100 v.to.db map=v_split_2 layer=2 option=query query_layer=1 query_column=cat columns=cat_1
101
103 The examples are based on the North Carolina sample data location.
104
105 Example 1: Inserting nodes to railroad lines map
106 # extract one railroad line for this example
107 v.extract input=railroads output=myrr cats=1
108 # show line, category, direction (to find the beginning)
109 g.region vector=myrr
110 d.erase
111 d.vect myrr display=shape,cat,dir
112 # insert nodes at a distance not longer than 1000m
113 v.split input=myrr output=myrr_split_1km length=1000
114 d.vect myrr_split_1km display=shape,topo
115
116 Note: In case that the vector line data are not polylines, generate
117 first polylines as the second step, eg.:
118 # join segments into polyline
119 v.build.polylines input=myrr output=myrr_polylines
120 # regenerate categories
121 v.category input=myrr_polylines output=myrailroads option=add
122
123 Example 2: Inserting vertices to railroad lines map
124 Note: first run the two steps from example 1.
125 # insert vertices at a distance not longer than 1000m
126 v.split -n input=myrr output=myrr_split length=1000
127 d.vect myrr_split display=shape,topo
128
130 v.edit, v.build.polylines, v.to.points, v.segment
131
133 Radim Blazek
134
136 Available at: v.split source code (history)
137
138 Accessed: Mon Jun 20 16:47:11 2022
139
140 Main index | Vector index | Topics index | Keywords index | Graphical
141 index | Full index
142
143 © 2003-2022 GRASS Development Team, GRASS GIS 8.2.0 Reference Manual
144
145
146
147GRASS 8.2.0 v.split(1)