ArcGIS Enterprise SDK
IArea.QueryCentroid Method
ArcGIS Developer Help

IArea.QueryCentroid Method

Copies the centroid of this area to the specified point.

[Visual Basic .NET]
Public Sub QueryCentroid ( _
    ByVal Center As IPoint _
public void QueryCentroid (
    IPoint Center


Queries the Centroid of the 2 (or 2.5) Dimensional figure.  The Centroid is the center of the weighted area. You must instantiate the Point before calling QueryCentroid. For example,

Dim pPoint as IPoint
Set pPoint = New Point


The Centroid does not always occur inside the Area of the geometry.  The Centroid is not the same as the center of the geometry or the Envelope binding the geometry (but it may be if and only if that is also the center of the weighted area).

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.


Centroid Example

See Also

IArea Interface