A large number of spatial relationships between two ST_Geometry values can be based on testing for intersections between the interior, boundary, and exterior of the two values. For example, two ST_Geometry values are disjoint if neither the interiors nor the boundaries of either value intersect.

The intersections of any interior, boundary, or exterior of two ST_Geometry values can result in a set of ST_Geometry values of mixed dimension. For example, the intersection of the boundaries of two ST_Polygon values may consist of an ST_Point value and an ST_LineString value.

SQL/MM Spatial uses a dimensionally extended nine intersection model (DE-9IM) that expresses spatial relationships among ST_Geometry values as pair-wise intersections of their interior, boundary, and exterior with consideration for the dimension of the resulting intersections.

In the following 3-by-3 matrix, I(a), B(a), and E(a) represent the interior, boundary, and exterior of ST_Geometry value a, and I(b), B(b), and E(b) represent the interior, boundary, and exterior of ST_Geometry value b. The ST_Dimension method returns a value of -1, 0, 1, or 2, where a value of -1 corresponds to the dimension of the empty set (∅).

Interior | Boundary | Exterior | |
---|---|---|---|

Interior | (I(a) ∩ I(b)).ST_Dimension | (I(a) ∩ B(b)).ST_Dimension | (I(a) ∩ E(b)).ST_Dimension |

Boundary | (B(a) ∩ I(b)).ST_Dimension | (B(a) ∩ B(b)).ST_Dimension | (B(a) ∩ E(b)).ST_Dimension |

Exterior | (E(a) ∩ I(b)).ST_Dimension | (E(a) ∩ B(b)).ST_Dimension | (E(a) ∩ E(b)).ST_Dimension |