[GIS] Creating line from point based on intersecting line at 90 degrees to line in ArcMap

arcgis-10.3arcgis-desktoparcmappolygonsplitting

I am using ArcMap 10.2/10.3 and I need to create lines from points, so I can split polygons at the created line, as per the image below.

So I have to cut the polygon at a 90 degree angle to the line running through the poly, at the point (red line drawn in below). When I have this line I can split my polygons with these lines.

I have 1100 of these so I would prefer to not do it manually..I cannot find a way to automate this process, as the line direction changes for each polygon depending on which direction the road is going.

enter image description here

Best Answer

Pseudo-code:

A) Find distance from the point to the kerb, this number to be used for perpendicular line extension;

B) Use small fraction of the line (segment) near point to define line direction;

C) Rotate and extend segment.

Procedure:

A: Convert road polygons to polyline. Spatially join points (CLOSEST, call distance field D_TO_LINE to store distance to kerb) with above lines.

B: Create small buffer around points Intersect road centrelines with above buffer, output – polyline. Let’s call it segments

C: Use field calculator expression on Shape field of segments to rotate and extend them:

def RotateExtend(plyP,sLength):
 l=plyP.length
 ptX=plyP.positionAlongLine (l/2).firstPoint
 ptX0=plyP.firstPoint
 ptX1=plyP.lastPoint
 dX=float(ptX1.X)-float(ptX0.X)
 dY=float(ptX1.Y)-float(ptX0.Y)
 lenV=math.sqrt(dX*dX+dY*dY)
 sX=-dY*sLength/lenV;sY=dX*sLength/lenV
 leftP=arcpy.Point(ptX.X+sX,ptX.Y+sY)
 rightP=arcpy.Point(ptX.X-sX, ptX.Y-sY)
 array = arcpy.Array([leftP,rightP])
 section=arcpy.Polyline(array)
 return section

=============================

RotateExtend( !Shape!, !D_TO_LINE!)

RESULT: enter image description here It shows the need to increase value stored in D_TO_LINE, so that perpendicular can reach both sides of the road.

CREDITS: I borrowed this elegant idea of trigonometry-free perpendicular construction from very old Avenue script by @whuber

Related Question