Returns the geometry as a MULTI geometry object. If the input is already a MULTI geometry object, the function returns it unchanged.
Syntax
geometry ST_Multi(geometry g1);Parameters
| Parameter | Description |
|---|---|
g1 | The geometry object that you want to specify. |
Usage notes
If the input is already a MULTI type (such as MULTILINESTRING), the function returns the original object without modification.
Example
Convert a LINESTRING to a MULTILINESTRING:
SELECT ST_AsText(ST_Multi(ST_GeomFromText('LINESTRING(1 1,2 1)')));Output:
st_astext
----------------------------
MULTILINESTRING((1 1,2 1))
(1 row)该文章对您有帮助吗?