Syntax FACTORY_DEF MatchingFactory [FACTORY_NAME ] [INPUT FEATURE_TYPE [ ]* []*]* [MATCH_GEOMETRY (2D|3D|FULL|NONE)] [LENIENT_GEOMETRY_MATCH [(yes|no)]] [LENIENT_APPEARANCE_MATCH [(yes|no)]] [MATCH_GEOMETRY_STORAGE [(yes|no)]] [EXTRA_VERTEX_TOLERANCE ] [INTERIOR_VERTEX_TOLERANCE ] [MATCH_ATTRIBUTES [(|fme_regexp_match )]*] [MATCH_ALL_ATTRS_EXCEPT [(|fme_regexp_match )]*] [MATCH_ALL_ATTRIBUTES [(yes|no)]] [DIFFERING_ATTRIBUTES [(|fme_regexp_match )]*] [BLANK_AND_MISSING_DIFFER [(yes|no)]] [ADD_TO_MATCHED [ ]+] [SINGLE_MATCHED_LIST_NAME ] [SINGLE_MATCHED_COUNT_ATTR ] [OUTPUT (MATCHED|NOT_MATCHED|SINGLE_MATCHED|FAILURE_POINT) FEATURE_TYPE [ ]* []*]* Overview This factory can be used to detect and flag features that are matches of each other. Features are declared to match when they have matching geometry and matching attribute values. The specification of the factory determines how matches are declared. This factory is often used with the Multi-Reader to identify features that two files have in common. In this way, the factory can also be used to perform change detection between the input files. In conjunction with the Multi-Reader, it is able to identify all features that two input files have in common, and those which are in one file and not the other, such as the additions and the deletions. Assumptions The geometry matching considers the geometries of two polygons, donuts, or aggregates to be equivalent even if they differ in the starting point of their rings or the order of their components. The geometry matching only considers lines to match if the direction of the lines is the same (that is, the start and end points correspond). Lines that are coincident, but have differing directions, will not match. Clauses The MatchingFactory makes use of several optional clauses to specify its operation. MATCH_GEOMETRY (2D|3D|FULL|NONE) Controls if 2D, or 3D, or no geometry must be the same before a match is declared. Full may be set so that 3D, measures and geometry attributes must all match. When comparing raster geometries: 2D matches the properties, 3D matches the properties and values and FULL matches the properties, values and geometry attribute. When comparing surface or solid geometries: 2D behaves the same way as 3D, that is, Z values are always compared. When comparing point cloud geometries: 2D and 3D match properties, and FULL matches properties and component values. Default: None Example:MATCH_GEOMETRY 2D LENIENT_GEOMETRY_MATCH [(yes|no)] Controls how the linear and area geometries will be compared. If this flag is set to yes, the orientation direction and start point of the rings will be ignored when comparing area geometries. For linear features, the direction of the feature will be ignored while making comparisons.When this clause is set to no, all geometries are compared strictly (that is, they are compared coordinate by coordinate). When comparing raster geometries only the extents are compared. This factory returns an error if input contains a surface or solid geometry and this flag is set to yes as it is not supported yet. Default: no MATCH_GEOMETRY_STORAGE [(yes|no)] If set to no, this means that geometries will match if their content is the same, but not necessarily the internal representation (Classic/Rich). If set to yes, this means that the content must be the same AS WELL AS the internal representation. Classic geometries will then not match Rich ones, ever. This is an internal, undocumented clause, for now. Default: no INTERIOR_VERTEX_TOLERANCE When geometry is being matched, this controls how close together interior vertices must be in order for them to be declared a match. Note: The start and end points of features must be identical for a match to be declared. The value is measured in ground units of the feature.This value is ignored when matching surface and solid geometries. Default: 0 Example:INTERIOR_VERTEX_TOLERANCE 2.0 EXTRA_VERTEX_TOLERANCE When geometry is being matched, this controls how close any extra vertices in a feature must be to the line connecting the adjoining matching vertices.This value is ignored when matching surface and solid geometries. Default: None Example:EXTRA_VERTEX_TOLERANCE 1 MATCH_ATTRIBUTES [(|fme_regexp_match )]* Controls which attributes that are part of the input feature must have the same value before a match is declared. Attribute names may be listed explicitly or through a regular expression preceded with the special fme_regexp_match token. The values from all attributes matching the regular expression are concatenated together and compared to determine a match. See RE Construction in the @RemoveAttributes section. Default: No Attributes Example:MATCH_ATTRIBUTES type MATCH_ALL_ATTRS_EXCEPT [(|fme_regexp_match )]* Instead of specifying MATCH_ATTRIBUTES, this clause can be used. In this case, the names and values of all attributes which are not explicitly given, and which do not match any regular expression specified after the token, are concatenated to determine a match. This clause can be given with no arguments in order to force matching of all attributes. See RE Construction in the @RemoveAttributes section. (Any attributes specified with DIFFERING_ATTRIBUTES will also be excluded from this match.) Default: No Attributes Example:MATCH_ALL_ATTRS_EXCEPT multi_reader_id MATCH_ALL_ATTRIBUTES [(yes|no)] This clause causes similar behavior to MATCH_ALL_ATTRS_EXCEPT, except that the only fields excluded from the match are those given by DIFFERING_ATTRIBUTES, if any. DIFFERING_ATTRIBUTES [(|fme_regexp_match )]* Controls which attributes that are part of the input feature must have different values before a match is declared. Attribute names may be listed explicitly or through a regular expression preceded with the special fme_regexp_match token. The values from all attributes matching the regular expression are concatenated together and compared to determine a match. See RE Construction in the @RemoveAttributes section. Default: No Attributes Example: DIFFERING_ATTRIBUTES multi_reader_id BLANK_AND_MISSING_DIFFER [(yes|no)]* If yes, then an attribute (specified by either MATCH_ATTRIBUTES, MATCH_ALL_ATTRS_EXCEPT, or DIFFERING_ATTRIBUTES) will be considered different for two features when one feature contains the attribute with a blank value and the other feature does not contain the attribute at all. ADD_TO_MATCHED [ ]+ Contains a series of attribute names and values to be added to each matched feature. Note: If the value was a function, it will only be invoked once and the same return value will be added to each matched feature. This can be used to assign a unique ID to each group of matching features, as the following example shows. Default: None Example: ADD_TO_MATCHED match_id @Count(Matches) If features a, b, and c all match, then a, b, and c will have the same value for match_id, and no other features will have this value. SINGLE_MATCHED_LIST_NAME If specified, a list with the given name is created on each feature output by the SINGLE_MATCHED tag. The contents of the list are the attributes of all input features corresponding to a given output feature. SINGLE_MATCHED_COUNT_ATTR If specified, an attribute with the given name is created on each feature output by the SINGLE_MATCHED tag. Its value is the number of input features that correspond to this merged output feature. Output Tags The MatchingFactory supports the following output tags. MATCHED Features found to have matches are output using this tag. SINGLE_MATCHED The first feature from each matching group of features are output using this tag. A copy of the same feature is also output via the MATCHED tag. This is useful when only one feature from a matching group is desired. The attributes from all features are also copied to features output via this clause. NOT_MATCHED Features found to have no matches are output using this tag. FAILURE_POINT Point features marking where features with matching attributes and start points diverge are output via this tag. The geometry of these features is the point at which the divergence began. TO BE RESOLVED Added LENIENT_APPEARANCE_MATCH clause to syntax, but not documented.