Point and Click Selection

Selection in Manifold is choosing some objects in a map, or some records in a table, usually by interactive means like pointing and Ctrl-clicking in a table or in a drawing.   Labels can also be selected, as can tiles in images.  This idea of selection is a different idea than the use of SELECT in SQL, even though the word selection is used to describe both.  Selection as we mean it here is a simpler, more interactive thing, like clicking a file in Windows File Explorer to highlight it.  For selection in SQL, see the SQL Basics topic.

 

A table, or a drawing's table, must have a key field with a btree index (and not a btreedup or some other form of index) in it for selection to work.  If the table does not have a btree index, selection will not be available.  To add an index to a table that does not have an index, see the Add an Index to a Table topic.

 

Manifold provides four distinctive means of working with selections:

 

 

 

 

 

Selection tools can be used in combination to get exactly the right selection desired.  For example, if we already have selected some records in a table using the mouse we can further modify the selection using the Select pane.   We can also start with the Select pane and then modify the selection using interactive selection in tables or drawing windows.

Menu Selection / Keyboard Selection

A simple way to select objects in drawings or records in tables is to use commands like Select All that appear in menus or are  keyboard shortcuts like Ctrl-A.

 

 

For simple selections, the Edit main menu choice provides four selection commands, which are matched to keyboard shortcuts as follows:

 

Select All

Ctrl-A - Select everything in the active window (objects in drawings, labels in label components, frames in layouts, records in tables).  Selects only within the active layer in maps.

Select None

Shift-Ctrl-A - Deselect everything in the active window (objects in drawings, labels in label components, frames in layouts, records in tables).  Deselects only within the active layer in maps.

Select None Map

Deselects everything within all layers in a map.  Equivalent to Select None for components other than maps.

Select Inverse

Ctrl-I - Inverts the selection, deselecting what was selected and selecting what was not selected.

 

There are two ways to Select None from the keyboard: either do a Ctrl-A followed by a Ctrl-I or do a Shift-Ctrl-A. Which sequence is faster or more convenient depends on taste and dexterity.

Selections are Shown in Red

The table below shows three selected records.  Selected records are shown in red selection color.   Select or deselect a record in a table by Ctrl-clicking it.

 

If desired, we can change the selection color used by Manifold in the Tools - Options dialog.   This allows us to use a color different than red selection color in cases where a map already uses very much red color or to provide a more discernible color in case of color blindness.

 

 

A selection in a table is simply a subset of records in that table that we have highlighted in red selection color to belong to that selection.  It is a way of choosing records to be a part of a group, usually so we can do something with the records in that group.  For example, in the table above we might want to increase the price of selected products by using the Transform pane to increase the Unit Price value of selected records by 10%.  An analogy might be highlighting several files in Windows File Explorer so we can copy them all at once.

 

 Press in the Selected button in the main toolbar to show only selected records in the table.   Alternatively, use the View - Filter menu choice to filter a table view to show only selected records.

 

 

Selections are often used as "scratch pad" temporary sets of items of interest and are often used interactively.  For example, we might browse a table of products where would like to increase or decrease the dealer discount on some items.   While scrolling through the table we select those we want to change and then we can use the Transform pane to alter the discount percent only on those records in the selection.

Selections Require an Index

Important: Selection only works in tables that have a btree index on one of the fields in the table.  Most Manifold dataports that import drawings will automatically create an mfd_id field in the drawing's table and will create a btree index on that mfd_id field.   Tables that are imported from databases usually already have an index in them, since DBMS people almost always will have one or more indexes in their tables for performance reasons.   

 

Some dataports that import from unsophisticated formats, such as .txt or .csv,, to ensure consistency with the original data, will not create an mfd_id field and will not create a btree index.   Such tables can be viewed, and we can SELECT from them using SQL, but we cannot edit them and we cannot use selection within them as discussed in this topic until we add a btree index.   Lucky for us, a btree index is easy, really easy, to add.   See the Adding an Index to a Table topic.

 

Selection in Manifold has the following characteristics:

 

 

In addition to this topic, it is a good idea to read the Select pane topic.

Drawings and Selections

Drawings, either in their own window or as layers in a map window, are just a different visual interface for displaying a table with records that contain vector geometry data.   When we select objects in a drawing, which we can do interactively with the mouse, we are simply selecting records in the associated table using a different visual interface.  When we make a selection in a drawing window the selection will also be shown in red selection color and the corresponding records in the drawing's table also will be shown in red selection color.

 

Whether we Ctrl-click objects in the drawing with a mouse or Ctrl-click on rows in a table, in both cases we are simply selecting records in a table.  A drawing window is just a specialized way to display vector data from a table.   Selecting objects in a drawing also selects the corresponding records in a table.  Selecting records in a table automatically selects the corresponding objects in the drawing.

Example: Select a record in a table

Using a drawing of Mexico as an example, we select a record in the drawing's table.

 

 

Ctrl-click on a record in a table to select it.

 

 

The record is shown in red selection color and the corresponding object in the drawing window is also automatically selected and shown in red selection color.

 

If other drawings show that same table, they too will automatically show the selected object in red selection color, adjusted for opacity settings if the layer for that drawing is not at 100% opacity.   

 

 

At left above we see a map that includes as a layer a drawing, Mexico 2, using the same Mexico Table.    At right above we see a second map that has a third drawing, Mexico 3, that also is created using the same Mexico Table, but with different formatting.   The Mexico 3 layer has 60% opacity applied in the Layers pane.

 

In every case, whenever a drawing is created from the same table, if a record in the table is selected, all objects in every drawing layer created from that record will also be selected.

 

 

Above at left we see the Mexico 2 drawing open in its own drawing window, zoomed in to the border between the selected area and the adjacent area.   Above at right we see the Mexico 3 drawing open in a drawing window.  In this example we have drawings created from the same table shown in five different windows.  All of them have their selections synchronized to whatever is the selection in the table.  

 

If we change the selection in the table, the selected objects in all of the drawings will also change.   If we change the selection in any of the drawing layers that show the same layer, all of the other drawings will also have their selection changed to match, as will the table.

Example: Select an object in a drawing

Using a drawing of Mexico as an example, we select an additional object in the drawing.

 

 

 

Ctrl-click on an object in a drawing to select it.    We have Ctrl-clicked the province of Coahuila.

 

 

 

The object is shown in red selection color and the corresponding record in the table window is also automatically selected and shown in red selection color.

 

 

If we have any other windows open using drawings for that same table, those drawings and drawing layers will also be automatically updated.

Images and Selections

Images, either in their own window or as layers in a map window, are just a different visual interface for displaying a table with records that contain raster tile data.   When we select tiles in an image, which we can do interactively with the mouse, we are simply selecting records in the associated table using a different visual interface.  When we make a selection in an image window the selection will also be shown in red selection color and the corresponding records in the drawing's table also will be shown in red selection color.

 

Whether we Ctrl-click tiles in the image with a mouse or Ctrl-click on rows in a table, in both cases we are simply selecting records in a table.  An image window is just a specialized way to display tile data from a table.   Selecting tiles in an image also selects the corresponding records in a table.  Selecting records in a table automatically selects the corresponding tiles in the image.

Example: Select a tile in an image

Using a satellite photo image of the Pentagon as an example, we select a tile in the image.   This is a very small image by Manifold standards, with just a few tiles to show how selection of tiles in images works.

 

 

In the table illustration above we have right-clicked the column header for the Tile field and chosen Style, to change the format for the Tile field from the default format that shows the size of the tile and the number of channels, to a format that reports the size of the tile as well as the data type of each channel and the number of channels.

 

Ctrl-click in an image to select the tile for that location.

 

 

The tile is shown in red selection color and the corresponding record in the table window is also automatically selected and shown in red selection color.    Ctrl-click  at a different location in the image to add that tile to the selection in the image.

 

 

The second tile is also shown in red selection color and the corresponding record in the table window is also automatically selected and shown in red selection color.

Selection vs. SELECT

Important:  Despite the identical "select" word that is used, selection in Manifold is a different notion than the use of SELECT statements within SQL queries.   

 

SELECT and selection have differences:

 

 

SELECT and selection have similarities:

 

 

Although SELECT tends to be the first choice for larger data sets, Manifold selection infrastructure can easily work with the same very large data sets as can Manifold SQL with SELECT.  That capability is normally used in queries and scripts but the capacity for very large numbers of records to participate in selections pops up during interactive use when drawings can show large numbers of objects, and thus involve many records.

 

 

 

Next:  Select Pane Guide