📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_ISVALID



Returns TRUE if the GEOMETRY object is geometrically valid as defined by the OGC specification.

Syntax

ST_ISVALID(<geometry>)

Arguments

ArgumentsDescription
<geometry>A GEOMETRY expression.

Return Type

Boolean.

Examples

SELECT ST_ISVALID(TO_GEOMETRY('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))')); ┌──────────────────────────────────────────────────────────┐ │ st_isvalid(to_geometry('polygon((0 0, 1 0, 1 1, 0 1, 0 0))')) │ ├──────────────────────────────────────────────────────────┤ │ true │ └──────────────────────────────────────────────────────────┘ -- Self-intersecting polygon (bowtie shape) is invalid SELECT ST_ISVALID(TO_GEOMETRY('POLYGON((0 0, 2 2, 2 0, 0 2, 0 0))')); ┌──────────────────────────────────────────────────────────────┐ │ st_isvalid(to_geometry('polygon((0 0, 2 2, 2 0, 0 2, 0 0))')) │ ├──────────────────────────────────────────────────────────────┤ │ false │ └──────────────────────────────────────────────────────────────┘

Was this page helpful?