Skip To Content

Spatial relationships in Data Pipelines

Some Data Pipelines tools, such as Join, allow you to analyze the locations of records in one dataset relative to records in another dataset. This type of analysis uses a spatial relationship. There are a number of spatial relationships you can use to select the point, polyline, or polygon records in one dataset that exhibit the relationship of interest with the records in another dataset.

For example, to find the number of homes that were affected by a recent flood, you could join the homes dataset to the flood boundary using the Within spatial relationship operator.

Input datasets

A spatial join matches records from the join dataset to the target dataset based on the records' relative spatial locations. In some tools, the datasets may have different names. For the purpose of describing spatial relationships, this topic uses target dataset and join dataset.

The following legend applies to all the examples in this topic:

  • Target records—Green
  • Join records—Purple
  • Target record exhibits the selected spatial relationship with join record—Red highlight

Spatial relationships between records

In a spatial relationship between records, each type of geometry (point, polyline, and polygon) has an interior and a boundary. How the interiors and boundaries of two geometries compare determines the spatial relationship they exhibit. The following image outlines the geometries, boundaries, and interiors of points, polylines, and polygons:

Boundaries and interiors of geometries used in spatial relationships in ArcGIS Data Pipelines

The relationships supported in ArcGIS Data Pipelines are Clementini, meaning a polygon boundary is separate from its interior and exterior.

Geometry types and supported relationships

The following table lists the supported spatial relationships between geometries of a given type (for example, joining points to other points):

Spatial join (target to join record) betweenEqualsIntersectsContainsWithinCrossesTouchesOverlapsPlanar NearGeodesic Near

Point and point

Check markCheck markCheck markCheck markCheck markCheck mark

Point and polyline

Check markCheck markCheck markCheck markCheck mark

Point and polygon

Check markCheck markCheck markCheck markCheck mark

Polyline and point

Check markCheck markCheck markCheck markCheck mark

Polyline and polyline

Check markCheck markCheck markCheck markCheck markCheck markCheck markCheck markCheck mark

Polyline and polygon

Check markCheck markCheck markCheck markCheck markCheck mark

Polygon and point

Check markCheck markCheck markCheck markCheck mark

Polygon and polyline

Check markCheck markCheck markCheck markCheck markCheck mark

Polygon and polygon

Check markCheck markCheck markCheck markCheck markCheck markCheck markCheck mark

Equals

A target record is equal to a join record if their interiors are identical and the geometry types are the same.

The target records in green are highlighted with red when they are equal to the purple records.

Equals spatial relationship

Intersects

A target record intersects a join record if it shares any portion of its geometry with the join record. If a target record contains, is within, crosses, touches, or overlaps a join record, it intersects.

The target records in green are highlighted with red when they intersect the purple records.

Intersects spatial relationship

Contains

A target record contains a join record if the join record is a subset of the target record, with intersecting interiors. If the join record is on the boundary and intersects the interior, the target record contains the joined record. If the join record is only on the boundary (and does not intersect the interior), the target record does not contain the joined record.

This is the inverse of the Within spatial relationship operator.

The target records in green are highlighted with red when they contain the purple records.

Contains spatial relationship

Within

A target record is within a join record if it is completely inside the join record. A record is within if the intersection of the interiors is nonempty and the target record is a subset of the join records. If there is no intersecting interior, the join record is not within the target record.

This is the inverse of the Contains spatial relationship operator.

The target records in green are highlighted with red when they are within the purple records.

Within spatial relationship

Crosses

Two polylines cross if their intersection contains only points, and at least one of the points of intersection is internal to both polylines. A polyline and polygon cross if a connected part of the polyline is partly inside and partly outside the polygon. A polyline and polygon also cross if they share a polyline in common on the interior of the polygon, which is not equal to the entire polyline. The target and join records must be either polylines or polygons.

The target records in green are highlighted with red when they cross the purple records.

Crosses spatial relationship

Touches

A target record touches a join record if they have an intersecting vertex, but the records do not overlap.

Touches spatial relationship

Overlaps

Two geometries overlap if they are the same geometry type and their intersection also has the same geometry type, but the intersection is different from both of the original geometries.

Overlaps spatial relationship

Planar Near and Geodesic Near

Conceptually, these operators buffer the target records using the specified distance and return all the target records that intersect the join records with the buffer applied.

Geodesic Near is the same as Planar Near, except geodesic distance is used rather than planar distance. Use this operator if the data covers a large geographic extent or the coordinate system of the inputs is geographic.

The target records in green, with a near distance buffer (light green), are highlighted with red when they are near the purple join records.

Near (Planar and Geodesic) spatial relationship