v.to.points(1grass)
π v.to.points π
okay bestie, welcome to v.to.points β the GRASS module that β¨creates points along input linesβ¨ in a new vector map with 2 layers. no cap, two whole layers. it's giving "I made you a playlist and also a spreadsheet." π
π NAME π
v.to.points β creates points along input lines in new vector map with 2 layers. (yes that's the whole vibe. two layers. iconic behavior.)
πΈ KEYWORDS πΈ
vector, geometry, 3D, line, node, vertex, point
β¨ SYNOPSIS β¨
v.to.points
v.to.points --help
v.to.points [-iprt] input=name [layer=string]
[type=string[,string,...]] output=name [use=string] [dmax=float]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π Flags π
-iβ interpolate points between line vertices (only foruse=vertex, bestie, only for that one)-pβ usedmaxas a percentage of line length-rβ start from the end node (start at the back, main character entry π )-tβ do not create attribute table--overwriteβ allow output files to overwrite existing files--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output--uiβ force launching GUI dialog
π¦ Parameters π¦
input=name[required] β name of input vector map. or, plot twist, a data source for direct OGR access.layer=stringβ line layer number or name. vector features can have category values in different layers, and this number decides which layer gets used. when you're on direct OGR access, this is the layer name instead. default:1type=string[,string,...]β input feature type. options:point,line,boundary,centroid,area,face,kernel. default:point,line,boundary,centroid,faceoutput=name[required] β name for output vector mapuse=stringβ use line nodes (start/end) or vertices only. options:node,start,end,vertexdmax=floatβ maximum distance between points in map units, or percentage when-pis on. default:100
π DESCRIPTION π
v.to.points creates points along input 2D or 3D lines, boundaries and faces. point features, including centroids and kernels, get copied straight from the input vector map into the output. for the deets, go read the notes about the type parameter. π«Ά
the output is a vector map with 2 layers. layer 1 holds the category of the input features β and the way that every point created along the same line has the same category, equal to that line's category? obsessed. meanwhile in layer 2, each point has its own unique category, and the other attributes chilling in layer 2 are lcat (the category of the input line) and along (the distance from the line's start). it's giving "one of us is the group, one of us is the individual." π§
by default only features with category get processed β check the layer parameter for the details.
β NOTES β
the dmax parameter is the maximum limit but not an exact distance, okay? don't come for it. if you need points placed at an exact distance from the beginning of the vector line, use v.segment. periodt.
set layer to -1 to process features from all layers, including features without category. those features get assigned new unique categories at layer 1. and listen β option layer=-1 should be used to convert boundaries, because in most cases boundaries lack category values. iykyk. π
the type parameter controls which input vector geometry types get converted into points. some caveats to consider about this parameter, bestie, because there are several:
- points and centroids can be considered as "lines" with only one node. consequently, selecting
pointorcentroidas thetypeparameter means all points/centroids get written into the output vector map. the original category numbers of the input points/centroids get written to the'lcat'attribute in layer 2 of the output vector map. all values foralongare zero in the output vector map, because only point geometry was used for input (there is no linear distance to calculatealong, since each point/centroid is the start and end of its own "line"). π - boundaries are treated as lines, with points getting interpolated along the boundary perimeter according to
dmax. if two adjoining polygons share a topological boundary, that boundary only gets converted to points once. sharing is caring. π«Ά - if the
typeparameter is set toarea, the boundary of each area is converted to points regardless of whether or not there's a topological boundary between adjacent areas. in other words, the common boundary of two adjoining areas, for example, gets converted to points twice. and heads up: the centroid is not converted to a point in the output vector fortype=area.
the use=vertex option is used to digitize points that fall on the line's vertices only. parameter dmax is ignored in this case β literally ignored, it said what it said. similarly to use=node, when only the line's nodes are used. to filter only starting/ending nodes, use use=start / use=end. π
if the -i flag is used in conjunction with the use=vertex option, v.to.points will digitize points on the line vertices as well as interpolate points between line vertices, using dmax as the maximum allowable spacing. best of both worlds, slay. β¨
use the -p flag to treat dmax as a percentage of each line length. for example, to get points created for the beginning, middle and end only, use the -p flag and set dmax so that:
50 < dmax <= 100
hence, if dmax is between 0.5x and 1.0x the line length, you will always get points created at exactly the beginning, middle and end of the input line. beginning, middle, end β the holy trinity π«
use the -r flag to create points starting from the end node. (walk in backwards like you own the place π
)
π₯ EXAMPLES π₯
πΈ Points along the input lines πΈ
in this example, the 'railroads' vector lines map of the North Carolina sample dataset is used to create points along the input lines:
# The North Carolina data are metric.
# 200m distance for points (maximum limit but not an exact distance)
v.to.points input=railroads output=railroads_points dmax=200
# verify the two layers in the resulting map
v.category input=railroads_points option=report
# vector info
v.info map=railroads_points
π Extract nodes as points π
v.to.points input=railroads output=railroads_nodes use=node
π Extract starting/ending nodes as points π
v.to.points input=railroads output=railroads_start use=start
v.to.points input=railroads output=railroads_end use=end
π¦ SEE ALSO π¦
v.segment, v.split, v.to.rast, v.to.db
π AUTHORS π
- Radim Blazek
- Updated to GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic
π SOURCE CODE π
Available at: v.to.points source code (history)
Latest change: Friday May 09 14:33:40 2025 in commit: b356c7e108fcbeca77474c8e83ebec8f1e7b3e4a
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole page, bestie, you made it π«Άβ¨ this was brought to you by GRASS 8.5.0 and the Β© 2003-2026 GRASS Development Team (GRASS 8.5.0 Reference Manual) β go make some points, you're gonna slay πππ§π₯
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms