Skip to main content

I have duplicate line segments with same unique ID but different lengths. I would like to filter out the shorter line and keep the longer line for further transformation.

Calculate the length, sort your features by length and then use a sampler (First 1 feature), grouped on the Unique ID attribute. The longest lines will be from the sampled port, and the shorter duplicate lines will be sent through the unsampled port.

Alternately use a DuplicateRemover in place of the Sampler.


If you sort by unique ID and length in desc order then use a duplicate remover, FME will output the longer line via the unique port.


Calculate the length, sort your features by length and then use a sampler (First 1 feature), grouped on the Unique ID attribute. The longest lines will be from the sampled port, and the shorter duplicate lines will be sent through the unsampled port.

Alternately use a DuplicateRemover in place of the Sampler.

Thank you !!


If you sort by unique ID and length in desc order then use a duplicate remover, FME will output the longer line via the unique port.

Thank you.


Reply