AutoCAD Map 3D 2009 Geospatial Platform Reference

AutoCAD Map 3D Geospatial Platform API

MgFeatureQueryOptions Class Reference
[MgFeatureQueryOptions]

Inherits MgSerializable.

Inherited by MgFeatureAggregateOptions.

List of all members.


Detailed Description

Use this class to set filter criteria for selecting features from a datastore. Read the discussion of filters and expressions . An instance of this class is an argument to MgFeatureService::SelectFeatures(). This is the base class for MgFeatureAggregateOptions.

Public Member Functions

INT32 AddComputedProperty (CREFSTRING aliasName, CREFSTRING expression)
 Define an alias for a computed property and an expression for what is to be computed. In this SQL example, "select min(aDouble + aSingle) as minF, min(anInt16 + anInt16) as minI from featclass;", minF and minI are computed properties. Call this method for each computed property that you add.
INT32 AddFeatureProperty (CREFSTRING propertyName)
 Call this method for each class property whose value you want retrieved by the MgFeatureService::SelectFeatures() call. Not calling this method results in the retrieval of all property values for each feature selected.
 MgFeatureQueryOptions ()
 Constructs an MgFeatureQueryOptions object.
void RemoveComputedProperty (CREFSTRING aliasName)
 Removes a computed property.
void RemoveFeatureProperty (CREFSTRING propertyName)
 Removes a class property.
void SetBinaryOperator (bool andOr)
 Use this method to join a regular filter with a spatial filter An argument of TRUE results in an AND join, and an argument of FALSE results in an OR join. The binary operator applies only when both the SetFilter() and SetSpatialFilter() methods have been called. If both have been called and SetBinaryOperator() has not been called, an AND join is applied.
void SetFilter (CREFSTRING filterText)
 Sets the filter for this select operation. The filter acts like the where clause in an SQL Select statement. Not calling this method causes all instances of the feature class to be selected. For more details on defining filters, see the Filter and Expression documentation.
void SetOrderingFilter (MgStringCollection *orderByProperties, INT32 orderOption)
 Use this method to specify the order (ascending or descending) in which the selected features are returned.
void SetSpatialFilter (CREFSTRING geometryProperty, MgGeometry *geometry, INT32 spatialOperation)
 Use this method to select features whose geometry property satisfies the relationship argument to the geometry argument. The effect is geometryProperty.spatialOperation(geometryArg). By default this filter is joined by the AND operator with the value of the regular filter (see MgFeatureQueryOptions::SetFilter Method ). This filter can also be joined by the OR operator (see MgFeatureQueryOptions::SetBinaryOperator Method ). The syntax for including a spatial expression in a regular filter is described in the topic on filters and expressions .