IArea Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IA > IArea Interface (ArcObjects .NET 10.6 SDK)
ArcObjects Library Reference (Geometry)  

IArea Interface

Provides access to members that return properties common to rings and polygons.

Product Availability

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


Use the IArea interface to get the Area of a Geometry. It can also be used to get the Centroid point and Label point for a Geometry.


Name Description
Read-only property Area The area.
Read-only property Centroid The center of gravity (centroid).
Read-only property LabelPoint A point guaranteed to be inside this area.
Method QueryCentroid Copies the centroid of this area to the specified point.
Method QueryLabelPoint Copies to the input point a point guaranteed to be inside this area.

CoClasses that implement IArea

CoClasses and Classes Description
Envelope A rectangle with sides parallel to a coordinate system defining the extent of another geometry; optionally has min and max measure, height and ID attributes.
MultiPatch A collection of surface patches.
Polygon A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.
Ring An area bounded by one, closed sequence of connected segments; optionally has measure, height and ID attributes at each vertex.
// The example shows how to get the properties for a selected polygon in
// an ArcMap edit session.
public void showPolygonProperties()
    //get editor extension
    UID editorUID=new UIDClass();
    IEditor editor=m_application.FindExtensionByCLSID(editorUID) as IEditor;
    if (editor.SelectionCount != 1)
        System.Windows.Forms.MessageBox.Show("Start Editor and select one polygon");
    IEnumFeature selectedFeatures=editor.EditSelection;
    IPoint centerPoint=new ESRI.ArcGIS.Geometry.Point();
    IPoint labelPoint=new ESRI.ArcGIS.Geometry.Point();
    IFeature feature=selectedFeatures.Next();
    while (feature != null)
        if (feature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
            IArea area=feature.Shape as IArea;
            String message="+++Polygon.IArea properties...\n" +
            "Area=" + area.Area + "\n" +
            "Center.X=" + area.Centroid.X + "\n" +
            "Center.Y=" + area.Centroid.Y + "\n" +
            "LabelPoint.X=" + area.LabelPoint.X + "\n" +
            "LabelPoint.Y=" + area.LabelPoint.Y;
            message=message + "\n" + "+++Polygon.IArea Queries..." + "\n" +
            "Center=" + centerPoint.X + "," + centerPoint.Y + "\n" +
            "Label=" + labelPoint.X + "," + labelPoint.Y;
[Visual Basic .NET]

' The example shows how to get the properties for a selected polygon in
' an ArcMap edit session.

Public Sub t_IArea_polygon()
   Dim pID As New UID
   Dim pEditor As IEditor
   Dim pApp As IApplication
   Set pApp=Application
   Set pEditor=pApp.FindExtensionByCLSID(pID)
   If pEditor.SelectionCount <>  1 Then
     MsgBox "select one polygon"
     Exit Sub
   End If
   Dim pEnumFeat As IEnumFeature
   Dim pFeature As IFeature
   Dim i As Long

   Set pEnumFeat=pEditor.EditSelection

   Dim pArea As IArea
   Dim pCenter As IPoint
   Dim pLabel As IPoint
   Set pCenter=New Point
   Set pLabel=New Point

   Set pFeature=pEnumFeat.Next

   While Not pFeature Is Nothing
     If pFeature.Shape.GeometryType=esriGeometryPolygon Then
       Set pArea=pFeature.Shape
       MsgBox "+++Polygon::IArea properties..." & vbCrLf _
       & "Area=" & pArea.Area & vbCrLf _
       & "Center.X=" & pArea.Centroid.X & vbCrLf _
       & "Center.Y=" & pArea.Centroid.Y & vbCrLf _
       & pArea.LabelPoint.X & vbCrLf _
       & "LabelPoint.Y=" & pArea.LabelPoint.Y

       pArea.QueryCentroid pCenter
       pArea.QueryLabelPoint pLabel
       MsgBox "+++Polygon::IArea Queries..." & vbCrLf _
       & "Center=" & pCenter.X & "," & pCenter.Y & vbCrLf _
       & "Label=" & pLabel.X & "," & pLabel.Y & vbCrLf

     End If
     Set pFeature=pEnumFeat.Next

End Sub

.NET Samples

3D multipatch examples (Code Files: ExtrusionExamples) | Custom map selection commands (Code Files: SelectFeatures) | Tabbed feature inspector (Code Files: TabbedInspector) | Calculate area geoprocessing function tool (Code Files: CalculateAreaFunction) | Move a graphic along a path in ArcMap (Code Files: MapGraphicKeyframe) | Custom subtyped command and tool (Code Files: PolyFeedbackTools) | Tabbed feature inspector (Code Files: ObjectInspector)

.NET Related Topics

Geodatabase API best practices | Server | Transforming envelopes in the display