026] How to Use Spatial Predicates in Global Mapper for GIS Analysis
Define topological relationships and filter vector data using spatial logic.
This tutorial covers the Predicates tab within Global Mapper's Spatial Operations tool. You will learn how to use 11 different spatial relationship conditions—such as Intersects, Touches, and Within—to select or create data based on how layers interact geometrically. We also introduce the advanced DE-9IM "Relate" method for complex spatial queries.
Today, in our second session on Spatial Operations, we will explore Predicates, which offer a more granular approach than the basic operations we discussed previously.
Admittedly, there are some limitations. Because these operations usually work between only two layers at a time, managing complex multi-layer relationships can become challenging. Even so, most spatial analysis tasks can still be performed effectively using these methods.
Loading Sample Layers for Spatial Predicate Analysis
First, let’s open the file we used in the last session.
In the Control Center, you can see our sample layers: Area01, Area02, Line01, and Point01. Now, let's launch the Spatial Operations tool and navigate to the Predicates tab.
Understanding Spatial Predicates in Global Mapper
The Predicates tab has a similar layout to the Operations tab we handled last time. However, it focuses on the relationship between objects rather than creating new geometries from scratch.
A. Spatial Predicates: 11 Types of Relationships
You can choose from a total of 11 relationship conditions:
- Intersects: Returns features from Layer 1 that intersect with features in Layer 2.
- Overlaps: Returns features where Layer 1 and Layer 2 partially overlap.
- Touches: Returns features that touch only at their boundaries.
- Contains: Returns features in Layer 1 that completely contain features in Layer 2.
- Equals: Returns features where geometries are exactly the same.
- Within: Returns features in Layer 1 that are completely contained within Layer 2 (The inverse of Contains).
- Disjoint: Returns features that are completely separate from each other.
- Crosses: Returns features that cross but only partially overlap (primarily used for linear objects).
- Covers: Returns features in Layer 1 that cover features in Layer 2.
- CoveredBy: Returns features in Layer 1 that are covered by features in Layer 2.
- Relate: Performs operations by designating specific relationships using custom DE-9IM strings for complex definitions.
B. Processing Results
You can choose how to handle the output of the operation from 5 different options:
- Create New Selection: Makes a new selection of the resulting elements.
- Add to Selection: Adds the results to the current selection.
- Remove from Selection: Deselects elements that match the result from the current selection.
- Invert Selection: Selects all elements except those that match the result.
- Create New Layer: Generates a brand new layer containing the selected elements.
Spatial Predicate Examples in Global Mapper
Testing every single one would take too much time, so let's try a few key ones. We will test using Area01 and Line01 first.
Tip: As you use these more often, you'll get used to them. Pay close attention to which layer the selected results belong to.
How the Intersects Predicate Works in Global Mapper
The Intersects predicate returns Layer 1 objects if they cross or are contained within Layer 2.
Set Layer 1 to Area01 and Layer 2 to Line01. Select Create New Selection and click Run.
The red circles in the image indicate where intersections or containment occur. The Area01 object (Layer 1) that meets these conditions has been selected.
Changing Layer Order in Spatial Predicate Operations
What happens if we swap the layers?
This time, the Line01 objects (Layer 1) that touch or are contained within Area01 (Layer 2) are selected.
Using the Touches Predicate for Boundary Detection
The Touches predicate selects objects that contact each other only at their boundaries.
Objects that have matching vertices or lines along the boundary are selected.
Selecting Features with the Within Predicate
Finally, let's try Within. This selects objects in Layer 1 that are completely contained inside Layer 2. We'll use Area01 and Point01 for this.
As you can see, only the Point01 objects (Layer 1) that are fully inside Area01 (Layer 2) have been selected.
Using DE-9IM and the Relate Predicate in Global Mapper
Before wrapping up, I want to briefly mention Relate. This uses the DE-9IM (Dimensionally Extended 9-Intersection Model) method. To be honest, this software is quite interesting; if you dig through the menus, you'll find all sorts of surprisingly deep functions.
When you select Relate, you can enter a DE-9IM String. By clicking the 'Edit' button, you can search for objects by applying nine different conditions between two geometries.
For example, the image above shows the Within condition
written as a DE-9IM string. Using this method allows you to perform two or
more operations simultaneously. You could, for instance, select an object
that Contains another object while also Touching its
boundary. In 9IM code, this would be represented as
'TFF******'.
When to Use Each Spatial Predicate in GIS Workflows
Choosing the appropriate spatial predicate depends on the type of spatial relationship you want to analyze. The table below summarizes some of the most commonly used predicates and their typical GIS applications.
| Predicate | Best Use Case |
|---|---|
| Intersects | Detect overlapping or intersecting features |
| Touches | Analyze shared boundaries between geometries |
| Within | Perform point-in-polygon or containment analysis |
| Contains | Identify areas that completely contain other features |
I don't use this level of complexity often in my professional practice, so I'm not perfectly fluent in it. I'm not sure how often you'll need it in Global Mapper, but it's good to know that such a powerful feature exists.
That’s it for today!
- Learn previous workflow in 025] How to Perform Spatial Operations in Global Mapper | GIS Overlay Analysis Guide
- Continue learning with [027] How to Create MBR, Buffers, and Centroids in Global Mapper Spatial Operations
Comments
Post a Comment
Feel free to leave a comment if you have any questions about Global Mapper or CityEngine. I will get back to you with a sincere response as soon as possible. (Please note that all comments are moderated and manually approved to maintain a high-quality community. Promotional or spam content will not be published.)