Skip to main content
Solved

Dissolving then Aggregating, concatenating attributes


ebygomm
Influencer
Forum|alt.badge.img+39

Just want to check I’m not missing something obvious.

I want to dissolve some polygons and then aggregate distinct areas into multipolygons. One of the attributes of the original polygons needs to be concatenated into a single line with no duplicates. Fairly simple with a list builder/listduplicateremover/listconcatenator if i was only using the dissolver. But if i want to get combine attributes from both processes it seems unnecessarily complicated without resorting to python (which only requires a couple of lines).

 

Am I missing an easier way to do this?

Start

End 

 

Best answer by takashi

Hi ​@ebygomm ,

I don't know if you'd call it simple, a possible way I can think of is,

  1. Separate the data flow into two streams.
  2. On the first stream, process the polygons with Dissolver and Aggregator, without concatenating the attribute.
  3. On the second stream, remove dupliates on the attribute with DuplicateFilter and concatnate them with Aggregator.
  4. Finally, merge the concatenated attribute to the feature processed in the first stream.

 

View original
Did this help you find an answer to your question?

4 replies

takashi
Influencer
  • Best Answer
  • June 4, 2025

Hi ​@ebygomm ,

I don't know if you'd call it simple, a possible way I can think of is,

  1. Separate the data flow into two streams.
  2. On the first stream, process the polygons with Dissolver and Aggregator, without concatenating the attribute.
  3. On the second stream, remove dupliates on the attribute with DuplicateFilter and concatnate them with Aggregator.
  4. Finally, merge the concatenated attribute to the feature processed in the first stream.

 


ebygomm
Influencer
Forum|alt.badge.img+39
  • Author
  • Influencer
  • June 4, 2025

Certainly, simpler than anything I’d have thought of, I have 5 separate streams I’m already dissolving and aggregating so I think I’m going to stick with my python solution for this which is building two lists and then combining, deduplicating and concatenating. But I knew there should be a more straightforward FME way but I was getting hung up on lists

import fme
import fmeobjects

def processFeature(feature):
    v = list(set(feature.getAttribute('dissolve{}.Value')+feature.getAttribute('aggregate{}.Value')))
    feature.setAttribute("Value",' / '.join(v))

 


takashi
Influencer
  • June 4, 2025

I'm afraid that your solution could cause unexpected result, if the data flow consists of Dissolver, Aggregator, and PythonCaller connected in series.

For example, in the case of this screenshot,

after dissolving, resulting features will have these attributes.

  • feature 1
    • Value = 'a'
    • dissolve{0}.Value = 'a'
    • dissolve{1}.Value = 'b'
  • feature 2
    • Value = 'c'
    • dissolve{0}.Value = 'c'
    • dissolve{1}.Value = 'd'
  • feature 3
    • Value = 'a'
    • dissolve{0}.Value = 'a'

Then, if you perform aggregating them with Aggregator, resulting feature will have these attributes.

  • feature
    • Value = 'a'
    • dissolve{0}.Value = 'a'
    • dissolve{1}.Value = 'b'
    • aggregate{0}.Value = 'a'
    • aggregate{1}.Value = 'c'
    • aggregate{2}.Value = 'a'

The value 'd' is missing.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Author
  • Influencer
  • June 4, 2025

That scenario doesn’t actually occur in my data but a good warning. I’ve tweaked my workflow

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings