CreateFilterCondition(logicalOperator, argVariant, geoProperty, relation, firstOperand, secondOperand)

Returns the FilterCondition object that represents a simple filter condition for the specified feature type. To specify a filter condition in a filter group, the object (already set up) needs to be added to the FilterGroup::FilterConditions collection. It is impossible to apply this method to a feature type that belongs to a work layer of a theme.

The logicalOperator argument specifies a logical operator defining connection between the simple filter condition and other simple filter conditions in the FilterGroup::FilterCondition collection. The logical operator is specified by one of the constants given in the "Logical Operators" table.

The argVariant argument can specify a field (object Field) of a table or a query from GDB or external database. The value of this field is retrieved from the records connected with the tested feature and then is used while evaluating the simple filter condition. The argVariant argument can also specify a layer (object Layer) or a feature type (object FeatureType) defining a set of argument features used while evaluating the geometric property of tested feature (see the table "Geometric Properties").

If argVariant = Null, it is supposed that the simple condition is based on the geometric property of area, length or on the scale of displaying the tested feature (see the constants gdbGeoPropertyArea, gdbGeoPropertyLength and gdbGeoPropertyScale in the "Geometric Properties" table).

If the argVariant argument specifies a field (object Field), the following objects may be the owners of the field:

A GDB table linked with the specified feature type.

A GDB query built on one or more tables linked with the specified feature type.

An external database table linked with the specified feature type.

A query of external database whose root table linked with the specified feature type.

A cataloged query of external database linked directly with the specified feature type.

If the argVariant argument specifies a layer, the layer must belong to a theme (the Theme::Layers collection) in which the simple filter condition is created. You may use a work layer as the argument. All layer features will be used as argument features while evaluating the geometric property of tested feature (see the table "Geometric Properties") even though there are filter conditions for some feature types in the layer.

If the argVariant argument specifies a feature type, the layer to which the feature type belongs must belong to a theme (the Theme::Layers collection) to which the simple filter condition is created. The feature type may belong to a work layer of the theme. The features of this type will be used as argument features while evaluating the geometric property of tested feature (see the table "Geometric Properties").

You can specify a filter condition for a feature type passed through the argVariant argument. In this case, only the features of this type for which the test result equals gdbFilterResultTrue (see the Theme::FilterTest method) will take part in evaluating the geometric property of tested feature. The filter condition for this feature type must not directly or indirectly refer to the type of the feature being tested (the filter condition must not contain cyclic references).

The geoProperty argument specifies a geometric property by one of the constants given in the "Geometric Properties" table.

The relation argument specifies relation between a value of specified field of the record (records) connected with a tested feature or a value of geometric property and the arguments firstOperand and secondOperand. The relation is defined by one of the constants given in the "Relations in Simple Filter Condition" table.

For fields of tables or queries from external databases, the Field::Searchable property returns a constant that determines if it is possible to use a relation. If the returned value is gdbExtDBSearchableSearchable, such fields can be used in any relation. If the returned value is gdbExtDBSearchableLikeOnly, such fields can be used in any relations of pattern matching. Finally, if the returned value is gdbExtDBSearchableAllExceptLike, such fields can be used in any relations except relations of pattern matching.

For GDB table or GDB queries, relations of pattern matching are only possible for fields of types gdbFieldTypeString, gdbFieldTypeDate, gdbFieldTypeTime, gdbFieldTypeTimestamp and gdbFieldTypeOLEObject (see the "Types of Fields" table).

Relations of comparison and diapason having Min and Max prefixes are only possible for fields of numeric types, fields of date, time, and timestamp (see the "Types of Fields" table).

Relations of comparison and diapason having Sum and Avg prefixes are only possible for fields of numeric types (see the "Types of Fields" table).

For fields of GDB queries with a reference table set to a field, only relations of existence and the following relations of comparison: gdbFilterRelEQ, gdbFilterRelEQEach, gdbFilterRelNE, gdbFilterRelNEEach are possible. Such a restriction is absent for fields of external database queries.

For fields of type gdbFieldTypeOLEObject, the relations gdbFilterRelValue, gdbFilterRelValueEach, gdbFilterRelNoValue, gdbFilterRelNoValueEach check availability or absence of an OLE object in a specified field, not availability or absence of OLE object description.

It is impossible to use relations of existence and of pattern matching for a simple filter condition based on a geometric property.

It is impossible to use relations of existence and of pattern matching with the suffix Count for a simple filter condition based on a geometric property different from the geometric property of placement (the constants gdbGeoPropertyIntersect, gdbGeoPropertyNotIntersect, gdbGeoPropertyInclude, gdbGeoPropertyNotInclude, gdbGeoPropertyContain, gdbGeoPropertyNotContain, gdbGeoPropertyIntersectOrInclude, gdbGeoPropertyNotIntersectAndNotInclude, gdbGeoPropertyIntersectOrContain and gdbGeoPropertyNotIntersectAndNotContain in the "Geometric Properties" table).

For a simple filter condition based on the geometric property of placement (the constants gdbGeoPropertyIntersect, gdbGeoPropertyNotIntersect, gdbGeoPropertyInclude, gdbGeoPropertyNotInclude, gdbGeoPropertyContain, gdbGeoPropertyNotContain, gdbGeoPropertyIntersectOrInclude, gdbGeoPropertyNotIntersectAndNotInclude, gdbGeoPropertyIntersectOrContain and gdbGeoPropertyNotIntersectAndNotContain in the "Geometric Properties" table), only relations gdbFilterRelBoolean, gdbFilterRelBooleanEach and relations of comparison and diapason with the suffix Count are possible.

Using the geometric property of scale in a simple condition for implementing the mechanism of scale zones is not effective. The mechanism of scale zones of a theme is much more effective. Besides, using the geometric property of scale makes sense only while displaying a theme. If the theme is not displayed, the scale is always equal to 0.0.

The firstOperand and secondOperand arguments specify the arguments of relation. The type of arguments of relation must correspond to the type of field. For referenced fields, the value type of the firstOperand argument must correspond to the type of key field in the reference table (not to the type of value field in the reference table!).

The firstOperand and secondOperand arguments must be integer or float if a simple filter condition is based on a geometric property.

The firstOperand and secondOperand arguments are ignored for relations gdbFilterRelBoolean and gdbFilterRelBooleanEach.

The firstOperand and secondOperand arguments are ignored for relations of existence. The secondOperand argument is used in relations of diapason only.

The firstOperand and secondOperand arguments must be integer numbers for relations of comparison and diapason having Count suffix.

The firstOperand and secondOperand arguments must be integer or float in the range from 0.0 to 100.0 for a simple filter condition based on the geometric property of area or length with the Pc suffix (see the "Geometric Properties" table).

For relations of matching, the firstOperand argument is a pattern string. The following wildcard characters are possible in the pattern string:

?

any single character

*

any sequence of zero or more characters (or any value of day, month, year)

For dates, the pattern string is specified in the 'DD/MM/YYYY' format. Fields DD, MM, YYYY must contain digits or wildcard *.

For time, the pattern string is specified in the 'HH:MM:SS' format (24-hour time format). Fields HH, MM, SS must contain digits or wildcard *.

For a timestamp, the pattern string is specified in the 'DD/MM/YYYY HH:MM:SS' format (24-hour time format). Fields DD, MM, YYYY, HH, MM, SS must contain digits or wildcard *.

For fields of the gdbFieldTypeOLEObject type, the pattern string is matched to a description string of an OLE object.