CARIS : Commands : Filter
 

Filter

 

Menu

Select > By Filter > Attribute Value

Pop-up

feature layer > Add Layer(s) > Filter

The Filter dialog box is used by various commands to either create a new filtered layer or perform a selection based on a user-specified filter expression. The filter expression is generated based on the feature object types and attributes present in the active data source. When creating a new layer, only data found in the input dataset that meets the filter criteria will be displayed. When performing a selection, data found in the input dataset that meets the filter criteria will be selected.

The filter functionality can be used with data in several vector formats, such as Shapefiles, GML, GeoPackage, AutoCAD and CARIS DES. It also works with database object layers. It is not currently compatible with HOB and S-57 ENC data.

The dialog box can be launched from any of the following locations:

the Add Layers command in the context menu of the Layers window

the Add Layer command in the context menu of the Project window

Filter property in the properties window when a supported data format is selected in the Layers window.

the Select > By Filter > Attribute Value command

If the command is launched from a layer that contains multiple feature types, the Select Feature Types dialog box will be displayed prior to the Filter dialog box being launched.

This dialog box is used to select the feature types to include in the filter. This setting can be changed in the Filter dialog box if needed.

If the layer contains multiple feature types, but it was created from a previous filter, the application will read this layer as having only a single feature type and the Select Feature Types dialog box will not be launched.

Option

Description

Search Feature Types

Type a search term or phrase to search for a specific feature type. The list of feature types will be limited to only those that match the search term. Click the X button to clear the search term and display the full list.

feature icons

Filter the list of feature types based on the feature format. The options are: all features, points, lines or areas. Only the features of the selected format will be displayed in the list.

feature type list

All available feature types in the selected layer. Click the check box of each feature type to include in the filter expression.

Related commands:

Classification

Style

Interface

The Filter command uses the following dialog box.

Option

Description

Graphical/Advanced

The method in which to build and view the filter expression.

In the Graphical tab, different panes are provided to select attributes, define properties for the attributes and graphically build the filter expression.

In the Advanced tab, the filter expression is manually typed into the expression field, with auto-complete options provided based on feature types in the data source.

When an expression is being built, it can be viewed and edited in either of the tabs; only a single filter is created regardless of which tab is used. As changes are implemented in one tab, the expression is also updated with the same changes in the alternate tab.

1. Select the relevant tab to view the available fields and complete the filter expression.

Save As

Save the current filter expression as a .filter file for future use.

1. Click the Save As button.

2. Specify a name and location for the file.

3. Click Save.

Load

Load a previously saved .filter file to edit and/or apply the filter expression to the current source data. The drop-down list beside the button provides a list of recently used .filter files.

1. Select an option from the drop-down list or click the Load button and navigate to an existing file.

2. Alter the expression as needed and/or click OK to apply it.

Graphical

Feature Types

The feature types to include in the filtered layer. This list is populated with all feature object acronyms present in the catalogue of the source data.

1. Expand the drop-down list.

2. Click to populate the check box of each feature type to be included.

Attributes

The Attributes list is automatically populated with attributes based on the selected feature object types. This list determines the attributes that can be used to build the filter expression. If multiple feature types are selected, only attributes that are common to all selected types will be provided in the list.

If the list of attributes is extensive, the Search Attributes field can be used to limit the attributes displayed. As text is entered into the field, the list will be reduced to include only the attributes that match the search term. Clicking the X button will clear the search and display the full list.

In addition to attributes, there is a set of Functions that is used to determine how the filter expression is applied to the source data. Some of the functions available are:

BBOX: This function applies the filtering to all data relative to a set of coordinate extents.

NOT: This function applies the filtering to all data that does not meet the specified criteria.

ID: This function applies filtering to all data with a specified feature object IDs.

Expression map

This field is used to view and build an expression map, which is a graphical representation of the filter expression. To add items to the filter expression, you can either double-click an item in the Attributes list, or click and drag an item from the list to the Expression map area. A bubble is added to the map for each item selected. As multiple items are added, operators are automatically added between each of the bubbles and additional bubbles are added to encompass the entire expression. If an item is double-clicked, it is automatically added to the end of the expression. If it is added through click-and-drag, it can be dropped in any position in the filter expression.

Properties

The properties for the currently selected attribute or operator bubble in the Expression map. These properties are used to define the attribute values to use for the filter expression. The properties are displayed by clicking a bubble in the Expression map area. For each bubble, you must select the operator and manually enter the value to use when filtering.

Advanced

Feature Types

The feature types to include in the filter. The list available types is populated with all feature types present in the layer that was active when the command was initiated. If the list is large, it can be filtered using either the Search Feature Types field or the feature type buttons.

If features types were selected in the Select Feature Types dialog box, the feature types in this list will already be selected. This can be changed if needed.

1. Enter a search term in the Search Feature Types field to display only the feature types that match the entered text.

2. Click the relevant feature type button to display only the feature types of that format.

3. Click the check box of each filter type to include in the filter expression.

Expression statement

This field is used to view and build an expression statement, which is a textual representation of the filter expression. When you click in the statement area, drop-down lists are displayed with auto-complete options for function, attributes and operators based on the feature types selected. Only the attributes that are common to all selected feature types will be available. As the expression is built, the options in the list will change to reflect the current state of the expression and the location of the cursor in the statement. Text can also be entered manually wherever the cursor is placed within the Expression statement.

Validation is performed on the syntax of the expression as it is built. If the Expression statement has a red border around the field, there is an error in the syntax; If the border is green, the expression is valid.

Procedure

1. Select a vector data layer in the Layers window.

2. Right-click the layer and select the Filter command.

3. If the Select Feature Types dialog box is displayed, select the desired feature types.

4. Select the Graphical tab or the Advanced tab.

5. Select the Feature Types to include in the filter if not already selected.

6. Build the filter expression by either:

adding attributes to the Expression map and defining their values using the Properties box, or

selecting options from the auto-complete lists and typing values for the selected options.

7. [Optional] Click Save As to save the filter expression to a .filter file for future use.

8. Click OK.

A new layer is added to the Layers window, named according to the filter applied. The layer can be renamed if needed. See Layers Window for more information. If needed, the filter can be altered by selecting the filtered layer and then selecting the Filter command again. When the Filter dialog box is displayed, it will be populated with the expression that was used to create the filtered layer.