Skip to main content
Solved

Exlude areas from DonutHoleExtractor?


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

I have a dataset with various depth zones that I am trying to process by running a DonutHoleExtractor, then removing some of the polygons that I don’t want based on certain rules and lastly rebuilding it all with a DonutBuilder. This works fine for the depth zones but some of the areas that are land, white in the maps below, get turned into depth zones. This is not surprising, but I would like to find a workaround. I looked at using the holes from the DHExtractor to punch holes in the last step, but the ”land holes” get the attribute data from their surrounding depth zone, so I have not found a way to single them out.

 

 

Any ideas to how exlude certain areas when extracting donuts? Or maybe you have a better idea for a workaround?

 

 

Please note that this is a follow up question to, https://knowledge.safe.com/questions/81896/selecting-square-ish-donuts.html

 

 

The brown map is the original data and the green one is after DonutHoleExtractor

Best answer by takashi

I think once you merged the original features into a single donut feature with the Dissolver, then you could extract only "land holes" with the DonutHoleExtractor.

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

6 replies

takashi
Evangelist
  • Best Answer
  • November 7, 2018

I think once you merged the original features into a single donut feature with the Dissolver, then you could extract only "land holes" with the DonutHoleExtractor.


aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • November 8, 2018
takashi wrote:

I think once you merged the original features into a single donut feature with the Dissolver, then you could extract only "land holes" with the DonutHoleExtractor.

Hi @takashi,

Thanks! Your method does the job of finding the "land holes". Unfortunatly I can't seem to get the results I want when adding these new "holes" to the final DonutBuider. It punches out more than I want. I tried doing it in two steps but then I got even stranger results. Is there some way to select what data to punch out? I am guessing it could be done by grouping? If so, how is it done? Or is there an other way?


takashi
Evangelist
  • November 8, 2018
takashi wrote:

I think once you merged the original features into a single donut feature with the Dissolver, then you could extract only "land holes" with the DonutHoleExtractor.

If I understood your requirement correctly, this workflow would generate your desired result.

  1. Extract outer shells from all the original donut features with the DonutHoleExtractor.
  2. Remove some of them based on certain rules.
  3. Re-build donuts from the remaining polygons with the DonutBuilder (Drop Holes: No).
  4. Count the number of holes for each feature with the HoleCounter.
  5. Send features with no holes and the "land holes" (created on another data flow with the method I suggested above) to another DonutBuilder (Drop Holes: Yes).

aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • November 9, 2018
takashi wrote:

If I understood your requirement correctly, this workflow would generate your desired result.

  1. Extract outer shells from all the original donut features with the DonutHoleExtractor.
  2. Remove some of them based on certain rules.
  3. Re-build donuts from the remaining polygons with the DonutBuilder (Drop Holes: No).
  4. Count the number of holes for each feature with the HoleCounter.
  5. Send features with no holes and the "land holes" (created on another data flow with the method I suggested above) to another DonutBuilder (Drop Holes: Yes).

Thanks! That will do the job!


aron
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • November 22, 2018

Hi @takashi,

 

I have unfortunately not been able to get this to work. The problem is that some of the areas that have holes need another punch-out from the "land holes". So it does not work by filtering out areas with no holes. I am sure there is some clever workaround, but I have not been able to figure it out. Any ideas to how I could get it to work?

I attached my Workbench and some example data for anyone interested in seeing where it goes wrong.

Depth zones.zip

 


takashi
Evangelist
  • November 22, 2018
aron wrote:

Hi @takashi,

 

I have unfortunately not been able to get this to work. The problem is that some of the areas that have holes need another punch-out from the "land holes". So it does not work by filtering out areas with no holes. I am sure there is some clever workaround, but I have not been able to figure it out. Any ideas to how I could get it to work?

I attached my Workbench and some example data for anyone interested in seeing where it goes wrong.

Depth zones.zip

 

There are small polygons whose number of coordinates is 5 or less. Most of them are holes of donuts, but some of them are independent polygons overlapped other large one. If the requirement was to remove all the small polygons from the dataset, this workflow might work for you.


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