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.
-
"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– Adam2015年08月26日 04:06:27 +00:00Commented Aug 26, 2015 at 4:06
-
How is the central river designated? Can the tributaries fork as well?Emil Brundage– Emil Brundage2015年08月26日 06:56:36 +00:00Commented Aug 26, 2015 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– Alex Tereshenkov2015年08月26日 08:58:39 +00:00Commented Aug 26, 2015 at 8:58
-
@Adam Thanks for the tip, dissolving them will definitely make things easierSoupoder– Soupoder2015年08月27日 03:57:17 +00:00Commented Aug 27, 2015 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 unfortunatelySoupoder– Soupoder2015年08月27日 03:58:57 +00:00Commented Aug 27, 2015 at 3:58
1 Answer 1
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.
2) Use Feature to Line to split your side branches with the 2km buffer, adding both feature classes as "Input Features" in the tool.
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.
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.
-
Sorry for the late response, my office just got an upgraded advanced license and this workflow solved the problem nicely.Soupoder– Soupoder2015年11月24日 04:39:33 +00:00Commented Nov 24, 2015 at 4:39