Share via


st_disjoint function

Applies to: check marked yes Databricks Runtime 17.1 and above

Important

This feature is in Public Preview.

Returns true if the two geometries are disjoint.

Syntax

st_disjoint ( geoExpr1, geoExpr2 )

Arguments

  • geoExpr1: The first GEOMETRY value.
  • geoExpr2: The second GEOMETRY value.

Returns

A value of type BOOLEAN.

For more details on what it means for two geometries to be disjoint, see the Disjoint predicate in the DE-9IM matrix definition.

The function returns NULL if any of the inputs is NULL.

Error conditions

  • If any of the two input geometries is a geometry collection, an error is returned.
  • If the two input geometries have different SRID values, the function returns ST_DIFFERENT_SRID_VALUES.

Examples

> SELECT st_disjoint(st_geomfromtext('POINT(1 1)'),st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'))
  false

> SELECT st_disjoint(st_geomfromtext('POINT(5 6)'),st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'))
  true