Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_IsValid

Introduction: Test if a geometry is well-formed. The function can be invoked with just the geometry or with an additional flag (from v1.5.1). The flag alters the validity checking behavior. The flags parameter is a bitfield with the following options:

  • 0 (default): Use usual OGC SFS (Simple Features Specification) validity semantics.
  • 1: "ESRI flag", Accepts certain self-touching rings as valid, which are considered invalid under OGC standards.

Formats:

ST_IsValid (A: Geometry)
ST_IsValid (A: Geometry, flag: Integer)

SQL Example:

SELECT ST_IsValid(ST_GeomFromWKT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0), (15 15, 15 20, 20 20, 20 15, 15 15))'))

Output:

false