Skip to main content
I have a file that that has a from and to node field but it is bi-directional.  For example,

 

From Node = 1; To Node = 2 and but there is also a record where To Node = 1; From Node = 2. I am using the FeatureMerger to connect the from and to nodes and form a line network; however, this creates duplicate lines (one on top of each other).  Is there a way to eliminate the duplicate lines so there is a unique record for each line geometry?

 

 

Kdmur
Hi,

 

 

How about removing duplicate records before the FeatureMerger?

 

1) Add the third field  (e.g. LineID) which contains a string consist of less node ID and greater node ID. (Tester and  AttributeCreator or StringConcatenator)

 

i.e.

 

From = 1, To = 2 --> LineID = 12

 

From = 2, To = 1 --> LineID = 12

 

2) Remove duplicate LineID records. (DuplicateRemover)

 

 

Hope this helps.

 

 

Takashi

 


In addition, if you want to remove duplicate lines after connecting the From and To nodes, consider using the Matcher transformer with 'yes' as 'Lenient Geometry Matching' parameter.

 

 

Takashi
Takashi-san

 

great again, you helped me with this one as well. Both solutions are valid.

 


Reply