Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Returns true if the input GEOMETRY is a valid geometry in the OGC sense.
Syntax
st_isvalid ( geoExpr )
Arguments
geoExpr: AGEOMETRYvalue.
Returns
A value of type BOOLEAN, true if the input GEOMETRY is a valid geometry in the OGC sense.
The function returns NULL if the input is NULL.
Examples
-- Returns false for invalid geometry with self-intersecting polygon.
> SELECT st_isvalid(st_geomfromtext('POLYGON((0 0,10 10,10 0,0 10,0 0))'));
false
-- Returns true for valid geometry.
> SELECT st_isvalid(st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'));
true