MapWinGIS.Point CentroidOfPart(MapWinGIS.Shape polygon, int PartIndex)
This function will calculate the centroid for a specific part of
Mapwinshape. If the shape has only one part, the integer value
PartIndex will be ignored, and the centroid for the entire shape
will be calculated.
|polygon||MapWinGIS.Shape of type
POLYGON/POLYGONZ/POLYGONM to obtain the centroid of or containing
the specific part to obtain the centroid of.
|PartIndex||The integer index value of the part in
polygon to find the centroid of. This value will be ignored if
there is only one part in the polygon, and teh centroid for the
entire shape will be returned.
A MapWinGIS.Point representing the position of the
two dimensional centroid of the part of polygon specified by
Initially authored by Ted Dunsford on 6/23/2006
Derived from Angela's algorithm, but heavily modified
Visual Basic Net 2005 Example
Visual C# 2005 Example Implementation Code
Back to Utils