I want to filter out dead-end street lines at marked locations and join them in polylines. Every given dead-end street should be converted to single polyline.
Build a network from input lines.
(They were polylines originally, but exploded them to line segments.)
Find the indexes of given street-end nodes.
(Note: Not all network ends are dead-ends. Dead-ends are predefined.)
Look for next node in network. Check if the node valence is less than 3. Continue searching until ’valence >= 3’ condition is met.
Append nodes from above in proper branches in correct order. Make a polyline.
Or find corresponding network line of these nodes. Branch them per initial dead-end points. Join them.
Since i dont speak any language, my only options were Anemone and Hoopsnake. Have tried SpaceSyntax components as well. Unfortunately i was constantly hitting the wall, with no decent results.
For any advice or solution (scripted or not) i would be very, very thankfull.
That’s easy via code (but I’m not in the practice right now). Keep in mind that a C# based solution would be a black box for you.
General strategy: do graph’s VV connectivity (since you claim that (1) there’s no islands, (2) you don’t have a Graph Tree to resolve, (3) you are sure that your Graph is OK … you can safely use Sandbox) and for each node with valence 1 (and marked as a dead-end start [or end]) recursively search for an adjacent one that has valence >= 3.
If on the other hand you want to mark the nodes interactively … that requires some lines of code more (storing volatile data in a parameter and prior the next search input these etc etc).
So the only thing that matters (in real-life) in this case is the way that you mark the desired valence 1 nodes.
I have marked them in above attached definition. As you mentioned with Sandbox and ClosestPoint pairing. Initial nodes are always of valence 1. I have indexes of nodes but cannot implement recursiveness succesfully.
Let it be a black box. But not for ever. Eventually i will learn scripting.