Syntax FACTORY_DEF AggregateFactory [FACTORY_NAME ] [INPUT FEATURE_TYPE [ ]* []*]* [MODE ] [LIST_NAME {}] [LIST_ATTRS_TO_INCLUDE []* ] [LIST_ATTRS_TO_INCLUDE_MODE (ALL|SELECTED)] [COUNT_ATTRIBUTE ] [ACCUMULATE_ATTRIBUTES [(yes|no)]] [GROUP_BY []+]* [SUM_FIELDS []+] [AVERAGE_FIELDS []+] [WEIGHTED_AVERAGE_FIELDS []+] [BREAK_BEFORE_FIELD_CHANGE []+] [BREAK_AFTER_FIELD_CHANGE []+] [GEOMETRY_NAME_FIELD ] [PRODUCE_MULTIS [(yes|no)]] [HANDLE_ARCS_ELLIPSES_AND_TEXT [(yes|no)]] [ID_ATTR ] [PARENT_ID_ATTR ] [CYCLE_ID_ERROR_ATTR ] [PRESERVE_ID (yes|no)] [ATTR_TO_TRAIT (yes|no)] [OUTPUT (AGGREGATE | SINGLETON) FEATURE_TYPE [ ]* []*]* Overview This factory aggregates the geometries of input features together based on attribute values specified by the GROUP_BY clause. One feature is output for each group resulting from the GROUP_BY clause. If the GROUP_BY clause is specified, and FLUSH_WHEN_GROUPS_CHANGE is set to Yes, the factory will flush the current group whenever a feature from a different group is encountered. If no GROUP_BY clause is specified, then all features fall into the same group and a single feature is output. Features are added to the aggregate being built in the order they are received by this factory. If the order of individual features within the resulting aggregate is important, users can first route the features through a SortingFactory. At most one of BREAK_BEFORE_FIELD_CHANGE and BREAK_AFTER_FIELD_CHANGE can be specified. Whenever the values of the attributes specified by this clause change from one feature to the next, the aggregate currently being constructed is output. In the case of BREAK_BEFORE_FIELD_CHANGE, the newly received input feature is included in the next aggregate, and with BREAK_AFTER_FIELD_CHANGE it is made part of the aggregate under construction. The features output from the AggregateFactory have the combined attribution of all features combined to make up the aggregate. The SUM_FIELDS clause identifies attributes whose values are to be summed together when constituent features are aggregated. The AVERAGE_FIELDS clause identifies attributes whose values are to be averaged during the aggregation. The WEIGHTED_AVERAGE_FIELDS clause identifies attributes whose values are averaged weighted according to the area of their original feature. Note: Non-polygonal features have an area (and therefore a weight) of zero in the weighted average calculation; therefore, if no polygons contribute to a given aggregate, then the weighted average of any attribute will be infinity. The optional LIST_NAME clause is used to associate attributes with each member of the aggregate. When the aggregate is created, all attributes of each feature joining the aggregate are added as members of the specified attribute list. The index in the list corresponds to the index of the feature's geometry in the aggregate. The optional LIST_ATTRS_TO_INCLUDE_MODE will specify if ALL attributes should be added to a list, or if only the SELECTED attributes (specified with the LIST_ATTRS_TO_INCLUDE clause) should be added to the list. If this value is not specified, it defaults to ALL. For this transformer, "ALL" does not include GroupBy attributes. If the optional COUNT_ATTRIBUTE clause is given, a new attribute will be created on any aggregates output, containing the number of features that were combined to form the aggregate. If the optional ACCUMULATE_ATTRIBUTES clause is specified together with the optional LIST_NAME clause, then each singleton feature that is output will also have a list created on it holding the attributes of the single feature that it was based on. As well, this clause causes the attributes of each member feature of an aggregate to be merged onto the feature being output, in addition to be accumulated in the list. This provides functionality very similar to the ListFactory. Either the ElementFactory or the DeaggregateFactory can then be used to extract the attributes from the list. Tip: When large aggregates are created, the list can require a great deal of memory. In some situations, the @KeepAttributes should be used in the AggregateFactory's input clause to reduce the number of attributes that become part of the list. If the optional GEOMETRY_NAME_FIELD clause is supplied, then each geometry's name will be set, before being added to the aggregate, using the value from the attribute specified. Additionally, the aggregate returned will be interpreted as containing independent geometries; that is, each part will be treated as its own complete geometry, separate from the other parts. The PRODUCE_MULTIS clause determines whether the factory will convert any homogenous IFMEAggregates into a multi (IFMEMultiCurve, IFMEMultiArea, IFMEMultiPoint, IFMEMultiSolid, IFMEMultiSurface, or IFMEMultiText) This factory is similar to the ListFactory. The ListFactory aggregates attribution, while the AggregateFactory aggregates geometry (and possibly also attribution). Features with geometries aggregrated by this factory may be routed to formats that accommodate aggregates for output. Tip: The DeaggregateFactory is used to split aggregates up into their components. If the OUTPUT SINGLETON clause is specified, features that are the only members of their group are output unchanged (but if the ACCUMULATE_ATTRIBUTES and LIST_NAME clauses were present, singleton will have a list of their attributes added as well). If OUTPUT SINGLETON is not specified, an aggregate containing only one geometry will be output for the group. Output Tags The AggregateFactory supports the following output tags. AGGREGATE The features that have aggregate geometry. If the SINGLETON tag is specified, then each of these features will have at least two geometries in it. SINGLETON Applies to features that are the only members in a group. If this is not specified, then such features are output using the AGGREGATE tag creating a geometric aggregate with only one geometry in it. If an OUTPUT SINGLETON clause is specified, such features are output unchanged.