0

I am currently trying to get the center point of a polygon. In GIS, i can see the "x" mark in the center of the polygon, but I do not know how to get it from the IPolygon object.

I tried getting the enevelope and getting the midpoint from that but that didn't work out very well, as getting the envelope does not always ensure to get the midpoitn where marked "x".

Thanks and Regards, Kev

1 Answer 1

3

Are you looking for the centroid?

You could use iArea:Centroid to obtain the centroid of the geometry (may not fall inside of the area if the geometry

Or

you could use iArea:LabelPoint which is similar to centroid but guaranteed to fall inside of the area of the geometry.

However, I am pretty sure that the "X" you are referring to is obtained from the envelope of the geometry. Since iEnvelope does not have a "center" property you may need to calculate it: ((XMin + XMax) / 2, (YMin + YMax) / 2).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.