ST_MLineFromText — Constructs a MultiLineString object given its Well-known text Representation
geometry ST_MLineFromText(varchar WKT);
geometry ST_MLineFromText(varchar WKT, integer
SRID);
Constructs a MultiLineString object given its Well-known text Representation. If the SRID is not provided it defaults to -1.
Returns Null when the WKT is not a MultiLineString or MultiLineStringM.
| 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 |
|---|---|---|---|
| 3.2.6.2 | 7.2.6.1 | - | 9.4.4 |
--2D Line
SELECT ST_Asewkt(ST_MLineFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))'));
--Result
MULTILINESTRING ((10 48, 10 21, 10 0), (16 0, 16 23, 16 48))
--EWKT Representation of a 4D MultiLineString.
SELECT ST_Asewkt(ST_MLineFromText('MULTILINESTRING((10 48 4 -4,10 21 4 -2,10 0 8 -4),(16 0 6 -5,16 23 6 -7,16 48 8 -9))'));
--Result
MULTILINESTRING ((10 48 4 -4, 10 21 4 -2, 10 0 8 -4), (16 0 6 -5, 16 23 6 -7, 16 48 8 -9))
--With SRID 25830
SELECT ST_Asewkt(ST_MLineFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))',25830)) as myline;
--Result
MYLINE
SRID=25830;MULTILINESTRING ((10 48, 10 21, 10 0), (16 0, 16 23, 16 48))