Solved

DuplicateFilter: Hot to choose which of the pair goes to unique depending on the featuretype?

  • 19 April 2024
  • 5 replies
  • 30 views

Badge +4
Hello, the problem is the following. I have a duplicateFilter attached to 2 different featuresTypes, which have an attribute in common. I would like, however, that when there are duplicates, the features of a certain type remain in the unique port. In other words: when there are duplicates, I always want the pair of the copy that goes to unique to be of a certain feature type, always the same, and to be able to control it. Any ideas? Thanks,

 

Pol

icon

Best answer by redgeographics 19 April 2024, 15:29

View original

5 replies

Userlevel 5
Badge +28

The easy way is to just sort the data first, the duplicate filter should keep the fist one as unique.

The alternative option is to use a Matcher - This will let you identify features which match and then you can use a tester to just test for the specific feature type you want. 

 

Userlevel 5
Badge +26

In addition to @virtualcitymatt ‘s suggestion, a FeatureMerger may also be useful. The featuretype you want to keep is the one you put in as Requestor, the other one as Supplier. Then the Matched output is the duplicate features from the featuretype you want to keep.

Badge +4

Well, maybe I didn't express myself well. They are 2 connections to 2 datasets with the same featuretype, they have the same attributes and different values ​​in all except the one (service_id, not always) I compare to the duplicateFilter. Are calendar_dates from GTFS. On one side they all have 0 in the attributes, on the other side they don't. I want, when there are duplicates, that the pair that does not have zeros goes to unique. I hope I expressed myself better, thank you very much!
Pol

 

 

Userlevel 5
Badge +26

Well, maybe I didn't express myself well. They are 2 connections to 2 datasets with the same featuretype, they have the same attributes and different values ​​in all except the one (service_id, not always) I compare to the duplicateFilter. Are calendar_dates from GTFS. On one side they all have 0 in the attributes, on the other side they don't. I want, when there are duplicates, that the pair that does not have zeros goes to unique. I hope I expressed myself better, thank you very much!
Pol

 

 

Same thing really: put the set that you want to keep in the FeatureMerger as Requestor. Match on the attribute service_id and then the Matched output is what you’re after. 

Badge +4
thank you very much, it worked! I point out the maneuver, it's good!CheersPol

 

Reply