Automate Splitting Polygons Into Sections

Here is a method using arcpy geometry objects. The script creates a rotated hull rectangle around each polygon, splits it into plots, and clips the plots to the original polygon. As Aaron mentions, you could likely achieve this with the fishnet tool, but I could not figure out how to (in Step #2) "use logic to find the ordinal coords" for rotated polygons.

The script:

# import libraries
import arcpy

# set input/output parameters
polyFC = arcpy.GetParameterAsText(0)        # input polygons
# standalone: polyFC = r'C:/somefolder/someshapefile.shp'
outSections = arcpy.GetParameterAsText(1)   # output section polygons
# standalone: outSections = r'C:/somefolder/someshapefile.shp'

# establish spatial reference
desc = arcpy.Describe(polyFC)
SR = desc.spatialReference

# lines container
Lines = []

for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"]):
    # create hull rectangle to establish a rotated area of interest
    coordSplit = row[0].hullRectangle.split(' ')

    # collect corner coordinates
    coordList = arcpy.Array([arcpy.Point(coordSplit[0],coordSplit[1]),arcpy.Point(coordSplit[2],coordSplit[3]),arcpy.Point(coordSplit[4],coordSplit[5]),arcpy.Point(coordSplit[6],coordSplit[7]),arcpy.Point(coordSplit[0],coordSplit[1])])

    # create lines from hull rectangle
    currentLines = []
    for pointNum in range(0,4):
        arcpy.Array([coordList.getObject(pointNum),coordList.getObject(pointNum+1)])
        hullRecLine = arcpy.Polyline(arcpy.Array([coordList.getObject(pointNum),coordList.getObject(pointNum+1)]))
        currentLines.append(hullRecLine)

    # compare first and second line to determine if first line is short or long
    firstLong = 0
    if currentLines[0].length > currentLines[1].length:
        firstLong = 1

    # determine how far apart to split lines
    longLineSpace = currentLines[firstLong].length/4
    shortLineSpace = currentLines[firstLong + 1].length/2

    # join points to create parallel lines
    for point in range(1,4):
        longPoint1 = currentLines[firstLong].positionAlongLine(longLineSpace*point)
        longPoint2 = currentLines[firstLong + 2].positionAlongLine(currentLines[firstLong + 2].length - (longLineSpace*point))
        longLine = arcpy.Polyline(arcpy.Array([longPoint1.centroid,longPoint2.centroid]), SR)

        # clip lines to original polygon
        longLineClip = longLine.intersect(row[0],2)
        # add to array
        Lines.append(longLineClip)

    shortPoint1 = currentLines[firstLong + 1].positionAlongLine(shortLineSpace)
    shortPoint2 = currentLines[firstLong - 1].positionAlongLine(currentLines[firstLong - 1].length - (shortLineSpace))
    shortLine = arcpy.Polyline(arcpy.Array([shortPoint1.centroid,shortPoint2.centroid]), SR)

    # clip to original polygon
    shortLineClip = shortLine.intersect(row[0],2)
    # add to array
    Lines.append(shortLineClip)

# write geometries to disk
arcpy.CopyFeatures_management(Lines, outSections)

# add to map
mxd = arcpy.mapping.MapDocument("CURRENT")
dataFrame = arcpy.mapping.ListDataFrames(mxd, "*")[0]
addLayer = arcpy.mapping.Layer(outSections)
arcpy.mapping.AddLayer(dataFrame, addLayer)

del row

And the output: enter image description here


You could automate this approach with Python using the Create Fishnet (Data Management) tool. You can extract all of the pieces of the puzzle to do this analysis with python and then simply plug the pieces into the fishnet function. You need to start by iterating over all of the section polygons. Otherwise, you will get one large fishnet covering the entire sections extent.

  1. Use a SearchCursor with a SHAPE@XY token to iterate over the section polygons and get at the specific section vertices
  2. Use logic to find the ordinal coords. For example, nw_coord = max(y) AND min(x) etc
  3. Use SW coord to define origin
  4. Use NW coord to define y_axis_coord
  5. Use SE coord to define the corner_coord parameter
  6. Set number_rows to 4 and number_columns to 2
  7. Merge all of the newly created fishnet polygons
  8. Clip the merged fishnet polygons with the section boundaries