2

Why does Split Line At Points not split at every point encountered, even if run in an iterative fashion?

Following the suggestions of a thread here and several others, I made a set of points in order to split polylines at specified intervals. In order to do this, I used linear referencing to turn my lines into routes. Then, I exported the attribute table, divided each length by 5, and set points at multiples of 1/5 the length of the line. I used this as the event table to create a layer of events. So, each line has 4 equally spaced points along it, and I thus ultimately need the 5 segments separated by those points.

Curiously, though, when I try to do the second part "Split Line at Point," it seems that only one point is used on a given line at a time, and I'm not sure how it chooses the point (maybe order in its attribute table?) I could run the tool multiple times, but this doesn't seem to solve the problem either. For example, I could see how it would continue splitting segments as more segments are generated, but on e.g. the 4th run I see that some lines are still only split 3 times, even though there is a point within a line segment that was never split and existed before I ran the tool. I'm not sure how the splits are generated, but in any case, it doesn't seem to do what I want it to do, which is produce a split at "each" point.

What should I do to split lines at ALL points along the line?

1

This is a script tool I wrote that will do it for you, I believe:

Standalone Python script to split a polyline with a point layer

I don't think it suffers from having to run it again and again (recursively) to keep splitting the lines. Let me know (with an @John in the comments) if you need help setting a toolbox up!

*Note: If you're running on an Advanced license, comment out the code near the beginning (using "#"s in front of each line) for the following section:

if arcpy.ProductInfo() in [u'ArcInfo', u'ArcServer']:
    arcpy.SetProgressorLabel("Splitting lines at points")
    arcpy.SplitLineAtPoint_management(linefc, pointfc, output, 1.0)
    arcpy.SetProgressorLabel("Deleting duplicate slices")
    outshapefieldname = arcpy.Describe(output).shapeFieldName
    arcpy.DeleteIdentical_management(output, [outshapefieldname])
    sys.exit(0)

Otherwise it will just use the same Split Line at Point tool that's giving you issues.

  • If this question is similar to the one you linked, you can flag it as duplicate. – Paul Oct 29 '15 at 0:50
  • Noted @Paul, thx. – John Oct 29 '15 at 0:57
  • Hi - I was actually able to upgrade my ArcMap to 10.3 and used a script that someone wrote with a new arcpy command to split the lines. Thanks for the link to your script though. However, this isn't a duplicate question - my question was why Split Lines at Points does not split a line at every point, even if run recursively. The post you linked was a question by someone who needed an alternative to what the tool seemingly should do since the author doesn't have Advanced. I tried the solution I posted based on another forum's suggested answer, and it didn't work as described for me. Any ideas? – setophaga Oct 30 '15 at 18:10
  • 1
    Hi @setophaga, is there a link to this "other forum" that we can read? From how you paraphrased it about Linear Referencing - generate points along the line, then split the line using those points - it seems like a roundabout way of doing it. There's a method in the arcpy.Polyline class "segmentAlongLine" that will create line segments for you without needing intermediate points. It can take percentages as its arguments (e.g. multiples of 20% in your case). That's probably the most straightforward solution. – John Oct 31 '15 at 3:43
  • Here is the link: geonet.esri.com/thread/46594#post177849 I am referring to the first answer. When I was able to upgrade to 10.3, I used the second answer, which indeed includes segmentAlongLines – setophaga Oct 31 '15 at 18:03
0

Personally I think this would be better if you use near tool in Arctoolbox and calculate maximum point distance from line feature and then input found max value in radius field in Splittings Lines at Points tools.

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.