Skip to main content
Solved

Selecting square-ish donuts


aron
Supporter
Forum|alt.badge.img+16
  • Supporter

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?

View original
Did this help you find an answer to your question?

7 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • 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+18
  • Contributor
  • 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
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • November 6, 2018
ebygomm wrote:

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
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • November 6, 2018
erik_jan wrote:

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+28
  • Contributor
  • 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+45
  • Safer
  • November 7, 2018
erik_jan wrote:

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+45
  • Safer
  • November 7, 2018
aron wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings