Predicate Queries

Spatial Predicate Operations identify features in one layer based on their topological relationship to features in a second layer. The resultant collection of features from the first layer can then be saved as a new layer by copying the result features, or used to modify the current Global Mapper selection. Unlike the cases of Spatial Operations and Spatial Transforms, the result features are unmodified, with no cutting or dividing of features. These operations are closely related to Advanced Selection Options, which act on selected features only. The input layers may be filtered by feature type (points, lines, or areas) or by selection status. The Results geometry type will be determined by the feature types present in the first layer, since a predicate will only return features from that layer that satisfy the spatial query. Input geometries are checked for validity, and if invalid, the user may choose to attempt repair, to ignore them, to use them anyway, or tohalt the predicate operation altogether.

The Predicate Operations include Intersects, Overlaps, Touches, Contains, Equals, Within, Disjoint, Crosses, Covers, Covered By, and Relate.

To specify the result of spatial predicates, use the drop-down list to the right of the Predicates label. Choices are:

  • Create New Selection: Features that satisfy the current predicate are used to replace the current selection.
  • Add to Selection: Features that satisfy the current predicate are added to current selection.
  • Remove from Selection: Features that satisfy the current predicate are removed from the current selection.
  • Invert Selection: Reverses the current selection of features within those that satisfy the current predicate. Preselect the features you don't want to be included in the final selection before running this option.
  • Create New Layer: Features that satisfy the current predicate are cloned into a new layer. The New Layer Name entry must not be empty.

Related Topics Link IconRelated Topics

Intersects

The Intersects predicate returns the set of features from one layer that intersect features in another layer; this includes any amount of intersection and returns the original feature in its entirety.

EXAMPLE: Intersection vs Intersects

Using the same data as the example above, what is the difference between intersection and intersects? 

Input Layers Intersection Result Intersects Result

The intersects result returns the full extent of the original features, not just the area where the shared geometry exists. It is a query, rather than a overlay operation that modifies the input data. By contrast, the intersection operation cuts the original features to produce an output of new geometries covering just the area of intersection.

Overlaps

The Overlaps predicate returns the set of features from one layer that overlap features in another layer. Overlap means that the interiors of the features share some common area, but there are also interiors of both features not covered by the other feature. Two geometries overlap if they have the same dimension (1D or 2D), but their intersection has different size.

Touches

The Touches predicate returns the set of features from one layer whose boundary intersects the boundary of a feature in another layer, but whose interiors do not overlap.

Contains

The Contains predicate returns the set of features from Layer 1 that wholly contain a feature from Layer 2. Contains is the opposite of within, i.e. layer 1 contains a feature if and only if the feature is wholly contained in layer 1.

Equals

The Equals predicate returns the set of features from one layer that have an exact match with the geometry of a feature from another layer. This means the two boundaries, interiors and exteriors match.

Within

The Within predicate returns the set of features from one layer that are wholly contained by a feature from another layer. A feature is within another feature if the interiors of the features intersect, but the interior of the within feature does not intersect the boundary of the containing feature. The two features can share some boundary.

Disjoint

The Disjoint predicate returns the set of features from one layer that do not intersect with any features from another layer. Disjoint features have no overlap between interior or boundary.

Crosses

The Crosses predicate returns the set of features from Layer 1 that cross with features from Layer 2. Cross is defined as some (but not all) features' interior areas are in common with a feature in the other layer, and the size of the intersecting area is less than that of at least one of them. This is unlike Intersects (where the amount of overlap does not matter) and unlike Overlaps (since Overlaps requires the layers be the same feature type, e.g. lines with lines, areas with areas).

Covers

The Covers predicate returns the set of features from Layer 1 that cover a feature from Layer 2. Covers means that all of one of the features must fit within the other. Covers and CoveredBy are directly related.

CoveredBy

The CoveredBy predicate returns the set of features from Layer 1 that are covered by a feature from Layer 2. Covers and Covered by are related, such that Covers(a,b) = CoveredBy(b,a)

Relate

The Relate predicate returns the set of features from one layer using a DE-9IM formatting string to designate relations between the Inner, Outer and Boundary portions of pairs of geometries.

The DE-9IM (Dimensionally Extended 9-Intersection Model) is a mathematical model used to express the spatial relationships between different 2D geometries in terms of their interiors (I), exteriors (E) and boundaries (B). For 2 groups of geometries there are 3 x 3 combinations, so 9 intersection possibilities, each mapping to a character in the DE-9IM string.

  Feature b

 

Feature a

  Interior (I) Boundary (B) Exterior (E)
Interior (I) I(a) and I(b) I(a), and B(b) I(a), and E(b)
Boundary (B) B(a) and I(b) B(a), and B(b) B(a), and E(b)
Exterior (E) E(a) and I(b) E(a), and B(b) E(a), and E(b)

The possible relationships noted in the table can be expressed using boolean values: 'T' for intersection, 'F' for no intersection, and '*' for don't care. For example a DE-9IM string could look like "'T*****FF*". This string representing the relationships between feature is what is used in the Relate predicate.

Example: The string 'T*****FF*' is logically equivalent to the Contains predicate. From the matrix, this means that Feature a's and Feature b's interiors intersect, neither b's interior nor its boundary intersect a's exterior (i.e., "no point of b lies outside of a"). This can be verifies by comparing the results of a Contains predicate vs the results of Relate using 'T*****FF*'.

Click Edit to edit the DE-9IM string and select from the table the relationships to consider in order to create the DE-9IM string. The features that meet the relationship criteria defined in the string will be returned as a result of the Relate predicate.

EXAMPLES

Predicates

The below examples use the following two layers as input:
Input Layer 1Input Layer 2Visual overlap of layers

Results:

Intersects

Overlaps

Touches

Contains

Equals

Within

Disjoint

Relate ('T*****FF*)

Related Topics Link IconRelated Topics