geo-registry

Points Along Lines

Points placed along each line at a regular distance.

Pitfall. Engines differ on whether the first point is at the line's start, at the first full distance, or half a step in, and on whether the end gets a point.
Pitfall. Some take a fraction of the line's length or a number of points per unit length instead of a distance.
About this operation
Also called Generate Points Along Lines, points along geometry, line sample, interpolate points, stationing
Group vector/geometry
Checks crs.measure
Pitfalls 2 listed above
Columbus tool Not stated
Notes Not stated
Status active
Broader Not stated
Narrower Not stated
Related

Parameters

Name Type Required Default Values Note
distance length yes Not stated Not stated Spacing along the line: a point at the start, then one every distance.
unit enum yes Not stated m, ft, us-ft, km, mi Not stated

Inputs and outputs

Direction Name Type Geometry Note
Input layer vector line Not stated
Output output vector point Not stated

In each engine

Engine Tool Parameters Differences
grass v.to.points
  • distance → dmax
  • unit always crs-units. dmax is in the map units of the GRASS project.
  • layer → input
  • output → output
  • Spaces the points evenly between vertices, both ends included, so a 95 m line at 10 m gets 11 points 9.5 m apart; with one more step than needed when the length is an exact multiple of dmax (a 100 m line at 10 m gets 12 points, 9.09 m apart).
  • Keeps every vertex of the line and adds points between them so that none is further apart than dmax; flag i (set by this mapping) does the interpolation, without it only the vertices are output.
Preset: {"flag_i":true,"use":"vertex"}
postgis st_lineinterpolatepoints
  • distance Takes a fraction of the line's length: divide the distance by ST_Length of the line.
  • unit always crs-units
  • layer → #1
  • The first point is one step from the start; there is no point at the start.
  • Returns one MultiPoint per line.
qgis native:pointsalonglines
  • distance → DISTANCE
  • unit always crs-units
  • layer → INPUT
  • output → OUTPUT
  • Starts at the line's start; the end gets a point only when it falls on a step; START_OFFSET and END_OFFSET leave a stretch at either end without points.
  • Adds the distance along the line and the line's angle at each point as fields.
sf sf::st_line_sample
  • distance density is points per unit of length, the inverse of the distance; n gives a number of points instead.
  • unit always crs-units
  • layer → x
  • With type regular the points sit half a step in from each end, not at the start.
  • Returns one MULTIPOINT per line.