Aller au contenu principal

st_isvalid function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 17.1 and above check marked yes Lakehouse//RT

remarque

This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types.

Returns true if the input GEOMETRY value is a valid geometry in the OGC sense.

Syntax​

st_isvalid ( geoExpr )

Arguments​

  • geoExpr: A GEOMETRY value.

Returns​

A value of type BOOLEAN, true if the input GEOMETRY value is a valid geometry in the OGC sense.

The function returns NULL if the input is NULL.

Examples​

SQL
-- 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