メインコンテンツまでスキップ
バージョン: 2.1

ST_INTERSECTS

説明

ジオメトリshape1がジオメトリshape2と交差するかどうかを判定します。

Note

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 |
+----------------------------------------------------------------------------------------+