Skip to main content
Creates a LineString containing the points of Point, MultiPoint, or LineString geometries. Other geometry types cause an error. ST_MakeLine

Signatures

ST_MakeLine(geom1: Geometry, geom2: Geometry)
ST_MakeLine(geoms: ARRAY[Geometry])

Parameters

geom1
Geometry
The geom1 value.
geom2
Geometry
The geom2 value.
geoms
ARRAY[Geometry]
The geoms value.

Return type

The resulting geometry.

Examples

SELECT ST_AsText( ST_MakeLine(ST_Point(1,2), ST_Point(3,4)) );
LINESTRING(1 2,3 4)
SELECT ST_AsText( ST_MakeLine( 'LINESTRING(0 0, 1 1)', 'LINESTRING(2 2, 3 3)' ) );
 LINESTRING(0 0,1 1,2 2,3 3)