Skip to main content
Hi,

 

 

I have a point dataset where I would like to count all objects which have the same attribute (in this case year of birth) and same geometry. The result I want to have into a new point dataset with an unique point for every combination of year of birth and geometry with the count-result into a new attribute. I have looked if I can use Aggregator, Matcher or Counter but I don´t know how to fix this.

 

Best regards

 

Ulf
Hi,

 

 

you can use the Matcher, the output port SINGLEMATCHED will forward one feature for each duplicate match on geometry and attribute. You can then convert this into a point using e.g. a CenterPointReplacer.

 

 

In the Matcher, specify an attribute name in "Match count attribute on SingleMatched output", this will contain the number of duplicates.

 

 

David
Hi,

 

 

Addition to David's suggestion.

 

If you are using FME 2014, be aware that there is a bug in SingleMatched port of the Matcher.

 

There is a strange attribute "$(SINGLE_MATCHED_COUNT_ATTR)", and match count attribute which you specified will not be displayed.

 

 

A workaround I can think of is:

 

1) Expose correct match count attribute name using an AttributeExposer.

 

2) Remove the strange attribute name using a BulkAttributeRenamer with this expression.

 

Expression to Remove: \\$

 

 

Takashi
Sorry for a typo. "BulkAttributeRemover" is correct.

 

2) Remove the strange attribute name using a BulkAttributeRemover with this expression.
Hi, both

 

 

Thank You for answer. It did work well, and I haven´t recognized the problem with the strange attribute although I see that it was there. I made an attribute (Quantity) in the "Match count attribute on SingleMatched output" and it contained the number of duplicates as I wished.

 

 

Ulf H
I confirmed that  the bug on SingleMatched port of the Matcher has been fixed in FME 2014 SP1 Beta (build 14239). You can download SP1 Beta (and FME  2015 Beta) from Safe site.

 

FYI.

Reply