ST_ISVALID()
All functions > GEOSPATIAL > ST_ISVALID()
Returns TRUE if a geometry is topologically valid (no self intersections, proper ring closure, etc.).
Signatures
Is valid
Returns: TRUE if valid
ST_ISVALID(geo: T) → BOOLEAN sql
| Parameter | Type | Required | Description |
|---|---|---|---|
geo | T | Yes | Geometry value |
With:
T: Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY
Signature notes:
- Checks OGC validity rules (no self intersections, proper ring orientation, etc.)
- Self-intersecting polygons (e.g. a “bowtie”) are invalid—FALSE, matching standard OGC expectations
- Points and LineStrings are always valid
- Not supported on BigQuery (BigQuery auto validates on ingestion)
- GEOMETRY only (GEOGRAPHY values are always valid by construction on most engines)
- Returns NULL if the input is NULL
Examples
FeatureQL
SELECT
f1 := ST_ISVALID(ST_GEOMFROMTEXT('POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))')), -- Valid polygon
f2 := ST_ISVALID(ST_GEOMFROMTEXT('POLYGON ((0 0, 2 2, 2 0, 0 2, 0 0))')) -- Self intersecting bowtie polygon
;Result
| f1 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
On this page