Select to view content in your preferred language

Tool(s) for punching hole in polygon and removing space between (donut); for script

415
3
05-01-2023 07:14 AM
TylerT
by
Occasional Contributor III

Greetings,

I have three whole polygons each interior to the next as shown:

TylerT_0-1682949931819.png

Following is my desired output which is two polygons, the largest with a hole, and the smallest unchanged, and the middle sized polygon removed, leaving the annular space void between.

TylerT_1-1682949984165.png

My psuedo code so far is:
1) Union
2) Delete Identical

This gets me to three polygons, but now need to erase the annular polygon.  Any thoughts on how to finish my psuedo code or a better tool/tools to do the job?

Thank you,

Tyler

ArcGIS Pro 3.1

 



0 Kudos
3 Replies
SaraJL
by
Occasional Contributor III

Not sure how to do it with a script! But I would probably just edit the polygon, select the feature, and just manually delete it.

Not necessarily the most glamourous way to do it, but as long as it's considered 3 separate polygons, it's definitely the fastest! If you need an automated script/model, obviously it won't work, but sometimes I find manually deleting is just less hassle than trying to write a code for it. 😁

Good luck on your project!

0 Kudos
TylerT
by
Occasional Contributor III

Yeah, script required, but thanks.  This will be run across tens of thousands of features, so manual is out of the question.  Pseudo code recommendations are fine.  I'll develop the code first with arcpy but ultimately would be better as SEDF (geoaccessor/geometry methods).  

0 Kudos
TylerT
by
Occasional Contributor III

One potential direction would be this pseudo code, knowing that a union on itself generates 3 internal polygons, 2 annular polygons, and one outer polygon:

1) Union
2) Find Identical, count Identical
3) Delete All even count groups
4) Delete Identical odd count groups (Delete Identical tool leaves one polygon)

Seems a little clunky, so still looking for more elegant solutions.

Tyler

0 Kudos