# Custom spatial relationships

The DE-9IM option is a custom spatial relationship type available in the Feature on Feature check that uses the Dimensionally Extended 9-Intersection Model, or DE-9IM format string. Custom spatial operations are defined by the interior, boundary, and exterior of features from two feature classes.

When you choose DE-9IM as the spatial relationship type, you can compare any possible spatial intersections between two shapes based on the following three aspects:

• Interior—The entire shape, except its boundary. All geometry types have interiors.
• Boundary—The endpoints of all linear parts for line features or the linear outline of a polygon. Only lines and polygons have boundaries.
• Exterior—The outside area of a shape, which does not include the boundary. All geometry types have exteriors.

Understanding how the interior, boundary, and exterior are defined for each type of feature geometry is important to understanding relationship operators:

• Point—A point represents a single location in space. The interior of a point is the point itself, the boundary is the empty set (or nonexistent boundary), and the exterior is all other points.
• Multipoint—A multipoint is an ordered collection of points. The interior of a multipoint is the set of points in the collection, the boundary is the empty set (or nonexistent boundary), and the exterior is the set of points that are not in the collection.
• Polyline—A polyline is an ordered collection of one or more paths where each path is a collection of contiguous segments. A segment has a start and an end point.

The boundary of a polyline is the set of start and end points of each path, the interior is the set of points in the polyline that are not in the boundary, and the exterior is the set of points that are not in the boundary or the interior.

For the polyline in the next image, the set of points comprising the boundary is shown in blue. The interior of the polyline is shown in orange.

• Polygon—A polygon is defined by a ring or collection of rings. Each ring is a collection of contiguous segments such that the start point and the end point are the same.

The boundary of a polygon is a ring or collection of rings that define the polygon. The boundary contains one or more outer rings and zero or more inner rings. An outer ring is oriented clockwise while an inner ring is oriented counter-clockwise. Imagine walking clockwise along the boundary. The area to your immediate right is the interior of the polygon and to your left is the exterior. For the polygon in the next image, the boundary is shown in blue, the interior is shown in orange, and the exterior is the empty space outside the boundary.

The DE-9IM spatial relationship is defined using a nine-character sequence string composed by some of the following characters:

• T (true)—The features have interiors, boundaries, or exteriors that intersect.
• F (false)—The features do not have interiors, boundaries, or exteriors that intersect.
• 0 (nondimensional)—The intersection between the interiors, boundaries, or exteriors of the features creates a point.
• 1 (one dimensional)—The intersection between the interiors, boundaries, or exteriors of the features creates a line.
• 2 (two dimensional)—The intersection between the interiors, boundaries, or exteriors of the features creates a polygon.
• * (do not check)—An aspect of the relationship between the interiors, boundaries, or exteriors is not checked.

The placement of the respective characters is important because it determines what is checked between the two features. The following table shows the order of the characters as they describe the spatial relationship between two regions, feature class one and feature class two.

For example, if you want to compare the interior of feature class 1 and feature class 2, type T for slot one. If you don’t want to compare them, type * for slot one.

Character slot numberFeature class 1Feature class 2

1

Interior

Interior

2

Interior

Boundary

3

Interior

Exterior

4

Boundary

Interior

5

Boundary

Boundary

6

Boundary

Exterior

7

Exterior

Interior

8

Exterior

Boundary

9

Exterior

Exterior

## Illustration examples

The following scenarios illustrate how geometry types in red relate to each other based on their interiors, boundaries, or exteriors.

Feature class 2InteriorFeature class 2BoundaryFeature class 2Exterior

Feature class 1

(Polygon)

T***T****

FC1 (polygon) shares a boundary with FC2 (polygon) and interiors intersect.

F***1****

FC1 (polygon) shares a boundary with FC2 (polygon). Interiors don’t intersect and shared boundaries form a line.

***1*****

FC1 (polygon) exterior intersects interior of FC2 (line) along congruent length.

Feature class 1

(Line/Polyline)

TT*FFT***

FC1 (line) interiors are contained in FC2 (line).

FF*FT****

FC1 (line) touches the boundary of FC2 (point) and interiors do not intersect.

TT**F****

FC1 (line) exterior and interiors intersect with FC2 (polygon).

Feature class 1

(Point)

T********

FC1 (point) interior is within FC2 (line).

*T*******

FC1 (point) interior touches the boundary of FC2 (line).

TF****T**

FC1 (point) exterior is within interior of FC2 (polygon), excluding the boundary of FC2.

## Relationship patterns

Once you choose the DE-9IM option, the DE-9IM String text box appears where you can type the pattern string. Patterns that you can use to find specific relationships are listed in the following table:

Spatial relationshipFeature class 1Feature class 2String

Contains

Line

Line

TT*FFT***

Contains

Line

Point

T**F*T***

Contains

Point

Point

T********

Contains

Poly

Line

TT*FFT***

Contains

Poly

Poly

TT*FFT***

Crosses

Line

Line

TF*FF****

Crosses

Line

Poly

TT**F****

Crosses

Poly

Line

T***F**T*

Overlaps

Line

Line

TT*T*****

Overlaps

Point

Point

T********

Overlaps

Poly

Poly

TT*T*****

Touch

Line

Line

FF*FT****

Touch

Line

Poly

FF*FT****

Touch

Poly

Line

FF*FT****

Touch

Poly

Poly

FF*FT****

Within

Line

Line

TF**F****

Within

Line

Point

T********

Within

Point

Point

T********

Within

Poly

Line

TF**F****

Within

Poly

Poly

TF**F****

Other examples of strings that are used in the DE-9IM String text box are listed in the following table:

Spatial relationshipFeature class 1Feature class 2String to use

Shares a boundary

Poly

Poly

****T****

Shares a boundary and interiors intersect

Poly

Poly

T***T****

Shares a boundary and interiors do not intersect

Line

Line

F***T****

Does not touch the boundary and interiors intersect

Poly

Poly

T***F****

Boundary of a polygon intersects the interior of a line along a congruent length

Poly

Line

***1*****

Are identical to

Poly

Poly

**F*TF***

Touches boundary of

Line

Line

****T****

Share a line segment with

Poly

Poly

F***1****

Cross by the outline of

Poly

Line

TT**F****