メインコンテンツまでスキップ

st_contains

ST_Contains

説明

図形shape1がshape2を完全に含んでいるかどうかをチェックします。

構文

BOOL ST_Contains(GEOMETRY shape1, GEOMETRY shape2)

MySQL > SELECT ST_Contains(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(5, 5));
+----------------------------------------------------------------------------------------+
| st_contains(st_polygon('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))'), st_point(5.0, 5.0)) |
+----------------------------------------------------------------------------------------+
| 1 |
+----------------------------------------------------------------------------------------+

MySQL > SELECT ST_Contains(ST_Polygon("POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))"), ST_Point(50, 50));
+------------------------------------------------------------------------------------------+
| st_contains(st_polygon('POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))'), st_point(50.0, 50.0)) |
+------------------------------------------------------------------------------------------+
| 0 |
+------------------------------------------------------------------------------------------+

キーワード

ST_CONTAINS,ST,CONTAINS