1

I have a user-created graphics layer that might have lines, polygons and circles on it. When the user clicks to edit one of the graphics, I would like to be able to identify whether they have clicked on a circle or a polygon but the geometry.type for both of these is "esriGeometryPolygon".

Is there a straightforward way to tell the difference?

  • Are they true circles or are they estimated (ie. using 32, 64, 128, etc. points centered around a center). Most basic geometry storage will estimate curves like that, so they are polygons in that case. You may have a look at the number of points if you can. – Evil Genius Sep 3 '15 at 10:55
  • No, they aren't true circles, they have been created by the drawTool. I thought maybe I could check whether each vertex was the same distance from the centre of the polygon but when I do that, they are coming up with a variance of 1-3 metres so that is not going to work. – wedwobin Sep 3 '15 at 10:59
0

The drawTool has a circle function so you can use that & simply add some attribute declaring its a circle vs polygon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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