共用方式為

st_touches 函数

适用于:已勾选“是”的 Databricks Runtime 17.1 及更高版本

重要

此功能目前以公共预览版提供。

如果两个几何图形相互接触,则返回 true。

语法

st_touches ( geo1, geo2 )

论据

  • geo1:第一个 GEOMETRY 值。
  • geo2:第二个 GEOMETRY 值。

退货

一个值类型 BOOLEAN,当两个几何图形相互接触时,返回值为 true。

如果任何输入为NULL,该函数将返回NULL

错误条件

例子

-- Returns false when geometries do not touch.
> SELECT st_touches(st_geomfromtext('LINESTRING(5 0,5 10)'),st_geomfromtext('MULTILINESTRING((0 0,10 10),(0 10,10 0))'));
  false
-- Returns true when geometries touch.
> SELECT st_touches(st_geomfromtext('LINESTRING(5 0,5 5)'),st_geomfromtext('MULTILINESTRING((0 0,10 10),(0 10,10 0))'));
  true