SelectDB Enterprise
参考手册
SQL 函数
标量函数
地理位置函数
ST_INTERSECTS

ST_INTERSECTS

描述

判断几何图形 shape1 是否与几何图形 shape2 相交

:::info 备注 从 Apache Doris 2.1.10 开始支持该函数 :::

语法

ST_INTERSECTS( <shape1>, <shape2>)

参数

参数说明
<shape1>传入的几何图形,用于判断是否与 shape2 相交
<shape2>传入的几何图形,用于判断是否与 shape1 相交

返回值

返回 1: shape1 图形与图形 shape2 相交

返回 0: shape1 图形与图形 shape2 不相交

举例

SELECT ST_Intersects(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(5, 5));
+--------------------------------------------------------------------------------------+
| ST_Intersects(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(5, 5)) |
+--------------------------------------------------------------------------------------+
|                                                                                    1 |
+--------------------------------------------------------------------------------------+
SELECT ST_Intersects(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(50, 50));
+----------------------------------------------------------------------------------------+
| ST_Intersects(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(50, 50)) |
+----------------------------------------------------------------------------------------+
|                                                                                      0 |
+----------------------------------------------------------------------------------------+
© 2025 北京飞轮数据科技有限公司 京ICP备2022004029号 | Apache、Apache Doris 以及相关开源项目名称均为 Apache 基金会商标