Skip to main content

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)

 

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


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.


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.


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?


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.


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.


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.


Reply