Syntax FACTORY_DEF MatchingFactory [FACTORY_NAME ] [INPUT [(ORIGINAL|REVISED)] FEATURE_TYPE [ ]* []*]* [MATCH_GEOMETRY (2D|3D|FULL|NONE)] [LENIENT_GEOMETRY_MATCH [(yes|no)]] [LENIENT_APPEARANCE_MATCH [(yes|no)]] [MATCH_GEOMETRY_STORAGE [(yes|no)]] [VECTOR_TOLERANCE [EXTRA_VERTEX_TOLERANCE ] [INTERIOR_VERTEX_TOLERANCE ] [MATCH_ATTRIBUTES [(|fme_regexp_match |fme_pcre_match )]*] [MATCH_ALL_ATTRS_EXCEPT [(|fme_regexp_match |fme_pcre_match )]*] [MATCH_ALL_ATTRIBUTES [(yes|no)]] [DIFFERING_ATTRIBUTES [(|fme_regexp_match |fme_pcre_match )]*] [BLANK_AND_MISSING_DIFFER [(yes|no)]] [BLANK_AND_MISSING_NAMES_TRAITS_DIFFER [(yes|no)]] [CHECK_TYPES_AND_ENCODINGS [(yes|no)]] [COMPARE_STRINGS_AS_UTF8 [(yes|no)]] [ADD_TO_MATCHED [ ]+] [SINGLE_MATCHED_LIST_NAME ] [LIST_ATTRS_TO_INCLUDE []* ] [LIST_ATTRS_TO_INCLUDE_MODE (ALL|SELECTED)] [SINGLE_MATCHED_COUNT_ATTR ] [ORIGINAL_ATTRIBUTES []*] [UPSERT_MODE [(yes|no)]] [OUTPUT (MATCHED|NOT_MATCHED|SINGLE_MATCHED) 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 VECTOR_TOLERANCE ) When geometry is being matched, this controls how similar two points, curves or areas must be in order for them to be considered a match. Default: NONE Example:VECTOR_TOLERANCE 1e-5 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 |fme_pcre_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 (Obsolete regex syntax) or fme_pcre_match (PCRE regex) 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 |fme_pcre_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 |fme_pcre_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 (Obsolete regex syntax) or fme_pcre_match (PCRE regex) 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. BLANK_AND_MISSING_NAMES_TRAITS_DIFFER [(yes|no)]* If yes, then null, empty, and missing geometry traits (and geometry names) will be treated as distinct ( null!=empty, empty!=missing, missing!=null). If no, then null, empty, and missing geometry traits (and geometry names) will be treated as the same (null==empty==missing). ADD_TO_MATCHED ( | [ ]+ ) This can contain a single attribute name. In this case, a unique value (a count) is added to each matched feature, per group. This could alternatively contain 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) Example: ADD_TO_MATCHED match_id (Note: these two examples would actually do the same thing.) 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. 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. 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. UPSERT_MODE [(yes|no)] If yes, added features will be output through the UPDATED port and all insert and update fmeDB tags will be converted to upsert. 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. TO BE RESOLVED Added LENIENT_APPEARANCE_MATCH clause to syntax, but not documented.