Class IFeatureClassExtensions

Namespace
ESRI.Server.SOESupport
Assembly
ESRI.Server.SOESupport.dll

Provides search extensions for ArcObjects feature classes.

public static class IFeatureClassExtensions
Inheritance
IFeatureClassExtensions
Inherited Members

Methods

Search(IFeatureClass)

Return all features in the feature class with the recycling cursor.

public static IEnumerable<IFeature> Search(this IFeatureClass fc)

Parameters

fc IFeatureClass

The feature class to search.

Returns

IEnumerable<IFeature>

A forward-only sequence containing all features.

Remarks

Note that the search is always performed with a recycling cursor meaning that individual IFeature objects should not be referenced after the next object has been returned from the enumerator. The enumerator returned is a forward-only cursor that can only be used once and cannot be reused. Only one iteration via a foreach style loop or LINQ query operator, such as Count(), Where(), etc., is allowed. To reuse the enumerator, you must call the Search() method again. This method automatically releases the cursor after the iteration.

Search(IFeatureClass, string)

Return all features in the feature class matching the given where clause with the recycling cursor.

public static IEnumerable<IFeature> Search(this IFeatureClass fc, string where)

Parameters

fc IFeatureClass

The feature class to search.

where string

The SQL where clause used to filter features.

Returns

IEnumerable<IFeature>

A forward-only sequence containing the matching features.

Remarks

Note that the search is always performed with a recycling cursor meaning that individual IFeature objects should not be referenced after the next object has been returned from the enumerator. The enumerator returned is a forward-only cursor that can only be used once and cannot be reused. Only one iteration via a foreach style loop or LINQ query operator, such as Count(), Where(), etc., is allowed. To reuse the enumerator, you must call the Search() method again. This method automatically releases the cursor after the iteration.

Search(IFeatureClass, string, IGeometry)

Search the Feature Class for features matching the given where-clause and intersecting the given geometry with recycling cursor.

public static IEnumerable<IFeature> Search(this IFeatureClass fc, string where, IGeometry geometry)

Parameters

fc IFeatureClass

The feature class to search.

where string

The SQL where clause used to filter features.

geometry IGeometry

The geometry used to spatially filter features.

Returns

IEnumerable<IFeature>

A forward-only sequence containing the matching features.

Remarks

Note that the search is always performed with a recycling cursor meaning that individual IFeature objects should not be referenced after a new object has been returned from the enumerator. The enumerator returned is a forward-only cursor that can only be used once and cannot be reused. Only one iteration via a foreach style loop or LINQ query operator, such as Count(), Where(), etc., is allowed. To reuse the enumerator, you must call the Search() method again. This method automatically releases the cursor after the iteration.

Search(IFeatureClass, string, IGeometry, esriSpatialRelEnum)

Search the Feature Class for features matching the given where clause and having the given relationship to the input geometry with recycling cursor.

public static IEnumerable<IFeature> Search(this IFeatureClass fc, string where, IGeometry geometry, esriSpatialRelEnum spatialRel)

Parameters

fc IFeatureClass

The feature class to search.

where string

The SQL where clause used to filter features.

geometry IGeometry

The geometry used to spatially filter features.

spatialRel esriSpatialRelEnum

The spatial relationship used by the filter.

Returns

IEnumerable<IFeature>

A forward-only sequence containing the matching features.

Remarks

Note that the search is always performed with a recycling cursor meaning that individual IFeature objects should not be referenced after a new object has been returned from the enumerator. The enumerator returned is a forward-only cursor that can only be used once and cannot be reused. Only one iteration via a foreach style loop or LINQ query operator, such as Count(), Where(), etc., is allowed. To reuse the enumerator, you must call the Search() method again. This method automatically releases the cursor after the iteration.

Search(IFeatureClass, string, IGeometry, esriSpatialRelEnum, bool)

Search the Feature Class for features matching the given where clause and having the given relationship to the input geometry.

public static IEnumerable<IFeature> Search(this IFeatureClass fc, string where, IGeometry geometry, esriSpatialRelEnum spatialRel, bool recycling)

Parameters

fc IFeatureClass

The feature class to search.

where string

The SQL where clause used to filter features.

geometry IGeometry

The geometry used to spatially filter features.

spatialRel esriSpatialRelEnum

The spatial relationship used by the filter.

recycling bool

See IFeatureClass.Search for the usage of the recycling parameter.

Returns

IEnumerable<IFeature>

A forward-only sequence containing the matching features.

Remarks

The enumerator returned is a forward-only cursor that can only be used once and cannot be reused. Only one iteration via a foreach style loop or LINQ query operator, such as Count(), Where(), etc., is allowed. To reuse the enumerator, you must call the Search() method again. This method automatically releases the cursor after the iteration.

Search(IFeatureClass, string, bool)

Return all features in the feature class matching the given where clause. Recycling behavior can also be controlled.

public static IEnumerable<IFeature> Search(this IFeatureClass fc, string where, bool recycling)

Parameters

fc IFeatureClass

The feature class to search.

where string

The SQL where clause used to filter features.

recycling bool

See IFeatureClass.Search for the usage of the recycling parameter.

Returns

IEnumerable<IFeature>

A forward-only sequence containing the matching features.

Remarks

The enumerator returned is a forward-only cursor that can only be used once and cannot be reused. Only one iteration via a foreach style loop or LINQ query operator, such as Count(), Where(), etc., is allowed. To reuse the enumerator, you must call the Search() method again. This method automatically releases the cursor after the iteration.