1

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

  • Can you enhance your picture to show where your cut is intended to go, and perhaps to show what green/white polygon(s) it is supposed to cut, please? – PolyGeo Mar 3 '16 at 3:57
  • do you have option to use ArcObject programming for this opeation? – Reza Mar 3 '16 at 10:01
3

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

2

Your red line is not oriented at 90 degrees relative to the line, it is simply horizontal. A horizontal line can just be created using a 90 degree angle and 270 degree angle in Geographic degrees with the Bearing Distance to Line tool. To find the actual normal angle to the line you can use the Linear Referencing tools of Create Route, Locate Feature Along Route and Make Route Event Layer with the Angle field option enabled. The Angles of this tool are in arithmetic degrees (counterclockwise from east). Since it looks like the lines will be short you can convert them to geographic degrees (clockwise from north) using the simple formula of 90 - arithmetic_angle and 270 - arithmetic_angle (longer lines require more advanced math to convert from one system of degrees to the other). Then LR Event Points and converted angles can be used with the Bearing Distance to Line tool to create a short line that is Normal to your line and then use the Extend Line tool to intersect the polygon edge.

1

This will depend on the software you are using and what file output is possible for that software.

For example, an output of a shape file (".shp") can be easily converted to a drawing exchange file (".dxf") and imported into, say, Autocad along with several other software's formats. The functionality of Autolisp, in this case, would help you facilitate a method of automation. (Setq Web_Address ("https://en.wikipedia.org/wiki/AutoLISP"))

In addition, the visual lisp extensions are perfect for stream lining your automation process, as this is an object oriented language.

(vlax-curve*...
(vlax-curve-getclosestpointto object point) ;perpindicular to arc/line segment
(vlax-curve-getdistatpoint object point) ;distance along an arc/line/lwpolyline
(setq PaD (vlax-curve-getpointatdist object dist)

Where object, point, and dist are a variables set by the postceding code. I'll get off my soap box on how awesome Autolisp is. The point being, if you have the output file extension, the odds are you can convert the file to another, more automated, software.

  • I don't have access to cad..unless I downloaded it at home, but doing this and trying to learn autolisp sounds like a lot of time spent. If there was a way to do it in arcmap we could use it for future projects too – Sylvia N Mar 3 '16 at 3:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.