Select to view content in your preferred language

Geometry: Polygon to a Point.

836
3
10-27-2010 01:16 PM
DanielYim
Emerging Contributor
Hi Everyone,

I am trying to use an IdentifyTask with a given Polygon geometry of a feature. But, as per the API, IdentifyParams' geometry property is most commonly a Point, not a Polygon.

To circumvent this, I have tried using [some Polygon obj].getPoint(0,0); to get a random point, but that is not working, as it results in incorrect identifies.

Does anyone know how I can possibly get an "inner point" of a Polygon? I am beginning to suspect that the getPoint function gives me an edge point, which is too ambiguous for my purposes.
0 Kudos
3 Replies
JohnGrayson
Esri Regular Contributor
You should try to pass in the polygon.  I believe the help says that points are most commonly used, but other geometry types are supported.
0 Kudos
timgogl
Deactivated User
if you have the geometry of the returned poly, could you get the extent from that geometry, then use getCenter() to find the center of the extent?

the only problem i see with this... is some times the point will NOT be inside the poly, say if it is a C shaped polygon.... then the 'center' will be outside the bounds of the polygon.
0 Kudos
DanielYim
Emerging Contributor
Thank you for all the responses. Instead of identifying by the geometry, I opted to just use a QueryTask on the object ID.

Silly me...I didn't think of that earlier!
0 Kudos