Group-By Processing GitBook

Publish date: 2024-05-09

Group-By parameters allow features to be processed in groups by a single FME transformer.

What is a Group?

FME transformers carry out transformations on either one feature at a time, or on a whole set of features at once.

For example, the AreaCalculator transformer operates on one feature at a time (to measure the area of a single polygon feature). We call it a feature-based transformer.

The StatisticsCalculator operates on multiple features at a time (to calculate an average value for them all). In FME we call this set of features a group and the transformer is a group-based transformer.

Creating Groups

So a group is simply a defined set of features being processed by a transformer. By default, a group-based transformer treats ALL the features that it is fed, as a single group.

However, such transformers also have a Group-By parameter. This parameter lets the user define several groups based upon the value of an attribute.

FME Lizard says...
To illustrate groups let's consider calculating the mean age of FME users. The default group for the calculation includes all FME users.

But you could instead divide everyone up on into men and women, creating two groups, and calculate average age per gender. Or you could divide everyone into their nationality, and calculate average age per country.

This is the same as having a gender (or nationality) attribute in a dataset and selecting that in an FME group-by parameter.

Here, a Dissolver transformer is being used to dissolve (merge) a number of polygon features. The selected Group-By attribute is ViewDescription:

FME creates a series of groups for overlaying, where the features in each group share the same value for the ViewDescription attribute. The practical outcome is that polygon dissolving takes place only where line features share the same description:

Group By Mode

When grouping features, there are two different ways the transformer can handle the group. The first way is to hold all of the features until all of the features have come through the transformer, this is referred to as blocking. This is set by using the Process at End (Blocking) Group By Mode.

The other way is to pre-sort your data into groups first by using a transformer like the Sorter. Then once your data is grouped, use the Process When Group Changes (Advanced) Group By Mode. This mode will push the features through the transformer after each group which will help speed up performance. Only use this option when your data is pre-sorted.

ncG1vNJzZmirY2Ourq3ZqKWar6NjsLC5jqCgrZqfpLhwkMSsoq2noGKPor%2FInGRraGJlfIWx0qSrqKhylsCqr5GNqZqmo5u8s7nAraCopl9ne3J8jYCpqK2gd8aRvs6cnKyrmaO0b7TTpqM%3D