ST_MLineFromText

更新时间:
复制 MD 格式

Constructs a MultiLine object 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 that you want to specify.
sridThe SRID of the MultiLine object. Defaults to 0 if not specified.

Usage notes

  • If the WKT string does not represent a MultiLine object, the function returns null.

  • If the input is guaranteed to be a valid MultiLine object, use ST_GeomFromText instead. It constructs a geometry object at a higher speed 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)