Name

ST_LineFromMultiPoint — Creates a LineString from a MultiPoint geometry.

Synopsis

geometry ST_LineFromMultiPoint(geometry aMultiPoint);

Description

Creates a LineString from a MultiPoint geometry.

Use ST_MakeLine to create lines from Point or LineString inputs.

This function supports 3d and will not drop the z-index.

Examples

Create a 3D line string from a 3D MultiPoint

SELECT ST_AsEWKT(  ST_LineFromMultiPoint('MULTIPOINT(1 2 3, 4 5 6, 7 8 9)')  ));

--result--
LINESTRING(1 2 3,4 5 6,7 8 9)