Skip to main content
Solved

Selecting square-ish donuts

  • November 6, 2018
  • 7 replies
  • 21 views

aron
Enthusiast
Forum|alt.badge.img+16
  • Enthusiast
  • 136 replies

I have depth zones where there are some square-ish polygons that once where covered by depth labels. These labels are no longer used and the square areas have become an eyesore. They are not terribly important so I would like to remove them all together. Please note that there are other areas and donut holes that should not be touched.

 

My question is twofold:

* How do I mark only the square-ish areas? (for later deletion)

* How do I mark only the square-ish donut holes? (to be closed with donutbuider)

 

Best answer by ebygomm

How many coordinates do the squares have? Can you identify them by identifying donut holes with less than a certain number of coordinates?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • Best Answer
  • November 6, 2018

How many coordinates do the squares have? Can you identify them by identifying donut holes with less than a certain number of coordinates?


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • November 6, 2018

A square can be identified by the fact that the length of the line (LengthCalculator) is equal to 4 times the square root of the area (AreaCalculator).

This can be evaluated in a Tester transformer.

Hope this helps.


aron
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • 136 replies
  • November 6, 2018

How many coordinates do the squares have? Can you identify them by identifying donut holes with less than a certain number of coordinates?

Thanks! That is a great suggestion. My squares all seem to have four corners. If I narrow them down by area I should be able to get rid of most of them.


aron
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • 136 replies
  • November 6, 2018

A square can be identified by the fact that the length of the line (LengthCalculator) is equal to 4 times the square root of the area (AreaCalculator).

This can be evaluated in a Tester transformer.

Hope this helps.

Thanks! Will this also work for polygons that have four corners but have an irregular shape?


jdh
Contributor
Forum|alt.badge.img+37
  • Contributor
  • 2002 replies
  • November 6, 2018

I would also consider the area of the feature vs it's oriented bounding box. If it were perfectly rectangular, they would be identical, but slightly skewed features should still fall within 95% of the obbArea.


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • November 7, 2018

A square can be identified by the fact that the length of the line (LengthCalculator) is equal to 4 times the square root of the area (AreaCalculator).

This can be evaluated in a Tester transformer.

Hope this helps.

Ha. I did not know that. It would have been very useful when I was making this hub transformer! Thanks for sharing that info. I must try and remember that.


mark2atsafe
Safer
Forum|alt.badge.img+56
  • Safer
  • 2554 replies
  • November 7, 2018

Thanks! Will this also work for polygons that have four corners but have an irregular shape?

I don't think so. You could check if the interior angles add up to 360, which would rule out most non-irregular shapes (a parallelogram might pass). The hub transformer I mentioned below has code to test that. Basically multiply length (LengthCalculator) by angularity (AngularityCalculator) and it should be 360.