Corner point coordinates of polygon

4535
8
05-17-2011 03:08 AM
AysberqTundra
Occasional Contributor
I have a layer, which consisting of several square polygons. I want to create an ArcEngine application, which displays corner points coordinates of selected polygon. Can anyone help me?
0 Kudos
8 Replies
UjjwalNigam
New Contributor III
Hi,
Are you stuck with the selection part or the corner point part of the problem?

In case of the corner points, get the envelope of the selected feature.
Once you have the envelope, you can directly get the Lower Left & Upper Right co-ordinates.

Cheers!
0 Kudos
AysberqTundra
Occasional Contributor
Thanks for your reply. I will try this.
0 Kudos
AysberqTundra
Occasional Contributor
Thanks you, Nigam. It really was a good idea.
I tried this and find coordinates. Is there any way to display these coordinates over the points?
0 Kudos
UjjwalNigam
New Contributor III
When you say "display", do you mean like labels?
Do you just want to show them as text just above the points, or is it okay with you to highlight the corner points by some overlapping, different colored points?
0 Kudos
RuchiraWelikala
Occasional Contributor
The envelope method only works if the selected polygons are perfectly square and have its sides parallel to the x and y axes right?
0 Kudos
UjjwalNigam
New Contributor III
The envelope method only works if the selected polygons are perfectly square and have its sides parallel to the x and y axes right?


The envelope method works irrespective of the shape of your polygons...
0 Kudos
NeilClemmons
Regular Contributor III
The envelope method works irrespective of the shape of your polygons...


This is not true.  The OP wants the corner coordinates of square/rectangular polygons.  Unless those polygons are exactly oriented to the x, y axes using the Envelope method will not return the corner vertex coordinates of that polygon.  It will return the coordinates of the envelope that encompasses the polygon.  See the examples in the developer help topic for IGeometry.Envelope.  To get the coordinates of the vertices that make up the polygon, use the IPointCollection interface.
0 Kudos
AysberqTundra
Occasional Contributor
Nigam, I find coordinates. And now I want that, when I select any polygon, it's corner coordinates shown (as label or ...) over the corner points, and when I select another polygon cleared previous labels and shown next labels. (I can't speak in english well, so sorry for my grammatical mistakes).
0 Kudos