The filter tab is very useful to isolate or exclude certain entities from your map.
The Filter tab allows you to display only certain features from a map file rather than all of the features.
- Definition,
- RegEx Filter,
WARNING - The Filter tab of the Layer properties is ONLY available while using some local geographic layers
Definition
This is the Filter tab:
Filter Property
Enabled: When enabled, the filter will be applied to the map file. The icon representing the type of map layer in the layer control will change to indicate a filter is applied.
Icon | Description |
Point layer with filter | |
Polyline layer with filter | |
Polygon layer with filter |
String Comparison Rules
The filter column value is compared character by character to the user entered value until either all characters are determined to be identical, or a difference is found, using the following rules:
- Space < Everything
- A < B, a < b
- Uppercase < Lowercase
- Number < Alphabet
Be careful comparing numeric values this way. Because each number is compared one digit at a time, the result can be counter-intuitive. For example, “80” is greater than “1000” because the first digit comparison sets the result for the whole comparison. If you need to do numeric comparisons outside of EQUAL, use expression filters.
Simple Filter
The Simple Filter compares a feature's value to a string value.
Simple Filter Properties
Filter Column: Selects the data column in the source file that will be used in the filter.
Operation: Selects the operator that will be used in the comparison between the feature's value and the user-entered value. If the comparison returns TRUE, then the feature will be displayed.
Operation | Description |
Equals | Does an exact, case-sensitive match to determine if the feature's value is identical to the user-entered value. |
Not Equal To | Does an exact, case-sensitive match to determine if the feature's value is not equal to the user-entered value. |
Less Than | Applies the String Comparison Rules to determine if the feature's value is less than the user-entered value. |
Greater Than | Applies the String Comparison Rules to determine if the feature's value is greater than the user-entered value. |
Less Than and Equal To | Applies the String Comparison Rules to determine if the feature's value is less than or equal to the user-entered value. |
Greater Than and Equal To | Applies the String Comparison Rules to determine if the feature's value is greater than or equal to the user-entered value. |
In Set Of | Does an exact case-sensitive match to determine if the feature's value is in any number of comma-separated strings in the user-entered value. Note: Do not add extra spaces. |
Not in Set Of | Does an exact case-sensitive match to determine if the attribute is NOT in any number of comma-separated strings in the value. Note: do not add extra spaces. |
Value: Sets the string value that will be compared to the feature's value.
RegEx Filter
The RegEx Filter matches a feature's value with a regular expression.
RegEx Filter Properties
Filter Column: Selects the data column in the source file that will be used in the filter.
RegEx: Sets the regular expression to match against the feature's value.
Regular Expression (RegEx)
A regular expression provides a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. It is often more concise to specify a set's members by such an expression than by a list.
Symbol | Description | Example |
. | Matches any single character. | a.c matches "ABC" |
[] | Matches a single character that is contained within the brackets. | [abc] matches "a", "b", or "c" |
[-] | Specifies a range that matches any lowercase letter from a letter to another letter. | [a-c] matches "a", "b" or"c" |
[^] | Matches a single character that is not contained within the brackets. | [^abc] matches any character other than "a", "b", or "c" |
^ | Outside square brackets, matches only at the beginning of the string. | ^abc will find "abcdef" but not "xyzabc" |
$ | Matches only at the end of the string. | $abc will find "xyzabc" but not "abcdef" |
* | Matches the preceding element zero or more times. | ab*c matches "ac", "abc", "abbbc", etc. |
More information on additional RegEx options can be found on the Web. As a good start, we recommend --> http://en.wikipedia.org/wiki/Regular_expression.
Expression Filter
Expression Filter Properties
Expression: The expression to evaluate for each feature.
Expression
An expression has two values and an operator that determines the type of comparison. Expressions can be enclosed in parentheses and then combined with AND, OR and NOT operators.
Example: ("[Entity_Type_EN]" eq "Provincial Capital") AND ([Class] = 4)
String Expression
In the example "[Entity_Type_EN]" eq "Provincial Capital":
- "[Entity_Type_EN]": The value enclosed within square brackets inside double quotes references a data column name.
- "Provincial Capital": The value enclosed in double quotes references a feature's value.
Operator | Description |
+ | Adds two strings together to form one string. This does not result in a TRUE/FALSE value but can be used to create composite strings for use in a string expression |
= | Does an exact, case-sensitive match to determine if the first string is identical to the second string. |
=* | Does an exact, case insensitive match to determine if the first string is not equal to the second string. |
!= | Does an exact, case-sensitive match to determine if the first string is not equal to the second string. |
< | Applies the String Comparison Rules to determine if the first string is less than the second string. |
> | Applies the String Comparison Rules to determine if the first string is greater than the second string. |
<= | Applies the String Comparison Rules to determine if the first string is less than or equal to the second string. |
>= | Applies the String Comparison Rules to determine if the first string is greater than or equal to the second string. |
IN | Does an exact case-sensitive match to determine if the value is in any number of comma-separated strings. Note: Do not add extra spaces |
~ | Returns TRUE when the first string matches the expression contained in the second string. |
~* | Returns TRUE when the first string matches the expression contained in the second string and the comparison is case insensitive. |
Numeric Expression
In the example [Class] = 4:
- [Class]: The values enclosed within square brackets reference a data column name.
Operator | Description |
= | Determines if the feature's value equals the number. |
!= | Determines if the feature's value is not equal to the number. |
< | Determines if the feature's value is less than the number. |
> | Determines if the feature's value is greater than the number. |
<= | Determines if the feature's value is less than or equal to the number. |
>= | Determines if the feature's value is greater than or equal to the number |
IN | Determines if the feature's value is in any number of comma-separated values. Note: Do not add extra spaces. |
The following operations can be performed with numbers. They do not return a TRUE/FALSE value but can be used to create a number for use in a numeric expression.
Operator | Description |
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
^ | Exponentiation |