Skip to main content

Hello,

I have several lines in my data base which are self overlapping. On the the picture you see the vertices and the order when drawn. Vertices 3 and 4 have been drawn before vertex 5 which makes the line self-overlapping or self-intersecting. How can I detect lines in my database which have that kind of problem ? I tried the geometry validator but I noticed that it detects only some of them. So it is not fully reliable in my case. Is there any other transformer ? I thought maybe of calculating the bearing as the change of direction could indicate that problem as well. Thanks for your help. (btw I don’t want any transformer to automatically correct them, I only want to detect them)

  

Perhaps the lines are very close but not actually overlapping? In which case you could try the SpikeRemover set to very strict angles.


Thank you @liamfez The thing is I don’t want to automatically correct the lines, I just want to detect them.


Ah okay. Have you tried modifying the tolerance for the self-intersection test?


Have you tried the ZigzagRemover from FME Hub? If one or more vertices have been removed, the resultant feature will be output through the Changed port. So you can always see which objects have been changed.


Thinking along the same lines as @geomancer but if you put a junction before the zigzagremover then removes all attributes but a unique id for each line, then use a featuremerger to use the unique id’s of the changed lines to identify which lines have the overlaps.  Any merged lines would be lines with overlaps and unmerged lines would be lines without overlaps.  If you do want to fix them and identify them you could just use the zigzagremover but if you don’t want them fixed, just use this method to identify them.  

If the lines don’t have a unique id, just add a counter transformer (Use Local not Global) to apply a unique id to them before sending them into the zigzagremover.

Below is just a simple overview of how it would look.

 


Reply