geo-registry

Offset Curve

A line running parallel to each input line at a given distance to one side.

Pitfall. Engines differ on which side a positive distance goes; check the direction of the line and the engine's convention.
Pitfall. At bends, joins (round, mitre, bevel) change the line's length; tight curves can make the offset line loop or vanish.
Pitfall. In a geographic CRS the distance is in degrees.
About this operation
Also called Offset line, parallel line, Copy Parallel, offset curve, line offset
Group vector/geometry
Checks crs.measure, geometry.valid
Pitfalls 3 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 Positive to the left of the line's direction, negative to the right.
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
apache-sedona sedona.sql.ST_OffsetCurve
  • distance → distance
  • unit always crs-units
  • layer → geometry
  • A Spark SQL function: arguments are columns or column names, run over a Spark DataFrame.
geopandas geopandas.GeoSeries.offset_curve
  • distance → distance
  • unit always crs-units
  • join_style (round, mitre, bevel) and quad_segs shape the bends.
grass v.parallel
  • distance → distance
  • unit always crs-units. The distance is in the map units of the GRASS project.
  • layer → input
  • output → output
  • GRASS 8.5's v.parallel returns a line of one vertex for a straight two-vertex line; lines of three or more vertices come out right.
  • The distance must be positive: side chooses left, right (the default) or both; this mapping sets side = left to match a positive canonical distance.
  • flag r makes rounded corners; flag b a buffer-like loop around the line.
Preset: {"side":"left"}
postgis st_offsetcurve
  • distance → #2
  • unit always crs-units
  • layer → #1
  • params takes 'quad_segs=N join=round|mitre|bevel mitre_limit=N' as text.
qgis native:offsetline
  • distance → DISTANCE
  • unit always crs-units
  • layer → INPUT
  • output → OUTPUT
  • JOIN_STYLE 0 round, 1 miter, 2 bevel; DISTANCE can be data-defined.
shapely shapely.offset_curve
  • distance → distance
  • unit always crs-units
  • layer → geometry
  • join_style (round, mitre, bevel) and quad_segs shape the bends.
turf-js turf.lineOffset
  • distance → distance
  • unit → options.units : m = meters; ft = feet; km = kilometers; mi = miles. not supported: us-ft
  • layer → geojson
  • A positive distance offsets to the right of the line's direction, the opposite of the canonical convention; negate it.
  • units defaults to kilometers.
  • Turf works on GeoJSON in longitude/latitude (WGS 84); data in another CRS must be reprojected first.