ST_INTERSECTS
描述
判断几何图形 shape1 是否与几何图形 shape2 相交
备注
从 Apache Doris 3.0.6 开始支持该函数
语法
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 |
+----------------------------------------------------------------------------------------+