GRASS logo

NAME - Creates points along input lines in new vector map with 2 layers.


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

SYNOPSIS --help [-iprt] input=name [layer=string] [type=string[,string,...]] output=name [use=string] [dmax=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Interpolate points between line vertices (only for use=vertex)
Use dmax as percentage of line length
Start from the end node
Do not create attribute table
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input vector map
Or data source for direct OGR access
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
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 line nodes (start/end) or vertices only
Options: node, start, end, vertex
Maximum distance between points in map units or percentage with -p
Default: 100

Table of contents

DESCRIPTION creates points along input 2D or 3D lines, boundaries and faces. Point features including centroids and kernels are copied from input vector map to the output. For details see notes about type parameter.

The output is a vector map with 2 layers. 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. In 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 layer parameter for details.


The dmax parameter is the maximum limit but not an exact distance. To place points with exact distance from the beginning of the vector line the user 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. Option layer=-1 should be used to convert boundaries, as in most of cases boundaries lack category values.

The type parameter is used to control which input vector geometry types to convert into points. Some caveats to consider about this parameter:

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/end.

If the -i flag is used in conjunction with the use=vertex option, will digitize points on the line vertices, as well as interpolate points between line vertices using dmax as the maximum allowable spacing.

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.

Use the -r flag to create points starting from the end node.


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) input=railroads output=railroads_points dmax=200

# verify the two layers in the resulting map
v.category input=railroads_points option=report

# vector info map=railroads_points

Extract nodes as points input=railroads output=railroads_nodes use=node

Extract starting/ending nodes as points input=railroads output=railroads_start use=start input=railroads output=railroads_end use=end    


v.segment, v.split,,


Radim Blazek
Updated to GRASS 7 by Martin Landa, Czech Technical University in Prague, Czech Republic


Available at: source code (history)

Latest change: Thursday Feb 03 11:10:06 2022 in commit: 547ff44e6aecfb4c9cbf6a4717fc14e521bec0be

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

© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual