Geotools.Net

Polygon.Centroid Method 

Retrieves the centroid of this polygon.

[Visual Basic]
Public Function Centroid() As IPoint
[C#]
public IPoint Centroid();

Return Value

Throws an exception.

Remarks

Will return a point inside or on the polygon boundary. It will first use the average of all the points. If the point falls outside the polygon, the point returned point will be the nearest polygon boundary point from the average point.

This point gets cached.

See Also

Polygon Class | Polygon Members | Geotools.Geometries Namespace