I am attempting to extend a series of polyline features to an adjacent polyline feature. I need the lines to intersect, but not extend beyond the 'first hit' of the adjacent polyline feature and maintain their original bearing. As such, distance bearing to line using a set distance and the edgematch tools aren't suitable. The extend lines to layer tool (Extending batch of lines to another object using ArcGIS Desktop?) just crashes/hangs. And ETGeoWizards/Geotools doesn't seem to have the necessary tools. Any other suggestions. I would like to create a point layer at the line intersects. I'm using ArcMap 10.5.1 with advanced license. (Image: Yellow lines = line segments to extend, pink = adjacent shoreline. Red dashed line = what I would like to happen)
What you can do :
- Copy the pink feature.
- Merge the copied pink feature with the yellow feature.
- Use the tool
Extend lineswith the merged feature. You don't need to write something in Extend Length.
It should work in your case. You can remove the coast field of your merged feature if you want.
I hope it helps you.
Unfortunately Extend tool won't manage real life situations, many segments will inersect before touching coastline.
The script below handles them nicely and does job in no time. It assumes small lines point toward coastline, if this is not a case, flip them. Start editing session on clone of your short lines if they saved in FGDB.
import arcpy coastline="Coastline" directions="Directions" g=arcpy.Geometry() bank=arcpy.CopyFeatures_management(coastline,g) with arcpy.da.UpdateCursor(directions,"Shape@") as cursor: for row in cursor: line=row pStart=line.firstPoint pEnd=line.lastPoint L=line.length dX=(pEnd.X-pStart.X)/L;dY=(pEnd.Y-pStart.Y)/L p=pEnd m=0 while True: l=bank.distanceTo(p) L+=l p.X=pStart.X+dX*L p.Y=pStart.Y+dY*L m+=1 if m>100:break if l<0.001:break if m>100:continue row=arcpy.Polyline(arcpy.Array([pStart,p])) cursor.updateRow(row)