ST_INTERSECTS
Description
Determines whether the geometry shape1 intersects with the geometry shape2.
Note
Supported since Apache Doris 3.0.6.
Syntax
ST_INTERSECTS( <shape1>, <shape2> )
Parameters
Parameters | Instructions |
---|---|
<shape1> | The passed geometry used to determine whether it intersects with shape2 |
<shape2> | The passed geometry used to determine whether it intersects with shape1 |
Return Value
Return 1: shape1 The graph intersects with the graph shape2
Return 0: shape1 The graph does not intersect with the graph shape2
Examples
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 |
+----------------------------------------------------------------------------------------+