Returns a text description of why a geometry object is valid or invalid.
Syntax
boolean ST_IsValidReason(geometry geomA);
boolean ST_IsValidReason(geometry geomA , integer flags);Parameters
| Parameter | Description |
|---|---|
geomA | The geometry object to check. |
flags | A bitfield that controls validity rules. Set to 1 to treat self-intersecting rings that form holes as valid. This is the Environmental Systems Research Institute (ESRI) flag. |
Description
Use ST_IsValidReason together with ST_IsValid to generate a detailed validity report for geometry objects. ST_IsValid returns whether the geometry is valid; ST_IsValidReason returns the reason when it is not.
Examples
SELECT ST_IsValidReason('POLYGON((0 0,0 1,1 0,1 1,0 0))'::geometry);
st_isvalidreason
----------------------------
Self-intersection[0.5 0.5]
(1 row)