Name

CG_IsValidDetail — Returns a valid_detail row stating whether a geometry is valid according to SFCGAL, and if not a reason and a location.

Synopsis

valid_detail CG_IsValidDetail(geometry geom);

Description

Returns a valid_detail row with a boolean validity flag, a reason for invalidity, and the invalidity location when SFCGAL reports one.

This differs from ST_IsValidDetail, which checks OGC validity through GEOS.

Availability: 3.8.0

This method needs SFCGAL backend.

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

This function supports Polyhedral surfaces.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

Examples

Code
SELECT valid, reason, ST_AsText(location) AS location
FROM CG_IsValidDetail('POLYGON((0 0,2 2,2 0,0 2,0 0))'::geometry);
Output
f | ring 0 self intersects |