v.to.points(1)

πŸ’– v.to.points β€” the GRASS GIS User's Manual page, but make it a group chat πŸ’–

okay bestie, so you know v.to.points? the manual calls it v.to.points and it lives in the GRASS GIS User's Manual. she's a vector module and her whole thing is: Creates points along input lines in new vector map with 2 layers. two layers!! she's giving overachiever πŸ’…


✨ KEYWORDS ✨

vector, geometry, 3D, line, node, vertex, point

like… that's the whole vibe. geometry girlies rise πŸ¦‹


🌸 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]

no cap, that's the whole shape of it.

πŸŽ€ Flags πŸŽ€

  • -i β€” Interpolate points between line vertices (only for use=vertex) ✨
  • -p β€” Use dmax as percentage of line length
  • -r β€” Start from the end node πŸ”„
  • -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 data source for direct OGR access.
  • layer=string β€” Line layer number or name. Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name. 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 with -p. Default: 100

πŸ’œ DESCRIPTION πŸ’œ

so v.to.points creates points along input 2D or 3D lines, boundaries and faces. literally what it says on the tin, bestie. and get this β€” point features including centroids and kernels are copied from the input vector map to the output. for the details you gotta go read the notes about the type parameter, it's a whole saga (scroll down, i got you).

the output is a vector map with 2 layers. this is the iconic part:

  • Layer 1 holds the category of the input features; all points created along the same line have the same category, equal to the category of that line. so everyone on that line shares a category, it's giving found family πŸ₯Ή
  • Layer 2 β€” each point has its unique category; other attributes stored in layer 2 are lcat β€” the category of the input line β€” and along β€” the distance from line's start.

by default only features with category are processed, see the layer parameter for details. no category, no entry, sorry babe 🚫


πŸ¦‹ NOTES πŸ¦‹

the dmax parameter is the maximum limit but not an exact distance. it's giving "suggestion, not a promise" 😭. if you want points placed with exact distance from the beginning of the vector line, you should use v.segment.

set layer to -1 to process features from all layers including features without category. features will be assigned new unique categories at layer 1. and listen β€” option layer=-1 should be used to convert boundaries, because in most of cases boundaries lack category values. do it, trust.

the type parameter controls which input vector geometry types get converted into points. some caveats to consider about this parameter, and bestie there are three of them:

  • Points and centroids can be considered as "lines" with only one node. consequently, the result of selecting point or centroid as the type parameter is that 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, as only point geometry was used for input (there is no linear distance to calculate along, as each point/centroid is the start and end of its own "line"). a line of one. main character energy fr.
  • Boundaries are treated as lines, with points getting interpolated along the boundary perimeter according to dmax. if two adjoining polygons share a topological boundary, the boundary only gets converted to points once. sharing is caring, they don't double-dip 🫢
  • If the type parameter is set to area, the boundary of each area is converted to points regardless of whether or not there is a topological boundary between adjacent areas. in other words, the common boundary of two adjoining areas, for example, gets converted to points twice. no sharing here, it's every area for herself πŸ’…. and 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. similarly to use=node when only line's node 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. she does both. she contains multitudes ✨

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. three points. iconic trio. no notes πŸ‘‘

use the -r flag to create points starting from the end node. backwards walk, she's quirky πŸ”„


🌈 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

go read those too, they're her friends 🫢


πŸ‘‘ 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)

Accessed: Saturday Jan 17 05:41:31 2026

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index


ok that's the whole page, you ate that bestie πŸ’…

and a lil sign-off because you deserve it: this whole thing is from GRASS 8.4.2 (the GRASS GIS 8.4.2 Reference Manual, no less), Β© 2003-2025 GRASS Development Team β€” and yeah, v.to.points(1) under GRASS 8.4.2, periodt. πŸŒΈβœ¨πŸ¦‹

πŸ“¦ where this page comes from