[GIS] Split Line at Points not splitting at every point in ArcGIS for Desktop

arcgis-desktoparcmapsplitting

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?

Best Answer

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.

Related Question