FeatureJoiner
Joins features by combining the attributes/geometry of features based on common attribute values, like a SQL join operation.
A Left feature matches a Right feature when every pair of keys specified in the Join On table has the same value. When a match occurs, attributes/geometry from the Left and Right feature are combined, and the combined feature is output to the Joined port.
Features that are not joined are output to the UnjoinedLeft or UnjoinedRight port.
Input Ports
Features comprising the left table for the join.
Features comprising the right table for the join.
Output Ports
Features resulting from a completed join.
Features from the Left input that were not joined.
Features from the Right input that were not joined.
Invalid features from any input port. Features will be rejected if a Join On value is missing or null.
Parameters
Transformer
The input features may be partitioned by the Group By parameter. If you choose any Group By attributes, then references between features will only be resolved if they share a common value for the selected attributes.
If you do not choose any Group By attributes, all features are processed together.
If you have more than one Reader, a typical use is to group by reader_id to ensure that references are resolved within the correct set of features.
Join Mode
Specifies the type of join to perform.
Inner: The Joined output includes all pairs of Left and Right features that have matching values for the Join On keys. Left features and Right features that did not match will be output through the UnjoinedLeft and UnjoinedRight ports, respectively. This is equivalent to an INNER JOIN in SQL.
Left: The Joined output includes all features from the Left input, and the matched features from the Right input. When a feature from the Left input has no matches from the Right input, the attributes from the Right will be set to null. When a feature from the Right input has no matches from the Left input, it will be output the UnjoinedRight port. This is equivalent to a LEFT JOIN in SQL.
Full: The Joined output includes all features from the Left and the Right input. When a feature from one input does not have a match in the other input, the attributes from the other input will be set to null. This is equivalent to a FULL JOIN in SQL.
When both the Left and Right inputs share a common attribute, this specifies which value should be preferred for the Joined output.
Specifies what geometry will be used for Joined features.
Use Left: The geometry from the Left input will be used, and the geometry from the Right input will be discarded.
Use Right: The geometry from the Right input will be used, and the geometry from the Left input will be discarded.
Aggregate Left and Right (Enforce Unique Names): The geometry from both the Left and Right inputs will be preserved, and each geometry part will be given a unique name.
- Output geometries will retain their original names if already unique.
- Unnamed geometries will be named based on their input port (i.e. Left or Right).
- Otherwise all geometries from input features will be preserved on Joined output features by renaming geometries to avoid conflicts.
- The Right input port will be prepended to conflicting geometry names. The Left geometry names will remain unchanged.
- If multiple name conflicts occur, an index will be appended to the name, starting at 2.
Geometry Aggregation Examples
Left Input Geometries |
Right Input Geometries |
Output Geometries |
---|---|---|
A | B | A B |
Unnamed | Unnamed | Left Right |
A | A | A Right_A |
A Right_A | A | A Right_A Right_A2 |
Join On
Specifies the attributes to compare from the Left and Right inputs to determine matching features. A Left feature matches a Right feature when every pair of keys specified in the Join On table has the same value.
The Comparison Mode column specifies how to perform the comparison between Left and Right attribute values. If Automatic or Numeric is specified, an attempt will be made to convert attribute values to numbers before comparing them.
Usage Notes
Relationship to FeatureMerger
The FeatureMerger originates in geometry handling and duplicate handling and collisions. The FeatureJoiner is a simpler SQL based perspective that joins features as rows. The FeatureJoiner is expected to have better performance.
With regards to attribute naming collisions, with the FeatureMerger it is possible to have an attribute that may take the value from the Requestor for some features, and the Supplier for other features (depending on naming collisions). With the FeatureJoiner, attributes will always come from the Left, or always come from the Right: there is no merging.
The FeatureJoiner does not perform some of the advanced list building or geometry handling operations that the FeatureMerger does, but these may be possible by using the FeatureJoiner plus other transformers.
Relationship to InlineQuerier
The InlineQuerier is a powerful cousin of the FeatureJoiner. Whereas the FeatureJoiner only can perform a simple join operation between two tables, the InlineQuerier can use the full power of SQL across any number of tables. Furthermore, the InlineQuerier allows its input data to be reused multiple times in a single transformer, whereas if multiple joins are to be done with a FeatureJoiner, multiple FeatureJoiner transformers must be employed and copies of the features sent to each. On the other hand, there is some overhead for the InlineQuerier to load the underlying SQLite database, so the FeatureJoiner is expected to have better performance if performing a comparable operation.
Relationship to DatabaseJoiner
The DatabaseJoiner merges input features to features from a single other source. Since more than one connection can be made to the FeatureJoiner’s input ports, features can come from multiple different sources.
Editing Transformer Parameters
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Transformer Categories
Search FME Knowledge Center
Search for samples and information about this transformer on the FME Knowledge Center.