[GIS] Splitting lines with points while maintaining other dissolved lines

arcgis-desktoplinesplitting

I am on ArcGIS Desktop 10.2. I have a line feature class of a stream network. I also have a point feature class along the main stream (line) where a catchment enters that stream. I have dissolved my whole streams layer into one line feature and want to split this feature at the points.

Before split tool

However, when I use the Split Line At Point tool, the lines that don't have a point splitting them are still being split at the intersection of two streams.

After split tool

Why did this line not stay as one feature with the other lines on that side of the splitting node and how can I prevent this from happening?

Best Answer

Multi-part lines constructed with tools like Dissolve or Merge do not necessarily order the parts that touch at branches in a sequential order that would keep the parts together. So the line parts on the same physical side of a branch can be on opposite sides of the part sequence internal to the line. Parts are always traversed sequentially by tools. This makes sense for such complex multi-part lines, since once it reaches an end point of a part that touches no other line how can it know which line part to put next? It has no idea what branches may split and which won't, of if one part will have to split into two or more parts when points occur inside a line part, so there is no way to do that organization in advance. Anyway, the polyline parts are never organized in advance by "sides" of an infinite set of unknowable points that could split the line up, and the tool makes no attempt to do tracings while the splits are occurring. Therefore all branches break apart with this tool.

To get branches organized into parts you would need to write your own tool. The easiest process I can think of is to do the splits as usual, that way you will be working with the full set of lines, including new segments that split at places other than the branches. Then buffer the split points by a small distance (say a centimeter or one-half foot). Next calculate the ObjectID of the original lines after the split into a new long field and then make a copy of the split lines. Erase the portions of all copied split lines that fall inside of the split point buffers. Now buffer the copied and trimmed lines by an even smaller distance (say 1/2 centimeter or 1/4 foot). Dissolve the line buffers into single part polygons. Next spatial join the trimmed lines to the single-part dissolved buffers keeping the line shapes. This will associate the buffer ObjectID to the line set that falls within it and they will not cross the split points. Now you can select each line set by that buffer FID, relate them back to the original lines that were not trimmed and Merge/Dissolve each set of lines. Python could do the iterations more elegantly than ModelBuilder, so learn Python.

The rule of geoprocessing is always make complex items the last things you work with. Always work with the simplest items (single line parts) first and then add complexity at each stage of your script in an order that each stage is handled efficiently. Also each additional level of complexity should only be introduced into the process when the simpler objects cannot help move the process forward to the ultimate goal.