FeatureTypeFilter
From fmepedia
FeatureTypeFilter is a Workbench Transformer.
| Table of contents |
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, a port is added. 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 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 the 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.
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.

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

4) The user connects the FeatureTypeFilter. In 2006GB or earlier FME automatically adds output ports for each source feature type. But this needs continuous checking which can cause a performance hit in Workbench, so for FME2007 or newer you need to open the properties dialog and click an update button.

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

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].

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