Pular para o conteúdo principal

st_covers function

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

Preview

This feature is in Public Preview.

nota

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 first GEOMETRY value covers the second GEOMETRY value.

Syntax

st_covers ( geoExpr1, geoExpr2 )

Arguments

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

Returns

A value of type BOOLEAN, indicating whether the first GEOMETRY value covers the second GEOMETRY value.

The function does not support geometry collections.

For more details and the formal definition, see the Covers predicate in the DE-9IM matrix definition.

Error conditions

Examples

SQL
> SELECT st_covers(st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'),st_geomfromtext('POINT(1 1)'));
true

> SELECT st_covers(st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'),st_geomfromtext('POINT(5 0)'));
true

> SELECT st_covers(st_geomfromtext('POLYGON((0 0,10 0,0 10,0 0))'),st_geomfromtext('POINT(5 6)'));
false