Select Templates

Templates in the Select pane provide point-and-click selection of objects in a drawing.   Selection templates allow us to select objects based on their geometric characteristics, such as which objects are areas, lines or points, by the characteristics of their attributes, such as which objects have fields that contain a specific text string, or by their spatial relationship to objects in other drawing layers in a map, such as which objects intersect or are adjacent to objects in a given layer.

Templates for Drawings

Areas

Select objects that are areas.

 

 

Choose Areas as the template, specify the geometry field in the active layer and press Replace Selection.

 

Area objects are selected.

 

Between

Select objects for which the value of the specified field is between the given upper and lower bounds, inclusive.

 

 

Use a numeric field mfd_id we can search for values between 5 and 7.  We choose Expression in the pull down menus for the lower and upper bounds and then enter numbers.

 

 

 Between is often used with numbers, but also can be used with other data types, such as text fields.

 

 

Using a text field called Name we can search for values between 'charlie' and 'foxtrot', in lexicographic order.   We choose Expression in the pull down menus for the lower and upper bounds and then enter strings using single ' quote characters.

 

The use of single quotes is unusual, but that is because we are working with a Select template that can work with various data types.  It does not know we mean text, since we have chosen Expression.  In SQL expressions, text literals are quoted using single ' quote characters, so that is what we do.

 

 

Equal

Select objects for which the value of the specified field is equal to the Compare to value.

 

 

In the illustration we find objects with a Name text field that is equal to 'delta'.   We choose Expression in the pull down menu for the Compare to box, and then enter the string using single ' quote characters.

 

The use of single quotes is unusual, but that is because we are working with a Select template that can work with various data types.  It does not know we mean text, since we have chosen Expression.  In SQL expressions, text literals are quoted using single ' quote characters, so that is what we do.

 

 

Geoms Adjacent

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are adjacent to any object in the overlay drawing.  See illustrations below.

Geoms Contained

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are contained by any object in the overlay drawing.  See illustrations below.

Geoms Containing

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing containing any object in the overlay drawing.  See illustrations below.

Geoms Intersecting

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing intersecting any object in the overlay drawing.  See illustrations below.   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.  

Geoms Touching

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing touching any object in the overlay drawing.  See illustrations below.

Geoms with Curves

Select objects that contain curved segments.  Points do not have curved segments, so only areas and lines can be selected.

 

 

Choose Geoms with Curves as the template, specify the geometry field in the active layer and press Replace Selection.

 

Objects that contain curved segments are selected.

 

Geoms with Z

Select objects that include a Z (height) value.  

 

 

Choose Geoms with Z as the template, specify the geometry field in the active layer and press Replace Selection.

 

 

Objects that have a Z value specified are selected.   In the illustration above we have added a labels layer, where the Z values, if any, for objects are taken from a computed field that reports the Z value set for an object.

 

The computed field that shows the Z value (height), if any, for an object was created using the expression:

 

VectorValue(GeomCoordXYZ([Geom], 0),2)

 

See the Example: Add a Computed Field to a Table topic for discussion and explanation of the above.

 

Greater

Select objects for which the value of the specified field is greater than the Compare to value.

 

 

In the illustration we find objects with an mfd_id field that is greater than 4.  We choose Expression in the pull down menu for the Compare to box and then enter a number.

 

Greater or Equal

Select objects for which the value of the specified field is greater than or equal to the Compare to value.

JSON Boolean

Select objects for which the value of the named JSON boolean tag in the specified field is true.

 

 

In the illustration we find objects for which the Photo boolean tag is true in the JSON_Info text field containing a JSON string.  We choose Value in the pull down menu for the Name box and then enter the desired text, no quotes.

 

 

The illustration uses a table of Carolingian coin hordes where the Photo tag is either true or false depending on whether there is a photograph for that particular horde.  See the discussion for the JSON Boolean transform template in the Transform Templates - Boolean topic.  See the Example: Construct JSON String using Select and Transform topic for an example creating the table illustrated above.

 

Less

Select objects for which the value of the specified field is less than the Compare to value.

 

 

In the illustration we find objects with an mfd_id field that is less than 4.  We choose Expression in the pull down menu for the Compare to box and then enter a number.

 

Less or Equal

Select objects for which the value of the specified field is less than or equal to the Compare to value.

Like

Select objects for which the value of the specified string field is like the Pattern.    Syntax for patterns is syntax for the SQL LIKE Operator, a simplified pattern matching syntax that is much easier for most people than full regular expression syntax.

 

 

In the illustration we find objects with a Name field that is like the pattern %o.  We choose Value in the pull down menu for the Pattern box and then enter the desired text pattern, no quotes.

 

 

The SQL Like operator allows pattern matching using two wildcard characters, a % character that matches zero or more characters of any kind and the underscore _ character that matches any single character.   The pattern used above matches any string that ends in a lower case o character.   See the LIKE Operator topic for examples.

 

Lines

Select objects that are lines.

 

 

Choose Lines as the template, specify the geometry field in the active layer and press Replace Selection.

 

Line objects are selected.

 

Lines, Closed

Select all lines where each branch in the line is closed, that is, if each branch has the starting coordinate equal to the ending coordinate.   

 

A line that is closed encloses closed region, with no gap between the end of the line and the beginning of the line.  This selection template is a great way to find lines that we think should be closed, but which because of errors in digitization (such as failure to use snap) have small gaps between the end and the beginning of the line that are difficult to see without individually zooming into the beginning of each line.

 

For example, we can select all closed lines and then invert the selection to see any surprises.

 

 

We use a drawing with four line objects.  Two of these end precisely where they begin, that is, they are closed.

 

 

Choose Lines, Closed as the template, specify the geometry field in the active layer and press Replace Selection.

 

 

Closed objects are selected.

 

Non-null Values

Select objects for which the value of the specified field is not NULL.

 

 

In the illustration we find objects with a Zvalue field that is not NULL.  

The Zvalue field in this example is a computed field that reports the Z value set for an object using the expression:

 

VectorValue(GeomCoordXYZ([Geom], 0),2)

 

Normalized Geoms

Select objects for which geoms have been normalized.

Not Equal

Select objects for which the value of the specified field is not equal to the Compare to value.

Null Values

Select objects for which the value of the specified field is NULL.

Points

Select objects that are points.

 

 

Choose Points as the template, specify the geometry field in the active layer and press Replace Selection.

 

Point objects are selected.

 

Text Contains

Select objects where the specified string field contains the specified sub-string.

 

 

In the illustration we find objects with a Name field that contains the sub-string ha. We choose Value in the pull down menu for the Search for box and then enter the desired text, no quotes.

 

 

Both alpha and charlie contain the sub-string ha.

Text Contains, Intl

Same as Text Contains, with the option to specify a language, and additional options to ignore case, accent, and symbols.

Text Ends with

Select objects where the specified string field ends with the specified sub-string.

Text Ends with, Intl

Same as Text Ends with, with the option to specify a language, and additional options to ignore case, accent, and symbols.

Text Matches Regexp

Select objects for which the value of the specified string field matches the regular expression Pattern.

 

 

In the illustration we find objects with a Name field that matches the regular expression pattern .+a.+   We choose Value in the pull down menu for the Pattern box and then enter the desired rexexp pattern, no quotes.

 

 

In regular expression syntax, the dot and plus sign .+ combination matches one or more of any character.  The .+a.+ pattern used above therefore matches any string that has one or more characters followed by an a character that is then followed by one or more characters.  The result is to find all strings that contain the letter a, but not only at the very beginning or the very end of the string.

 

The values bravo and charlie are thus selected, because those words have a letter a inside the word.   The values alpha and delta are not selected because those words only have the letter a either at the beginning or the end of the word.   

 

See the Regular Expressions topic for details on regular expression syntax and examples of use.

 

Text Sounds like

Select objects for which the value of the specified string field sounds like the Compare to pattern, using the Soundex algorithm for English language.

 

 

In the illustration we find objects with a Name field that in English pronunciation sounds like the pattern eko.  We choose Value in the pull down menu for the Compare to box and then enter the desired text, no quotes.

 

 

The ch character sequence in the English word echo is pronounced like a hard k character, so the word echo is pronounced in English as though it were spelled eko and thus is selected.   Additional examples from the above table would be to use the pattern alfa to select the record for alpha, or to use the pattern charly to select the record for charlie.

 

See the discussion of the StringSoundex function in the SQL Functions topic.   See also the discussion of the Text Sounds like template in the Transform Templates - Boolean topic.

Text Starts with

Select objects where the specified string field starts with the specified sub-string.

Text Starts with, Intl

Same as Text Starts with, with the option to specify a language, and additional options to ignore case, accent, and symbols.

 

Spatial Selection Templates

Given two drawings in a map, spatial selection templates select objects in the active layer, called the source drawing, based upon a spatial relationship with an overlay drawing.    In the following examples we will use two drawings that appear as layers in a map.

 

 

One drawing we call the Source Green drawing.   It shows objects that are points, areas and a line in green color, using diamond symbols for points. The Source Green drawing will be used as the source drawing.   The other drawing is called the Overlay Brown drawing.  It shows areas, lines and points in brown color and will be used as the overlay drawing.  The Overlay Brown drawing uses a formatting style for areas with horizontal line pattern and transparent fill color, so any objects in other layers within the areas can be seen through the areas.   The Overlay Brown drawing uses round symbols for points.  It will be used as the overlay drawing.

 

 

Seen together as layers in the map, we can see the various spatial relationships between objects in the two drawings.  

 

Geoms Adjacent

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are adjacent to any object in the overlay drawing.   Mnemonic:  Source objects adjacent to Overlay objects.

 

 

There are two objects in the source drawing that are adjacent to objects in the overlay drawing.   One of the areas in the source drawing is adjacent to an area in the overlay drawing.  One of the lines in the source drawing is adjacent to two of the lines in the overlay drawing.  The area and the line have been selected.

 

Geoms Contained

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are contained by any object in the overlay drawing.   Mnemonic:  Source objects contained by Overlay objects.

 

 

Four of the points within the source drawing are contained by area objects in the overlay drawing.   Those four points are shown in red selection color above, and are seen through the transparent fill color of the two areas in the overlay drawing.

 

Geoms Containing

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing containing any object in the overlay drawing.  Mnemonic:  Source objects containing Overlay objects.

 

Three of the areas in the source drawing are containing objects in the overlay drawing and are selected.

 

Geoms Intersecting

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing intersecting any object in the overlay drawing.   Mnemonic:  Source objects intersecting Overlay objects.   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.  

 

Three of the areas in the source drawing intersect objects in the overlay drawing.   The three areas intersect lines in the overlay drawing.    Note that an object which is entirely within an area in the source drawing is said to be contained by that area, and is not intersected.   Objects in the source drawing intersect an object in the overlay only if that object in the overlay is partially within and partially outside the source drawing object.

 

Geoms Touching

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing touching any object in the overlay drawing.   Mnemonic:  Source objects touching Overlay objects.

 

Any object in the source drawing which is adjacent, contained by, containing or intersecting any object in the overlay is also touching an object in the overlay.

 

 

Flipping Source and Overlay Drawings

To illustrate how choosing which drawing is the source drawing and which drawing is the overlay drawing makes a difference in which objects are selected, we can use the Brown drawing as the source and the Green drawing as the overlay.

 

 

We could do that without changing names, but in the illustration above and in the following examples we have renamed the drawings so the active layer, that is, the source drawing, is called Source Brown and the overlay drawing is called Overlay Green.

 

 

Geoms Adjacent

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are adjacent to any object in the overlay drawing.  Mnemonic:  Source objects adjacent to Overlay objects.

 

The template selects the two lines and one area in the Source Brown drawing which are adjacent to objects in the Overlay Green drawing.

 

Geoms Contained

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are contained by any object in the overlay drawing.  Mnemonic:  Source objects contained by Overlay objects.

 

 

The template selects points and one line in the Source Brown drawing that are contained by areas in the Overlay Green drawing.

 

Geoms Containing

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing containing any object in the overlay drawing.  Mnemonic:  Source objects containing Overlay objects.

 

 

The template selects two areas in the Source Brown drawing containing points in the Overlay Green drawing.

 

Red selection color fills in selected areas.   We can use the Layers pane to set transparency of the Source Brown layer to 50% so we can see through the red selected areas to view the points within the Overlay Green layer.

 

Geoms Intersecting

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing intersecting any object in the overlay drawing.  Mnemonic:  Source objects intersecting Overlay objects.   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.  

 

 

The template selects three lines within the Source Brown layer which intersect objects in the Overlay Green layer.

 

Geoms Touching

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing touching any object in the overlay drawing.  Mnemonic:  Source objects touching Overlay objects.

 

The template selects areas, lines and points in the Source Brown layer which touch objects in the Overlay Green layer.  

 

 

Symmetric Spatial Selection Templates

The Adjacent, Intersecting and Touching templates are symmetric, in that the same sets of objects are adjacent, intersecting or touching regardless of which is the source drawing and which is the overlay drawing.  The only question is which drawing is the source drawing, and thus the set of objects that are selected.

 

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 Transform: Overlay Topology 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 overlays, where an object that is entirely contained within another object does not "intersect" that object but is contained by that object.  In Select pane templates, as discussed in this topic, and also in spatial overlays, as discussed in the Transform: Overlay topic, 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.

 

 

Geoms Adjacent

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are adjacent to any object in the overlay drawing.  Mnemonic:  Source objects adjacent to Overlay objects.

 

 

Geoms Intersecting

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing intersecting any object in the overlay drawing.  Mnemonic:  Source objects intersecting Overlay objects.    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.  

 

 

Geoms Touching

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing touching any object in the overlay drawing.  Mnemonic:  Source objects touching Overlay objects.

 

 

 

Asymmetric Spatial Selection Templates

The Contained and Containing templates are asymmetric in that the set of objects selected as contained or containing usually depends on which drawing is the source drawing and which is the overlay drawing.

 

Geoms Contained

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing that are contained by any object in the overlay drawing.  Mnemonic:  Source objects contained by Overlay objects.

 

 

Geoms Containing

Available for maps that contain at least two drawing layers when one of the drawing layers is the active layer.  Select all objects in the source drawing containing any object in the overlay drawing.  Mnemonic:  Source objects containing Overlay objects.

 

 

 

Notes

 

Allow parallel execution - If checked (default) the template will allow execution using CPU parallelism in multiple threads with as many CPU cores as are available, providing faster performance.   Checking this box is equivalent to commanding THREADS SystemCpuCount() in SQL within templates.

 

 

See Also

Contents - Select

 

Tables

 

Selection

 

Drawings

 

Example: Using the Select Pane Template Tab -  A sequence of actions using Select pane templates.

 

Example:  Using the Select Pane Saved Tab - How to save selections and then use them later.

 

Example: Construct JSON String using Select and Transform - Use the  Select and Transform panes to manually construct a JSON string using values from other fields in a table. Shows how we can manipulate text to build desired contents in a field.