Spatial Overlays using Select or Join

Pending Update - This topic depends on new capability in the Select pane, to be added in the next build.

 

Spatial overlay operations formerly in the Transform pane are now done using either the Select pane or the Join dialog.  In most cases, using the Select pane will be easier.

 

Why? Because such operations are basically selection operations where objects are picked out that fulfill spatial characteristics such as being adjacent to, intersecting, contained in, and so on, in relation to objects in another drawing.  When selecting such objects we usually care about how any attribute fields for those objects also get carried along into the new drawing and how they are aggregated.  Instead of burying such choices within options in a transform template, it is more straightforward to make explicit choices about how fields are brought along using either a Select pane operation followed by a deletion of objects we don't want, or by using the Join dialog, where all fields that are passed through are right in front of us along with how they are aggregated.

 

To do a spatial overlay using the Select pane:

 

  1. In the Project pane, copy the drawing and table of interest and paste, to create a copy.
  2. Rename the copy.
  3. In the Select pane, select using the spatial template of interest.
  4. Choose Edit - Select Inverse, and then choose Edit - Delete.

 

Our examples use a map with two vector drawing layers:

 

 

The Green layer has five areas, one line, and five point objects:

 

 

The Brown layer has two areas, five lines, and eleven point objects:

 

 

When both layers are seen together in the map, we can see how objects in the two different layers overlap each other:

 

 

In the map we can see examples of relationships between objects in the Green and the Brown layer that illustrate all of the classic, topology overlay relationships: Adjacent, Contained, Containing, Intersecting, and Touching.

 

Our workflow in the following examples to illustrate each of the above relationships will repeat the same basic steps.   We will look at relationships using the Green drawing as a point of reference.   We copy the Green drawing and then paste it.  We rename the copy to some useful name, such as Adjacent, and we style that copy to use blue color, so the results will be visually different than the Green layer with which we started.   

 

We then use the Select pane to choose the objects of interest, press Ctrl-I to invert, delete, and then what is left is what we want for that example.

Adjacent

Copy and paste the Green drawing and table and rename the copy Adjacent.  Drag and drop the new layer into the map, and Style it using blue color to visually distinguish it from the original Green layer.

 

 

In the Select pane, select objects in the Adjacent layer that are adjacent to objects in the Brown layer.

 

 

The selected objects are the objects we want to keep.  We either choose Edit - Select Inverse or press Ctrl-I to invert the selection.

 

 

With the selection inverted, the selected objects are now those we want to delete.   We either choose Edit - Delete or we press the Delete key, confirming the deletion in the pop up confirmation dialog.

 

 

The objects that are left are the objects we want, only those which are adjacent to objects in the Brown layer.

Contained

Copy and paste the Green drawing and table and rename the copy Contained.  Drag and drop the new layer into the map, and Style it using blue color to visually distinguish it from the original Green layer.

 

 

In the Select pane, select objects in the Contained layer that are contained by objects in the Brown layer.

 

 

The selected objects are the objects we want to keep.  We either choose Edit - Select Inverse or press Ctrl-I to invert the selection.

 

 

With the selection inverted, the selected objects are now those we want to delete.   We either choose Edit - Delete or we press the Delete key, confirming the deletion in the pop up confirmation dialog.

 

 

The objects that are left are the objects we want, only those which are contained by objects in the Brown layer.

Containing

Copy and paste the Green drawing and table and rename the copy Containing.  Drag and drop the new layer into the map, and Style it using blue color to visually distinguish it from the original Green layer.

 

 

In the Select pane, select objects in the Containing layer that are containing objects in the Brown layer.

 

 

The selected objects are the objects we want to keep.  We either choose Edit - Select Inverse or press Ctrl-I to invert the selection.

 

 

With the selection inverted, the selected objects are now those we want to delete.   We either choose Edit - Delete or we press the Delete key, confirming the deletion in the pop up confirmation dialog.

 

 

The objects that are left are the objects we want, only those which are containing objects in the Brown layer.

Intersecting

Copy and paste the Green drawing and table and rename the copy Intersecting.  Drag and drop the new layer into the map, and Style it using blue color to visually distinguish it from the original Green layer.

 

 

In the Select pane, select objects in the Intersecting layer that are intersecting objects in the Brown layer.

 

 

The selected objects are the objects we want to keep.  We either choose Edit - Select Inverse or press Ctrl-I to invert the selection.

 

 

With the selection inverted, the selected objects are now those we want to delete.   We either choose Edit - Delete or we press the Delete key, confirming the deletion in the pop up confirmation dialog.

 

 

The objects that are left are the objects we want, only those which are intersecting objects in the Brown layer.

Touching

Copy and paste the Green drawing and table and rename the copy Touching.  Drag and drop the new layer into the map, and Style it using blue color to visually distinguish it from the original Green layer.

 

 

In the Select pane, select objects in the Touching layer that are touching objects in the Brown layer.

 

 

The selected objects are the objects we want to keep.  We either choose Edit - Select Inverse or press Ctrl-I to invert the selection.

 

 

With the selection inverted, the selected objects are now those we want to delete.   We either choose Edit - Delete or we press the Delete key, confirming the deletion in the pop up confirmation dialog.

 

 

The objects that are left are the objects we want, only those which are touching objects in the Brown layer.

Spatial Overlays using Join

A spatial overlay using the Join dialog is basically doing a spatial selection operation using the Join dialog.   We do a spatial join using any field, and then use the resulting presence or absence of joined values in a selection.

 

 

Copy and paste the Green drawing and table and rename the copy Adjacent using Join.  Drag and drop the new layer into the map, and Style it using blue color to visually distinguish it from the original Green layer.

 

 

With the focus on the Adjacent using Join layer, choose Edit - Join to launch the Join dialog.   In the Join dialog, choose Brown as the joined layer, using the Geom field as the key field for both the Adjacent using Join layer and the Brown layer.

 

Choose adjacent to as the join method.  

 

Press the Add button to add the mfd_id field (we could use any field) from the Brown layer as a new row, using the default copy method and renaming the resulting new field Adjacent.

 

Press Join Component.

 

 

The result is that a new field called Adjacent appears in the Adjacent using Join drawing's table.   It has non-NULL values for only two objects, those which are adjacent to objects in the Brown layer. We select all the NULL records, and then either choose Edit - Delete or we press the Delete key to delete those NULL records.   The result is that only two objects are left, those which are adjacent to objects in the Brown layer.

 

 

The map automatically updates to show those two adjacent objects.

Notes

Spatial relationships - The Select pane and Join dialog both use the following definitions for spatial relationships:

 

adjacent

An original object is adjacent to a joined object if both objects have at least one boundary location in common but have no interior locations in common.  Any locations in common between an original object and a joined object are only on the boundaries of the objects, and nowhere else.

 

An object that is adjacent to another object also touches that other object, but it does not intersect the other object.  Objects that are contained by or which contain another object are not adjacent.

 

contained

An original object is contained in a joined object only if all locations in the original object are entirely within the joined object.

 

An object that is contained in another object also touches that other object but it is not adjacent to and it does not intersect that other object.

 

containing

An original object contains a joined object if all locations in the joined object are entirely within the original object.

 

An object that contains another object also touches that other object but it is not adjacent to and it does not intersect that other object.

 

intersecting

An original object  intersects a joined object if both objects have at least one interior location in common and also at least one exterior location not in common.

 

An object that intersects another object also touches that other object, but it is not adjacent to, is not contained in, and does not contain the other object.

 

touching

An original object touches a joined object if there is any location in common between the two.

 

One object that touches another object may or may not be intersecting, and it may or may not be adjacent to the other object.  Objects that are contained by or which contain another object are also touching.

 

Two meanings of "intersect" - There are two notions of what "intersect" should mean, both of which are used by Manifold.   Topology overlays, as discussed in the Topology Overlays topic, use the classic set-theoretic meaning of "intersect," in which objects that are entirely contained by other objects are said to intersect as well.   A different meaning is used in Select pane templates and spatial joins in Join, where an object that is entirely contained within another object does not "intersect" that object but is contained by that object.  In the Join dialog and in Select pane templates, an object only intersects another object if some part of the object is outside the other object and some part is within the other object.   This allows the use of contained and containing to provide different selection criteria instead of simply duplicating what intersect does in a selection.

 

See Also

Select Pane

 

Select Reference

 

Select - Geometry

 

Join

 

Transform Pane

 

Transform Reference