Fork me on GitHub

ST_Disjoint

Signatures

BOOLEAN ST_Disjoint(GEOMETRY geomA, GEOMETRY geomB);

Description

Returns true if geomA and geomB are disjoint.

Disjoint means that the two geometries have no point in common.

This function does not work on GEOMETRYCOLLECTIONs.
Implements the OpenGIS Simple Features Implementation Specification for SQL version 1.2.1.
This predicate does not yet support spatial indices, but it will in a future release. Use it in conjunction with && operator. See here for more details.

Examples

Cases where ST_Disjoint is true
SELECT ST_Disjoint(geomA, geomB) FROM input_table;
-- Answer:    TRUE
geomA POLYGON geomB POLYGON
POLYGON((1 1, 4 1, 4 5, 1 5, 1 1)) POLYGON((6 3, 7 3, 7 6, 6 6, 6 3))

geomA LINESTRING geomB LINESTRING
LINESTRING(2 1, 5 3, 2 6) LINESTRING(6 2, 6 6)

geomA LINESTRING geomB POINT
LINESTRING(2 1, 5 3, 2 6) POINT(4 5)

Cases where ST_Disjoint is false
SELECT ST_Disjoint(geomA, geomB) FROM input_table;
-- Answer:    FALSE
geomA POLYGON geomB POLYGON
POLYGON((1 1, 4 1, 4 5, 1 5, 1 1)) POLYGON((3 2, 6 2, 6 6, 3 6, 3 2))

geomA POLYGON geomB MULTIPOLYGON
POLYGON((1 1, 4 1, 4 5, 1 5, 1 1)) MULTIPOLYGON(((4 2, 7 2, 7 6, 4 6, 4 2)), ((0 6, 1 6, 1 7, 0 7, 0 6)))

See also