Solved

Conditional Aggregating

  • 23 August 2018
  • 6 replies
  • 8 views

Badge

Is there a way to aggregate based on a condition?

I have a set of polygons that I want to aggregate based on the distance. That has worked with the workaround @takashi has posted numerous times (with the buffer, en the count etc). But now I end up with aggregates that have a larger summed attribute value than I would like. Is there a way to add conditions to the aggregating proces? As in, form an aggregate based on distance, but if the summed attribute value exceeds a certain amount, further separate the aggregates.

icon

Best answer by takashi 24 August 2018, 17:04

View original

6 replies

Userlevel 4
Badge +25

There's a custom transformer, the SpatialSorter that might be useful. I must admit I've only used it in the context of the FME Desktop Basic training course.

Userlevel 2
Badge +17

You can use the Attributes to Sum parameter in the Aggregator to get the sum of the attribute from all the parts in the aggregate feature, test if the sum is greater than a certain attribute with the Tester, and then decompose each Passed feature into individual parts (i.e. original features) with the Deaggregator.

If necessary, you can store the attributes of original features using the Generate List option in the Aggregator, and restore them by specifying the list to the List Attribute to Explode parameter in the Deaggregator.

Badge

You can use the Attributes to Sum parameter in the Aggregator to get the sum of the attribute from all the parts in the aggregate feature, test if the sum is greater than a certain attribute with the Tester, and then decompose each Passed feature into individual parts (i.e. original features) with the Deaggregator.

If necessary, you can store the attributes of original features using the Generate List option in the Aggregator, and restore them by specifying the list to the List Attribute to Explode parameter in the Deaggregator.

Yes, I started doing that.., but I want to aggregate everything, not just create aggregate smaller than the summed attribute. With this solutuion I would end up with aggregates and deaggregates. I could aggregates the deaggregates again, but on a different group by setting, because I would end up with the same large aggregate otherwise. I don't want this.

 

I want to aggregate everything, but with conditions to make sure that I do;t end up with ggregates that are too large in summed attribute value.

 

 

Badge

There's a custom transformer, the SpatialSorter that might be useful. I must admit I've only used it in the context of the FME Desktop Basic training course.

 

I'll try this

 

Userlevel 2
Badge +17

You can use the Attributes to Sum parameter in the Aggregator to get the sum of the attribute from all the parts in the aggregate feature, test if the sum is greater than a certain attribute with the Tester, and then decompose each Passed feature into individual parts (i.e. original features) with the Deaggregator.

If necessary, you can store the attributes of original features using the Generate List option in the Aggregator, and restore them by specifying the list to the List Attribute to Explode parameter in the Deaggregator.

Sorry, I'm unclear the situation. Could you please post a small sample dataset and your desired result?

 

 

Badge

Bump.... I still need help with this..:-)

Reply