ArcGIS Developer Help  (GeoDatabase)    

IFeatureClass.GetFeature Method

Get the feature with the specified object ID.

[Visual Basic 6.0]
Function GetFeature(
    ByVal ID As Long _
) As IFeature
[Visual Basic .NET]
Public Function GetFeature ( _
    ByVal ID As Integer _
) As IFeature
[C#]
public IFeature GetFeature (
    int ID
);
[Java]
public IFeature getFeature (
    int ID
)
throws
    IOException,
    AutomationException
[C++]
HRESULT GetFeature(
  long ID,
  IFeature** Feature
);
[C++]

Parameters

ID [in]

  ID is a parameter of type long

Feature [out, retval]

  Feature is a parameter of type IFeature

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

GetFeature will return the IFeature interface for a feature in the feature class with a given Object ID (OID). This method is typically used to find a particular feature that you know the OID for.  Use a cursor if you wish to loop through all features in the feature class.

Calling the GetFeature method on a feature class (via the IFeatureClass interface on the feature class) has the same effect as calling the GetRow method on the FeatureClass (via the ITable interface on the feature class) except that the IFeatureClass methods return IFeature interfaces.
 

See Also

IFeatureClass Interface | IEnumRow Interface | IFeatureCursor Interface | IFeature Interface

Example

GetFeature Example

 


Feedback Send feedback on this page