FeatureTypeFilter Transformer

Description

A FeatureTypeFilter routes input features to different output ports based on their original feature type. It is especially useful when you have combined several input features for a particular operation (e.g. a Clipper) but want to filter them afterwards in order to route them differently. This is part of the FME Best Practice concept.

After making a connection to the Input port of the FeatureTypeFilter, open the parameters and click Update (or manually enter the feature type name. FME analyses the workbench at that point and determines the possible input feature types. The corresponding output ports are then created. Every time a new connection is made, the list of ports needs to be updated by using the Update button. However, when a connection is removed and the FeatureTypeFilter is updated, the corresponding output port is removed, as well as any connections made from there. To avoid this, proceed with caution.
 

Example

 The attached workspace(FeatureTypeFilter Example) shows an example use of the FeatureTypeFilter transformer.
 

Scenario

The FeatureTypeFilter divides data up according to source feature type (layer). In this example a user has four source feature types, and wishes to calculate the length of features in all of these. Rather than using four separate LengthCalculator transformers he elects to merge the data into one, followed by a FeatureTypeFilter in order to divide up the data into its original layers. Extra schema-mapping functionality on the FeatureTypeFilter is then used to create the proper destination schema.
 

Best Practice

This transformer is an example of Best Practice because it is a way by which users can avoid duplicating a series transformers within their workspace. The other method would be to use a Custom Transformer.

User-added image

Workspace Screenshots


1) The user adds the source dataset.


2) [Not shown]The user adds a destination dataset, but elects not to add new feature types.

User-added image

3) The user adds a LengthCalculator and connects the source feature types. He also adds a FeatureTypeFilter...

User-added image

4) The user connects the FeatureTypeFilter. Now open the properties dialog and click the update button and the various Output ports will be generated.

User-added image

5) Now some clever schema mapping. The user right-clicks the FeatureTypeFilter and chooses the AutoConnect option.

User-added image

6) In the AutoConnect dialog the user chooses to create new destination feature types, copying the attribute schema from the source attribute schema for feature type level1 and adding the feature types to the only destination dataset available, FMEOutput [FFS].

User-added image

7) The finished workspace, with auto-created feature types.