Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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