026] Global Mapper - Spatial Operations 02: Understanding Predicates
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. Since these operations typically involve only two layers at a time, you might find yourself thinking deeply when dealing with multiple layers. However, most spatial operations can be successfully performed using these methods.
1. Getting Started
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.
2. Understanding Spatial Predicates UI
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.
3. Hands-on Examples
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.
Test 1: Intersects (Area vs. Line)
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.
Test 2: Intersects (Line vs. Area)
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.
Test 3: Touches
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.
Test 4: Within
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.
Advanced Tip: The "Relate" Predicate and DE-9IM
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******'.
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!
Comments
Post a Comment