ST_MLineFromText

更新时间:
复制 MD 格式

Constructs a MultiLineString geometry from a Well-Known Text (WKT) string and an optional spatial reference identifier (SRID).

Syntax

geometry ST_MLineFromText(text wKT, integer srid);
geometry ST_MLineFromText(text wKT);

Parameters

ParameterDescription
wKTThe WKT string representing a MultiLineString geometry.
sridThe SRID of the MultiLineString geometry. Defaults to 0 if not specified.

Usage notes

  • If the WKT string does not represent a MultiLineString geometry, the function returns null.

  • If you know the input is a valid MultiLineString, use ST_GeomFromText instead. ST_GeomFromText constructs the geometry faster because no unnecessary checks are required.

Examples

SELECT ST_AsText(ST_MLineFromText('MULTILINESTRING((1 2,3 4), (5 6,7 8))'));
              st_astext
--------------------------------------
 MULTILINESTRING((1 2,3 4),(5 6,7 8))
(1 row)