Syntax FACTORY_DEF PolygonFactory [FACTORY_NAME ] [INPUT FEATURE_TYPE [ ]* []*]* [REMOVE_CORRIDORS [(YES|NO)]] [PRESERVE_ORIENTATION [CLOCKWISE|COUNTER_CLOCKWISE]] [FLUSH_BEFORE_CURRENT_WHEN ] [FLUSH_AFTER_CURRENT_WHEN ] [GROUP_BY []+]* [FLUSH_WHEN_GROUPS_CHANGE (Yes|No)] (END_NODED|VERTEX_NODED) [REPORT_PROGRESS [(YES|NO)]] [ALLOW_CYCLES [(YES|NO)]] [HANDLE_ARCS_AND_ELLIPSES [(YES|NO)]] [LIST_NAME {}] [ATTRS_TO_INCLUDE []* ] [ATTRS_TO_INCLUDE_MODE (ALL|SELECTED)] [CONSIDER_NODE_ELEVATION [(YES|NO)]] [CONNECT_Z_MODE (EXTEND|AVERAGE|FIRST_WINS|LAST_WINS|IGNORE_Z)] [ACCUMMULATE_ATTRIBUTES (YES|NO|REPRESENTATIVE)] [LINES_AS_SEGMENTS [(YES|NO)]] [REJECT_INVALID_GEOM (Yes|No)] [DEAGGREGATE_INPUT (Deaggregate|Reject)] [OUTPUT (POLYGON|LINE|REJECTED) FEATURE_TYPE [ ]* []*]* Overview This factory takes linear features to form topologically correct polygons. Any lines that cannot be formed into polygons are joined together to create maximum length linestrings. The input linear features may be partitioned by the GROUP_BY clause. If the GROUP_BY clause is not specified, then all inputs will be processed together. 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. The output features have the same coordinate system as the partitioned input features. If there are conflicting coordinate systems set (empty coordinate systems are considered non-conflicting) within a partition, then the output feature will have no coordinate system set. No attributes are carried across from the INPUT features to the output features. However, all OUTPUT features are assigned the GROUP_BY attributes before being output. If the OUTPUT LINE clause is not specified, then lines that are not part of a polygon will be deleted. The REMOVE_CORRIDORS directive is used to preprocess any input linework to remove any zero-width corridors that may have been present. Such corridors are used by some systems to connect holes to their enclosing polygon. This clause has no use unless the data comes from this type of a system. When it is used, VERTEX_NODED must be specified. The END_NODED and VERTEX_NODED directives tell the factory about the topology of the input features. END_NODED indicates that all features begin and end at topologically significant points, and that none of their vertices connect with any other features. VERTEX_NODED indicates that every vertex may be topologically significant and must be considered when looking to form polygons. Note: If these settings do not accurately represent the input data, you may get undesirable results (including dropped features and missing data). Ensure that the lines are topologically correct. They must not self- intersect or intersect each other, and they must close at nodes. ALLOW_CYCLES specifies that coordinate "cycles" within a polygon are allowable; such polygons might be considered invalid by other parts of FME or by output formats. A "cycle" is a line segment that occurs twice in the same polygon's boundary (once in each direction). If LIST_NAME is given, then a list will be created on each output feature, containing an element for each input feature which contributed to that geometry, in order of appearance. This applies to LINE as well as POLYGON output. The optional ATTRS_TO_INCLUDE_MODE will specify if ALL attributes should be added to a list, or if only the SELECTED attributes (specified with the ATTRS_TO_INCLUDE clause) should be added to the list. If this value is not specified, it defaults to ALL. If CONSIDER_NODE_ELEVATION is present, then the Z value will be used to determine if lines are joined. If CONDISER_NODE_ELEVATION is false or absent, then the Z value will not be considered when decided to join two lines. CONNECT_Z_MODE specifies how differing Z values should be treated, if two segments with differing Z values are being joined. EXTEND will add a vertical line segment to connect the points with differing Z values. AVERAGE will move the overlapping endpoints to have a Z value halfway between the two old endpoints. FIRST_WINS will take the Z value of the first of the two overlapping endpoints encountered. LAST_WINS will take the Z value of the last of the two overlapping endpoints encountered. IGNORE will preserve all Z values, and use paths to connect line segments that are not contiguous in Z. ACCUMULATE_ATTRIBUTES specifies if attributes should be populated on the output features. NO means that no attributes should be put on the output feature. Yes means that all attributes should be copied onto the output feature. REPRESENTATIVE means that attributes from a single input feature should be used to populate the attributes of the output feature. If the LINES_AS_SEGMENTS directive is given, then when lines originating from different input curves are concatenated into a longer curve in the output, they will be left as separate segments in a path. By default, such lines will be joined into longer lines in the output unless they have different properties (e.g. traits, measures, geometry name). The REPORT_PROGRESS directive tells the factory to log statistics about the factory's progress during translation. The PRESERVE_ORIENTATION directive instructs the factory to follow the arc directions. This is useful when building polygons from a series of lines that do not form a polygonal coverage and polygons are to be constructed only where the directed arcs form polygons. If CLOCKWISE is specified, then only polygons with arcs directed in a clockwise direction will be built. If COUNTER_CLOCKWISE is specified, then only polygons with arcs directed in a counterclockwise direction will be built. If the FLUSH_BEFORE_CURRENT_WHEN tag is specified, the factory will perform the test defined by this clause every time it receives an input feature. If the result of the test is true, then the factory will flush out all stored features via the OUTPUT clauses before processing the input feature. If the result is false, the feature will be processed and the factory will not be flushed. The FLUSH_AFTER_CURRENT_WHEN tag operates identically except that the factory is flushed after the current input feature processed instead of before. The is one of <, >, =, !=, >=, <=. The may be a literal constant, an attribute name preceded by the value-of operator (&), or an attribute value function. If it is an attribute value function, the function will be executed on the current feature and the result will be used for the test. The example FLUSH_BEFORE_CURRENT_WHEN and FLUSH_AFTER_CURRENT_ WHEN clauses include: FLUSH_BEFORE_CURRENT_WHEN @Area() < 100 FLUSH_AFTER_CURRENT_WHEN &numLanes > 2 FLUSH_BEFORE_CURRENT_WHEN "Joe" = "Jerry" At run-time, the PolygonFactory decides to invoke numeric comparisons or string comparisons, as greater than and less than, that have different meanings depending on the type of operands. If both arguments may be converted to numbers, then numeric comparisons will be used, otherwise string comparisons will be used. The factory processes all input features and outputs appropriate results each time it is flushed, or once the last feature is input to the factory. When REJECT_INVALID_GEOM is Yes, the factory will output invalid features to Rejected port. Assumptions This factory assumes that all input lines are topologically noded. Output Tags The PolygonFactory supports the following output tags. LINE Maximum length of line features that are not part of any polygon. POLYGON Polygon features formed from the input linework. REJECTED Features from which it is impossible to build an area are outputted here.