1v.to.points(1) GRASS GIS User's Manual v.to.points(1)
2
3
4
6 v.to.points - Creates points along input lines in new vector map with
7 2 layers.
8
10 vector, geometry, 3D, line, node, vertex, point
11
13 v.to.points
14 v.to.points --help
15 v.to.points [-iprt] input=name [layer=string]
16 [type=string[,string,...]] output=name [use=string] [dmax=float]
17 [--overwrite] [--help] [--verbose] [--quiet] [--ui]
18
19 Flags:
20 -i
21 Interpolate points between line vertices (only for use=vertex)
22
23 -p
24 Use dmax as percentage of line length
25
26 -r
27 Start from the end node
28
29 -t
30 Do not create attribute table
31
32 --overwrite
33 Allow output files to overwrite existing files
34
35 --help
36 Print usage summary
37
38 --verbose
39 Verbose module output
40
41 --quiet
42 Quiet module output
43
44 --ui
45 Force launching GUI dialog
46
47 Parameters:
48 input=name [required]
49 Name of input vector map
50 Or data source for direct OGR access
51
52 layer=string
53 Line layer number or name
54 Vector features can have category values in different layers. This
55 number determines which layer to use. When used with direct OGR
56 access this is the layer name.
57 Default: 1
58
59 type=string[,string,...]
60 Input feature type
61 Options: point, line, boundary, centroid, area, face, kernel
62 Default: point,line,boundary,centroid,face
63
64 output=name [required]
65 Name for output vector map
66
67 use=string
68 Use line nodes (start/end) or vertices only
69 Options: node, start, end, vertex
70
71 dmax=float
72 Maximum distance between points in map units or percentage with -p
73 Default: 100
74
76 v.to.points creates points along input 2D or 3D lines, boundaries and
77 faces. Point features including centroids and kernels are copied from
78 input vector map to the output. For details see notes about type param‐
79 eter.
80
81 The output is a vector map with 2 layers. Layer 1 holds the category of
82 the input features; all points created along the same line have the
83 same category, equal to the category of that line. In layer 2 each
84 point has its unique category; other attributes stored in layer 2 are
85 lcat - the category of the input line and along - the distance from
86 line’s start.
87
88 By default only features with category are processed, see layer parame‐
89 ter for details.
90
92 The dmax parameter is the maximum limit but not an exact distance. To
93 place points with exact distance from the beginning of the vector line
94 the user should use v.segment.
95
96 Set layer to -1 to process features from all layers including features
97 without category. Features will be assigned new unique categories at
98 layer 1. Option layer=-1 should be used to convert boundaries, as in
99 most of cases boundaries lack category values.
100
101 The type parameter is used to control which input vector geometry types
102 to convert into points. Some caveats to consider about this parameter:
103
104 · Points and centroids can be considered as "lines" with only one
105 node. Consequently, the result of selecting point or centroid
106 as the type parameter is that all points/centroids get written
107 into the output vector map. The original category numbers of
108 the input points/centroids get written to the ’lcat’ attribute
109 in layer 2 of the output vector map. All values for along are
110 zero in the output vector map, as only point geometry was used
111 for input (there is no linear distance to calculate along, as
112 each point/centroid is the start and end of its own "line").
113
114 · Boundaries are treated as lines, with points getting interpo‐
115 lated along the boundary perimeter according to dmax. If two
116 adjoining polygons share a topological boundary, the boundary
117 only gets converted to points once.
118
119 · If the type parameter is set to area, the boundary of each area
120 is converted to points regardless of whether or not there is a
121 topological boundary between adjacent areas. In other words,
122 the common boundary of two adjoining areas, for example, gets
123 converted to points twice. The centroid is not converted to a
124 point in the output vector for type=area.
125
126 The use=vertex option is used to digitize points that fall on the
127 line’s vertices only. Parameter dmax is ignored in this case. Similarly
128 to use=node when only line’s node are used. To filter only start‐
129 ing/ending nodes use use=start/end.
130
131 If the -i flag is used in conjunction with the use=vertex option,
132 v.to.points will digitize points on the line vertices, as well as
133 interpolate points between line vertices using dmax as the maximum
134 allowable spacing.
135
136 Use the -p flag to treat dmax as a percentage of each line length. For
137 example, to get points created for the beginning, middle and end only,
138 use the -p flag and set dmax so that:
139 50 < dmax <= 100
140 Hence, if dmax is between 0.5x and 1.0x the line length, you will
141 always get points created at exactly the beginning, middle and end of
142 the input line.
143
144 Use the -r flag to create points starting from the end node.
145
147 Points along the input lines
148 In this example, the ’railroads’ vector lines map of the North Carolina
149 sample dataset is used to create points along the input lines:
150 # The North Carolina data are metric.
151 # 200m distance for points (maximum limit but not an exact distance)
152 v.to.points input=railroads output=railroads_points dmax=200
153 # verify the two layers in the resulting map
154 v.category input=railroads_points option=report
155 # vector info
156 v.info map=railroads_points
157
158 Extract nodes as points
159 v.to.points input=railroads output=railroads_nodes use=node
160
161 Extract starting/ending nodes as points
162 v.to.points input=railroads output=railroads_start use=start
163 v.to.points input=railroads output=railroads_end use=end
164
166 v.segment, v.split, v.to.rast, v.to.db
167
169 Radim Blazek
170 Updated to GRASS 7 by Martin Landa, Czech Technical University in
171 Prague, Czech Republic
172
174 Available at: v.to.points source code (history)
175
176 Main index | Vector index | Topics index | Keywords index | Graphical
177 index | Full index
178
179 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
180
181
182
183GRASS 7.8.5 v.to.points(1)