Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_MakeLine

Introduction: Creates a LineString containing the points of Point, MultiPoint, or LineString geometries. Other geometry types cause an error.

Format:

ST_MakeLine(geom1: Geometry, geom2: Geometry)

ST_MakeLine(geoms: ARRAY[Geometry])

Since: v1.5.0

Example:

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

Output:

LINESTRING(1 2,3 4)

Example:

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

Output:

 LINESTRING(0 0,1 1,2 2,3 3)