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 for use=vertex, bestie, only for that one)
  • -p β€” use dmax as 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: 1
  • type=string[,string,...] β€” input feature type. options: point, line, boundary, centroid, area, face, kernel. default: point,line,boundary,centroid,face
  • output=name [required] β€” name for output vector map
  • use=string β€” use line nodes (start/end) or vertices only. options: node, start, end, vertex
  • dmax=float β€” maximum distance between points in map units, or percentage when -p is 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 point or centroid as the type parameter 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 for along are zero in the output vector map, because only point geometry was used for input (there is no linear distance to calculate along, 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 type parameter is set to area, 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 for type=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