geo-registry

Split Lines by Length

Cuts each line into pieces of a given length, with a shorter last piece.

Pitfall. Some tools make all pieces equal (and shorter than the length) instead of leaving a short last piece.
Pitfall. In a geographic CRS the length is in degrees unless the engine measures on the ellipsoid.
About this operation
Also called Split Line By Length, chunk lines, line chunk, segment lines
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
length length yes Not stated Not stated Not stated
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 line Not stated

In each engine

Engine Tool Parameters Differences
grass v.split
  • length → length
  • unit → units : m = meters; ft = feet; us-ft = surveyfeet; km = kilometers; mi = miles
  • layer → input
  • output → output
  • Splits into equal pieces no longer than the length unless flag f is set; this mapping sets f, for pieces of the given length and a shorter last one.
Preset: {"flag_f":true}
qgis native:splitlinesbylength
  • length → LENGTH
  • unit always crs-units
  • layer → INPUT
  • output → OUTPUT
None noted
turf-js turf.lineChunk
  • length → segmentLength
  • unit → options.units : m = meters; ft = feet; km = kilometers; mi = miles. not supported: us-ft
  • layer → geojson
  • units defaults to kilometers.
  • Turf works on GeoJSON in longitude/latitude (WGS 84); data in another CRS must be reprojected first.