Name

ST_MakeValid — Attempts to make an invalid geometry valid w/out loosing vertices.

Synopsis

geometry ST_MakeValid(geometry input);

Description

The function attempts to create a valid representation of a given invalid geometry without loosing any of the input vertices. Already-valid geometries are returned w/out further intervention.

Supported inputs are: LINESTRINGS, MULTILINESTRINGS, POLYGONS, MULTIPOLYGONS.

In case of full or partial dimensional collapses, the output geometry may be a collection of lower-to-equal dimension geometries or a geometry of lower dimension.

Single polygons may become multi-geometries in case of self-intersections.

Availability: 2.0.0, requires GEOS-3.3.0 or higher.

This function supports 3d and will not drop the z-index.

See Also

ST_IsValid ST_CollectionExtract