CÓMO
ArcGIS Pro permite dividir una entidad poligonal en varios segmentos utilizando herramientas como la herramienta Dividir (Análisis) y la herramienta Dividir del panel Modificar entidades. Sin embargo, las herramientas proporcionadas no pueden dividir el polígono por porcentaje. Siga los pasos que se proporcionan en este artículo para dividir un polígono por porcentaje en la ventana de Python.
Note: Ensure the data added to the map and the map share the same projected coordinate system to avoid errors.
Import arcpy
p = arcpy.mp.ArcGISProject("CURRENT")
m = p.listMaps("<Map_Name>")[0]
lyr = m.listLayers(0)
splits = [20, 30, 50]
with arcpy.da.SearchCursor("<Layer_Name>", ["SHAPE@"]) as pcursor:
   for prow in pcursor:
      polygon = prow[0]    # polygon to cut
      e = polygon.extent   # bounding extent of polygon
      print(e.XMin,e.YMin,e.XMax,e.YMax)
del pcursor
stepsize = 0.001
leftXstart = e.XMin leftX = e.XMin + stepsize ymax = e.YMax ymin = e.YMin
cutpoly = polygon
icursor = arcpy.da.InsertCursor("<Layer_Name>", ["SHAPE@"])
for i in splits[:2]:
   print(i)
   tol = 0
   while tol < i:
      # construct NS line
      pntarray = arcpy.Array()
      pntarray.add(arcpy.Point(leftX, ymax))
      pntarray.add(arcpy.Point(leftX, ymin))
      pline = arcpy.Polyline(pntarray,arcpy.SpatialReference(<WKID>))
      # cut polygon and get split-parts
      cutlist = cutpoly.cut(pline)
      tol = 100 * cutlist[1].area / polygon.area
      leftX += stepsize
      #print str(leftX) + ":" + str(tol)
   cutpoly = cutlist[0]
   icursor.insertRow([cutlist[1]])
# part 0 is on the right and part 1 is on the left of the split
icursor.insertRow([cutlist[0]]) del icursor
El código que aparece a continuación muestra todo el script en marcha.
Import arcpy
p = arcpy.mp.ArcGISProject("CURRENT")
m = p.listMaps("Map")[0]
lyr = m.listLayers(0)
splits = [20, 30, 50]
with arcpy.da.SearchCursor("testpolygon", ["SHAPE@"]) as pcursor:
   for prow in pcursor:
      polygon = prow[0]
      e = polygon.extent
      print(e.XMin,e.YMin,e.XMax,e.YMax)
del pcursor
stepsize = 0.001
leftXstart = e.XMin
leftX = e.XMin + stepsize
ymax = e.YMax
ymin = e.YMin
cutpoly = polygon
icursor = arcpy.da.InsertCursor("testpolygon", ["SHAPE@"])
for i in splits[:2]:
   print(i)
   tol = 0
   while tol < i:
      pntarray = arcpy.Array()
      pntarray.add(arcpy.Point(leftX, ymax))
      pntarray.add(arcpy.Point(leftX, ymin))
      pline = arcpy.Polyline(pntarray,arcpy.SpatialReference(3857))
      cutlist = cutpoly.cut(pline)
      tol = 100 * cutlist[1].area / polygon.area
      leftX += stepsize
   cutpoly = cutlist[0]
   icursor.insertRow([cutlist[1]])
icursor.insertRow([cutlist[0]])
del icursor
La siguiente imagen muestra el polígono dividido en un 20%, 30% y 50% después de ejecutar el script de Python en ArcGIS Pro.

Id. de artículo: 000027999
Obtener ayuda de expertos en ArcGIS
Empieza a chatear ahora