Skip to main content

I have a network where I would like to identify intersections that are not connecting at endpoints. Each line feature has it's own colour in the image below and I would like to sort out all intersections similar to A.

 

At intersections B and C all the lines are connecting at end nodes, but the yellow line is touching the pink somewhere "midline". I would like to collect the point where this overlap happens.

 

Screen 2020-09-16

I have been experimenting with the TopologyBuilder but have not figured out to get the result I want.

Disclaimer: only works if your lines have their end and beginning point as vertices ( you can see that in feature information) I made it in 2D but it would work in 3D too, you just have to add Z and Z2, and add 4 other conditons (AND) in the tester

 

Heavy artillery ahead:

Use a coordinate extractor twice on your lines, one with the coordinate index 0 and the other -1 so you get both end points. Use mode "specify coordinate" with a x, y attribute (and Z once again if needed) with the index 0 and X2, Y2 (and Z2) with the index0 for example. you will have your lines and the coordinate of their end and begining points.

 

Attribute creator, and create 2 attributes, same_start et same_end, that are set at 0

another with an attribute "test", with a value of one or anything else

Next, use a matcher, two times. as you don't know where the end and the start of each line is, there may be occurence of a point x,y being also the x,y of another line, same thing for X2 and Y2

so after the first matcher, the lines that have the same start will be out by the matched output. attribute manager this output and set the calue of same_start to one. Then FeatureJoiner on the attribute test, in full join mode, joined on the "test" attribute.

 

Do the same thing once again , matcher with X2,Y2, same_end, attribute manager and FeatureJoiner

 

You should now have lines, that have a indicator if they have the same end or start.

 

Nearly at the end we are.

Use a tester (1 AND 2)OR(3 AND 4)

((x in X2) AND (y in Y2))OR ((X2 in x) AND (Y2 in y))

to see if the end point of one is the beginning of another and vice versa

If they passed the test, you can throw them away.

If they didn't, use one more tester and see if same_end and same_start are both at 0

 

Congrats, you have the lines that are intersecting in the middle of another one and have their other end free. (1)

LineOnLineOverlay will give you the points that are intersections from the lines you started with not these ones (2)

 

PointOnLineOverlay will give you the points you want with the point input being the LineOnLineOverlay output "point"(2) and the line input being the lines that went through the whole process (1)

 

Yeah I know, you might as well do it by hand


Use the topologybuilder to split the lines at intersections then compare start and end points of the lines against the original and find the unmatched points. I'm sure there must be a simpler way, but it escapes me right now.

Capture


I actually figured out a solution on my own that might be of use to someone.

 

I realized that the intersection I was trying to single out only had one neighbouring face. So I ran a TopologyBuilder and extracted the nodes with a list for faces and counted them with the ListElementCounter. Everything with only one face was selected and with a PointonLine I could make sure it was not an endpoint.


Reply