Question

FME Desktop 2022: How to dissolve based on a particular field and then to get the COUNT of the dissolved features as well as the FIRST value of other field?

  • 25 February 2022
  • 3 replies
  • 113 views

Badge +5

FME Desktop 2022: How to dissolve based on a particular field and then to get the COUNT of the dissolved features as well as the FIRST value of other field?

 

For example, in the screenshot below, I wanted to dissolve based on the “autocad_color” field and then to COUNT the features that have been dissolved while taking the FIRST value of the “landuse_arabic” field.

 

This can be done easily in Pro with one command (dissolve)

 

The data is attached

Clip_91 

Clip_92 

 

 

 

 

 

 

 

 

 

The data is attached


3 replies

Userlevel 1
Badge +11

Hi @jamal The Dissolver has a parameter called Dissolve Count where you can set an attribute name to receive the count of polygons dissolved together. By default, values kept by the new dissolved polygons will be from the FIRST polygon from the set - just as in Pro.

Userlevel 5
Badge +29

Hi @jamal The Dissolver has a parameter called Dissolve Count where you can set an attribute name to receive the count of polygons dissolved together. By default, values kept by the new dissolved polygons will be from the FIRST polygon from the set - just as in Pro.

Agree with @danatsafe​, an alternate method that in some scenarios may be the desired outcome is to generate a list on the output feature, then you can count the length of the list (ListElementCounter) and then use the ListIndexer to copy the index of the list which contains the attributes you want.

 

This of course can potentially leave you with a very large list so it would be a good idea to follow it up with a AttributeRemover to remove the list

Badge +5

Thank you for the help

 

1) It works for the count

2) As for the statistics, it appears that there is no chance to apply it for all fields

3) Is there any chance to concatinate all fields in one go?

 

Clip_201 

Clip_202 

Clip_203 

 

 

 

 

 

 

Reply