Solved

Feature Count Problem

  • 17 November 2017
  • 6 replies
  • 6 views

Badge

Hi,

I want feature count in a variable, I am using statistic calculator for this purpose but it ask me for attribute to analyze but i want count for all features.

I guess the below links are explaining my requirement.

https://knowledge.safe.com/idea/45903/add-a-count-attribute-to-the-featureholder.html

https://knowledge.safe.com/idea/48591/save-feature-count.html

Regards,

Dheeraj

icon

Best answer by mark2atsafe 17 November 2017, 17:52

View original

6 replies

Userlevel 1
Badge +21

Just use any attribute in the attribute to analyse, the count will still count all features

Userlevel 2
Badge +16

If you could use a FeatureWriter instead of the Writer, you could use the information in the Summary to get the feature count (per writer feature type) without using additional transformers.

Userlevel 4
Badge +25

Use the FeatureCounter transformer from the FME Hub

Badge

Use the FeatureCounter transformer from the FME Hub

Thanks @Mark2AtSafe

 

It works

 

 

Badge +6

Use the FeatureCounter transformer from the FME Hub

Hey Mark

 

The domain setting used to be in the Counter but this was removed. Maybe we need a domain counter

 

 

Userlevel 4
Badge +25
Hey Mark

 

The domain setting used to be in the Counter but this was removed. Maybe we need a domain counter

 

 

I think that's now just the Counter Name parameter. You can select an attribute there and it counts per unique value (like a group-by). But that still gives you 1,2,3,4,etc for each group.

 

The old way we used to get the result (I remember a specific training exercise) was to apply a Counter, sort by count (descending), and then take the first feature (which we might have had to do by creating a second count and testing for count2=0). Luckily things are way easier today!

 

 

Reply