3

I have been having trouble trying to come up with a python script that will go through a polyline feature class representing a river system and split all the streams intersecting with a central river at distance of 2km. The added difficulty is that any given stream can be made up of multiple polyline segments. Thus if a stream that intersects with the central river is made up of 2 line segments 1.5km long, the first would need to be unclipped, and the second after 0.5 km.

Does anyone have any suggestions on how to write a script that will accomplish this? I know positionAlongLine tool might help but I am not sure how to implement it.

enter image description here

| improve this question | | | | |
  • "The added difficulty is that any given stream can be made up of multiple polyline segments." - Dissolving the stream segments into single features would be a good start to avoid that problem. – Adam Aug 26 '15 at 4:06
  • How is the central river designated? Can the tributaries fork as well? – Emil Brundage Aug 26 '15 at 6:56
  • Could you please illustrate on a picture how the polylines should be split and how you define the central river / streams (an attribute value?) – Alex Tereshenkov Aug 26 '15 at 8:58
  • @Adam Thanks for the tip, dissolving them will definitely make things easier – Soupoder Aug 27 '15 at 3:57
  • @EmilBrundage The central river is designated by all the features sharing the rivers name in the attribute table. An yes the tributaries often do fork before 2km unfortunately – Soupoder Aug 27 '15 at 3:58
2

I don't think this question ever got resolved, I apologize Soupoder. The idea I have doesn't require arcpy.

1) Create a selection of central trunk rivers and export them as a separate feature class. Create a buffer around your central trunk rivers at 2km.

One

2) Use Feature to Line to split your side branches with the 2km buffer, adding both feature classes as "Input Features" in the tool.

Two

3) Since polylines from both the input side branches and buffer will be present in the tool output, Select by Location those lines that "share a line segment with" the original buffer feature class and delete them in Editor.

Three

You'll need an Advanced license for this workflow. Otherwise, we'll have to resort to some fancy arcpy to mimic the "Feature to Line", but let us know if this is the answer you were looking for.

| improve this answer | | | | |
  • Sorry for the late response, my office just got an upgraded advanced license and this workflow solved the problem nicely. – Soupoder Nov 24 '15 at 4:39

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.