I have an irregular polygon feature that I need to split into x number of equal area features. I need to be able to have the divisions be something other than north/south or east/west.
Example:
The black polygon in this case needs to be divided into 3 equal area polygons. I manually split these, but I need it to be more precise and the splits need to be aligned in parallel to each other. They need to be able to be calculated with an angle/rotation specification, and not just north/south or east/west.
What I have tried:
It really blows my mind that this isn't a tool that exists/is readily available.
Any advice/suggestions is welcomed. Or, if you really want to be a super hero, edit the code so I can specify an angle for rotation. Thank you very much!
Solved! Go to Solution.
for the hero that wants to take it on, it is far easier to rotate polygon by the desired rotation angle, proceed with Alex's implementation, then rotate result back.
This will work with projected coordinates. Take the polygon, subtract the centroid value from the polygon points (ie a translation to the origin). Rotate by your desired angle (rotation). Do the work (rotate the reverse) and translate back to the original location.
for the hero that wants to take it on, it is far easier to rotate polygon by the desired rotation angle, proceed with Alex's implementation, then rotate result back.
This will work with projected coordinates. Take the polygon, subtract the centroid value from the polygon points (ie a translation to the origin). Rotate by your desired angle (rotation). Do the work (rotate the reverse) and translate back to the original location.
Thank you so much, Dan!
I don't know why it didn't occur to me to manually rotate it, run the tool, and then rotate it back. That works perfectly. You're the hero I needed but not the one I deserved.
I'd stick to editing Alex Tereshenko's code.
The main thing to edit is the template line coordinates used for cutting the polygons:
pnt_arr.add(arcpy.Point(x_min, y_max)) # top left
pnt_arr.add(arcpy.Point(x_min, y_min)) # bottom left
Suppose you want a cut line 45 degrees from NW to SE. You'd change the coordinates to:
x_diff = math.tan(math.radians(45)) * (y_max - y_min)
pnt_arr.add(arcpy.Point(x_min - x_diff, y_max))
pnt_arr.add(arcpy.Point(x_min, y_min))
... then keep trying cutting as you go right. Like picture below (maybe makes it more confusing...).
Unfortunately, I don't believe there's any way to avoid coding on this one. You'd also have to do some extra coding to accommodate all possible line angles.
The picture does indeed make it better! Thanks for your thinking on this. I'll play around editing the code with this soon!
For anybody who runs across this thread and is looking for this functionality, please see Split irregular polygons into equal parts, add your vote and any specific user requirements in the comments.
This idea is Under Consideration for inclusion as a geoprocessing tool in ArcGIS Pro.
This is great to know! Thanks, Kory. Definitely looking forward to having this integrated.
ArcGIS Pro now has this tool to divide polygons into equal areas: