Skip to main content
Solved

Filtering out duplicate lines


mario_bla
Participant
Forum|alt.badge.img+6

Hello,

 

what would be the proper way to filter out duplicate lines. For example, I have 2 completely overlapping lines with different line directions and I can't just use DuplicateFilter because the geometry of those lines are different so in fact they are not duplicate... I noticed that if I put GeometryExtractor before duplicate filter and set the Geometry encoding to 'GEO (Microformat)' - also works with some other formats - than it seems it looses the info about line direction and DuplicateFilter detects those 2 lines as duplicate lines. So, at the end, my workbench works but I'm afraid that this is some weak workaround that will fail in some sitauations... or?

Best answer by david_r

Have a look at the Matcher transformer. You probably want to have lenient matching ON and it may also be necessary to play around with different values for the vector tolerance (= ground units).

View original
Did this help you find an answer to your question?

6 replies

david_r
Celebrity
  • Best Answer
  • August 25, 2020

Have a look at the Matcher transformer. You probably want to have lenient matching ON and it may also be necessary to play around with different values for the vector tolerance (= ground units).


mario_bla
Participant
Forum|alt.badge.img+6
  • Author
  • Participant
  • August 25, 2020

@david_r​ 

Thank you for your help. Till now I didn't know about lenient matching parameter - good to know, thanks. But it seems it doesn't work with lines that have different directions. I believe it works only for cases as described in documentation: "For example, consider two lines, each with 10 vertices: One line is a path composed of 3 segments, and the other is just a simple line. These lines are considered to have a different composition. Lenient geometry matching will treat all these as matching, as long as they have the same vertices (no more and no less)."


david_r
Celebrity
  • August 25, 2020
mario_bla wrote:

@david_r​ 

Thank you for your help. Till now I didn't know about lenient matching parameter - good to know, thanks. But it seems it doesn't work with lines that have different directions. I believe it works only for cases as described in documentation: "For example, consider two lines, each with 10 vertices: One line is a path composed of 3 segments, and the other is just a simple line. These lines are considered to have a different composition. Lenient geometry matching will treat all these as matching, as long as they have the same vertices (no more and no less)."

Lenient geometry matching should, as far as I can remember, work with differing orientations. Did you test?

If you have complex paths, it can sometimes help to pass them through the GeometryRefiner first.


mario_bla
Participant
Forum|alt.badge.img+6
  • Author
  • Participant
  • August 25, 2020

I tested it with fresh dwg file (only 2 lines with 2 vertices and different directions). Tolerance should be 0 (or at least super small) but I also increased the tolerance step by step and reached 1000 (line lengths are around 500m). I'm attaching it here. Maybe I'm doing something wrong. I see documentation also says: "then the order of points in line and area features will be ignored"...


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • August 25, 2020
mario_bla wrote:

I tested it with fresh dwg file (only 2 lines with 2 vertices and different directions). Tolerance should be 0 (or at least super small) but I also increased the tolerance step by step and reached 1000 (line lengths are around 500m). I'm attaching it here. Maybe I'm doing something wrong. I see documentation also says: "then the order of points in line and area features will be ignored"...

The features aren't matching because you have extracted the geometry and set that as to match as an attribute. If you uncheck the match attributes, your features will match


mario_bla
Participant
Forum|alt.badge.img+6
  • Author
  • Participant
  • August 25, 2020

Thank you very much! Now it works.


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