Functions / PostGIS / ST_Multi
PostGISGeometry Editors

ST_Multi

What is ST_Multi?

ST_Multi wraps a single geometry inside its MULTI* container — a POINT becomes a MULTIPOINT, a LINESTRING becomes a MULTILINESTRING, and a POLYGON becomes a MULTIPOLYGON. Already-multi geometries are returned unchanged.

SQL
ST_Multi(geometry geom)geometry

The function preserves SRID, coordinates, and dimensionality.

When would you use ST_Multi?

Use ST_Multi when inserting into typed columns such as geometry(MultiPolygon, 4326), which reject bare POLYGON values. Wrapping each input ensures schema compatibility without forcing callers to know the stored type.

It is also useful when unioning heterogeneous geometry across rows — calling ST_Multi on each participant before ST_Collect gives a predictable output type.

FAQs

What happens if the input is already a MULTI-geometry?

The function is idempotent — a MULTIPOLYGON input is returned as a MULTIPOLYGON.

Does ST_Multi work on GeometryCollection?

Yes, but it returns the collection unchanged. Use ST_CollectionExtract to pull out a typed subset first.

How is it different from ST_ForceCollection?

ST_Multi produces a typed MULTI* wrapper preserving the feature class. ST_ForceCollection produces a generic GEOMETRYCOLLECTION, which may not satisfy typed columns.

Does it handle curves?

ST_Multi supports MULTICURVE and MULTISURFACE equivalents for curved types as well.