I am using ArcGIS Desktop 10.6, basic license, Spatial Analyst, python 2.6, 2019 AD.
I have a polygon feature class with representing a lake, with multiple features overlapping (all in the same feature class). The shoreline feature covers the entire area of the lake, the 1 foot depth feature covers all of the area at 1 foot, etc, etc. Opening an editing session and starting at the deepest depth, I can use the Editor toolbar Clip function to clip each area from the others. The end result is a flat representation of the lake, no overlapping depths.
To accomplish this with arcpy, I think I need to sort my list descending from the largest depth and clip the below features. I've attached a sample feature class that this script would intake, and another ("flat") that should be output.
import arcpy from arcpy import env try: # Set workspace environment env.workspace = "C:/data/default.gdb" # intake lake in_dataset = arcpy.GetParameterAsText(0) # sort the lake attribute table by the depth sort_fields = ["depth", "DESCENDING"] # Use Peano algorithm sort_method = "PEANO" # sort the fc, run Editor Clip on each attribute, starting with the largest arcpy.Sort_management(in_dataset, sort_fields, sort_method) with arcpy.da.SearchCursor(in_dataset, 'SHAPE@') as cursor: for row in cursor: #don't know how to call this part EditorClipTool(row, "DISCARD") print arcpy.GetMessages() except arcpy.ExecuteError: # Print error messages print arcpy.GetMessages(2) except Exception as ex: print ex.args