I would like to delineate the edge of my extraction below, not by hand, just automatically. I want to eliminate the inside polygons and keep the outermost edge only (highlighted by blue, not accurately). Could anyone give me some hints on this part? Thank you in advance!
Thanks a lot!!! That works!
Generating a polygon from the outer ring of the polygon with holes also gets you want you want. If you want to use ArcPy and cursors, the following should work:
>>> from itertools import takewhile >>> >>> fc = # path to feature class containing polygons with holes >>> with arcpy.da.UpdateCursor(fc, "SHAPE@") as cur: ... for polygon, in cur: ... SR = polygon.spatialReference ... polygon = arcpy.Polygon( ... arcpy.Array( ... (pt for pt in takewhile(bool,part)) ... for part ... in polygon.getPart() ... ), SR ... ) ... cur.updateRow([polygon]) ... >>>
It may seem odd on Line 09 to have a generator expression that simply returns an item for each item in the iterable returned by takewhile, but this is necessary because arcpy.Array is very picky about the type of iterable it will process.
Cool! I will try! Thanks a lot!