# Splitting polygon into two equal parts from specific point to polygon dividing line?

I want to split a polygon into two equal parts but I want from a specific point to the polygon dividing line.

How to do this using ArcGIS Desktop 10?

• This is a nice task for scripting. Are you open for this approach? – FelixIP May 2 '16 at 0:17
• I think you should include a picture in your question. – PolyGeo May 2 '16 at 1:07

For that you need to

• find another point on the polygon outline (with reasonable accuracy, that is set to 0.01 m in below script)
• connect 2 points by line
• split polygon using this line

INPUT: OUTPUT: To make script below work, you’ll need to put three layers listed from the top down in your mxd table of content:

• empty polygon layer to store splitted parts
• point layer with single point
• source polygon layer

Note: Point has to be snapped to or sit outside of polygon boundary

``````import arcpy, traceback, os, sys
gr=(math.sqrt(5)-1)/2

try:
def showPyMessage():
arcpy.AddMessage(str(time.ctime()) + " - " + message)
#golden section to find minimum
def gss(a,b,tol):
c=b-gr*(b-a)
d=a+gr*(b-a)
fc=f(c);fd=f(d)
while abs(c-d)>tol:
if fc<fd:
b,d,fd=d,c,fc
c=b-gr*(b-a)
fc=f(c)
else:
a,c,fc=c,d,fd
d=a+gr*(b-a)
fd=f(d)
return (b+a)/2
def f(z):
global two
theP=outline.positionAlongLine (z).firstPoint
splitter=arcpy.Polyline(arcpy.Array([point,theP]),SR)
two=pgon.cut(splitter)
intR=abs(two.area-two.area)/pgon.area*100
return intR

mxd = arcpy.mapping.MapDocument("CURRENT")
layers = arcpy.mapping.ListLayers(mxd)
(outputLR,pointLR,pgonLR) =layers[:3]
g=arcpy.Geometry()
point=arcpy.CopyFeatures_management(pointLR,g).firstPoint
SR = arcpy.Describe(pointLR).spatialReference
pgon=arcpy.CopyFeatures_management(pgonLR,g)
outline=pgon.boundary();L=outline.length
chainage=gss(0,L,0.01)
doit=f(chainage)

curT = arcpy.da.InsertCursor(outputLR,"Shape@")
for item in two:
curT.insertRow((item,))

except:
message = "\n*** PYTHON ERRORS *** "; showPyMessage()
message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()); showPyMessage()
message = "Python Error Info: " +  str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()
``````