ST_LineFromMultiPoint — Creates a LineString from a Multipoint.
geometry
ST_LineFromMultiPoint(bytea
Multipoint);
Creates a LineString from a Multipoint.
| 2D | 3D | M |
|---|---|---|
![]() | ![]() | ![]() |
| OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
|---|---|---|---|
| - | - | - | - |
--A 2D Linestring
SELECT ST_AsEWKT(ST_LineFromMultiPoint(ST_GeomFromText('MULTIPOINT(5 5, 8 10, 12 10)')));
--Result:
LINESTRING (5 5, 8 10, 12 10)
--A 3D Linestring with SRID
SELECT ST_AsEWKT(ST_LineFromMultiPoint(ST_GeomFromEWKT('SRID=25830;MULTIPOINT(5 5 10, 8 10 15, 12 10 20)')));
--Result:
SRID=25830;LINESTRING (5 5 10, 8 10 15, 12 10 20)
--LineString from Multipoints with measures (M)
SELECT ST_AsEWKT(LineFromMultiPoint(ST_GeomFromEWKT('SRID=25830;MULTIPOINTM(1 1 -2, 2 2 -4)')));
--Result:SRID=25830;LINESTRING (1 1 0 -2, 2 2 0 -4)