Skip to content

ST_MakeLine

Creates a LineString from two or more input geometries.

Usage

geometry ST_MakeLine(geomA: geometry, geomB: geometry)

Arguments

  • geomA (geometry): Input geometry
  • geomB (geometry): Input geometry

Description

Creates a LineString from two or more input Point, MultiPoint, or LineString geometries. The function connects the input geometries in the order they are provided to form a single continuous line.

Examples

SELECT ST_MakeLine(ST_Point(0, 1), ST_Point(2, 3)) as geom;
┌─────────────────────┐
│         geom        │
│       geometry      │
╞═════════════════════╡
│ LINESTRING(0 1,2 3) │
└─────────────────────┘