ST_Multi — Forces a geometry to be MULTI* type. Geometries already Multi, remain unchanged.
geometry ST_Multi(
bytea
Geometry)
;
Forces a geometry to be MULTI* type. As a result, single classes (Point, LineString, Polygon) are converted into collection classes of geometries (MultiPoint, MultiLineString, Multipolygon). Geometries already Multi or GeometryCollections remain unchanged.
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 |
---|---|---|---|
- | - | - | - |
SELECT ST_AsEWKT(ST_Multi(ST_GeomFromEWKT('POINT(0 0 -4)'))); --Result MULTIPOINT (0 0 -4) SELECT ST_AsEWKT(ST_Multi(ST_GeomFromEWKT('LINESTRING (0 0 4, 10 10 5, 20 10 6)'))); --Result MULTILINESTRING ((0 0 4, 10 10 5, 20 10 6)) SELECT ST_AsText(ST_Multi(ST_GeomFromText('POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0),(5 2, 5 5, 0 5, 5 2))'))); --Result MULTIPOLYGON (((0 0, 0 10, 10 10, 10 0, 0 0), (5 2, 5 5, 0 5, 5 2))) --Incoming geometry Multi, remains unchanged-- SELECT ST_AsEWKT(ST_Multi(ST_GeomFromEWKT('MULTILINESTRING ((0 0, 10 10, 20 10),(30 30, 40 40, 50 40))'))); --Result MULTILINESTRING ((0 0, 10 10, 20 10), (30 30, 40 40, 50 40))