Constructs a MultiPoint geometry object from a Well-Known Text (WKT) string and an optional spatial reference identifier (SRID).
Syntax
geometry ST_MPointFromText(text wKT, integer srid);
geometry ST_MPointFromText(text wKT);Parameters
| Parameter | Type | Description |
|---|---|---|
wKT | text | A WKT string representing a MultiPoint geometry. |
srid | integer | The SRID of the resulting MultiPoint object. Defaults to 0 if not specified. |
Usage notes
If the WKT string does not represent a MultiPoint geometry, the function returns
null.
If the input is guaranteed to represent a MultiPoint object, use ST_GeomFromText instead. It skips the MultiPoint-specific validation check and runs faster.
Examples
Construct a MultiPoint object without an SRID:
SELECT ST_AsText(ST_MPointFromText('MULTIPOINT(1 2,3 4)'));
st_astext
-------------------------
MULTIPOINT((1 2),(3 4))
(1 row)该文章对您有帮助吗?