Skip to main content
Question

selfoverlapping lines


katt
Supporter
Forum|alt.badge.img+12
  • Supporter

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)

  

5 replies

liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • October 2, 2024

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


katt
Supporter
Forum|alt.badge.img+12
  • Author
  • Supporter
  • October 2, 2024

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


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • October 2, 2024

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


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • October 2, 2024

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.


gmbutler2
Contributor
Forum|alt.badge.img+10
  • Contributor
  • October 2, 2024

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings