2

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) Yellow lines = line segments to extend, pink = adjacent shoreline. Red dashed line = what I would like to happen

  • How does this picture help? – FelixIP Aug 30 '18 at 0:17
  • When you say the tool crashes / hangs, is there an error message? Could you please update the picture and show the lines to extend in a bright colour, and make the line following the coastline stand out more...the picture is quite dark. – Keagan Allan Aug 30 '18 at 0:26
  • The "extend lines to layer tool" by @RyanDalton arcgis.com/home/item.html?id=e38c90b2f8e44852bc1e0aec640c4de1 works with 100 or so line segments (processing times 45s) but I have a few thousand line segments and the tool does not complete processing after a few hours. So am looking for alternate approaches – John Aug 30 '18 at 22:18
2

What you can do :

  1. Copy the pink feature.
  2. Merge the copied pink feature with the yellow feature.
  3. 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.

  • This is a good answer. But is there really any need to copy the pink (shoreline) feature class? It will be effectively copied in the merge anyhow, if using the 'Merge' tool. – Son of a Beach Aug 30 '18 at 3:16
  • It depends how you want to use the pink feature. Per example if you want to do a buffer zone of the coast, you have to have a feature with only the coast. Too much features is better than not enough. – geekornolife Aug 30 '18 at 3:22
  • Maybe this helps you : gis.stackexchange.com/questions/181636/… – nagib Aug 30 '18 at 5:23
0

Welcome, John!

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.

enter image description here

import arcpy
coastline="Coastline"
directions="Directions"
g=arcpy.Geometry()
bank=arcpy.CopyFeatures_management(coastline,g)[0]

with arcpy.da.UpdateCursor(directions,"Shape@") as cursor:
    for row in cursor:
        line=row[0]
        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[0]=arcpy.Polyline(arcpy.Array([pStart,p]))
        cursor.updateRow(row)

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.