ST_INTERSECTS
2 つの GEOMETRY オブジェクトが空間の一部を共有している場合に TRUE を返します。
構文
ST_INTERSECTS(<geometry1>, <geometry2>)
引数
戻り値の型
Boolean。
例
SELECT ST_INTERSECTS(
TO_GEOMETRY('LINESTRING(0 0, 2 2)'),
TO_GEOMETRY('LINESTRING(0 2, 2 0)')
) AS intersects;
╭────────────╮
│ intersects │
├────────────┤
│ true │
╰────────────╯
SELECT ST_INTERSECTS(
TO_GEOMETRY('POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))'),
TO_GEOMETRY('POINT(3 3)')
) AS intersects;
╭────────────╮
│ intersects │
├────────────┤
│ false │
╰────────────╯