Layer Selection and Handling

Spatial data is often organized in layers (groups, classes, categories, feature types) and a common way that users will wish to choose data in a self-serve system is on a layer-basis.

In FME, feature type (layer) flexibility can be achieved through the Feature Types to Read parameter.

Selecting Layers

Each reader in FME has a parameter called Feature Types to Read. This parameter is used to tell FME which of the feature types in the workspace should be used in the translation.

Here a Reader contains eight feature types. The Feature Types to Read parameter has been set up to read just three of these (Libraries, Parks, TransitStations).

The parameter can be set by the workspace author, but in most cases, it is published so that the end user can select a list of layers to read.


Publishing Feature Types to Read

Choosing to publish the Feature Types to Read parameter results in a dialog that is significantly different to any other parameter definition:

This dialog is a predefined configuration for the parameter. This is possible because FME already knows what feature types exist in the workspace, whereas for a coordinate system parameter, it has no idea what coordinate systems the author wishes to allow.

If the author wishes to define the parameter with an alias, the checkbox for Use Alternate Display Name allows them to do so.


TIP
By default the Feature Types to Read list is originally set by the feature types in the workspace, but will automatically update if this is changed. For example, if the Libraries feature type was removed from the workspace then it would also be removed from this parameter.

So the list is fixed to what appears in the workspace.

However, if any of the Reader feature types has a merge filter set, then the list is no longer fixed. It will show all feature types in the source dataset, whether or not they exist in the workspace!

Grouped Layers

On occasion, it's better to provide a single choice to the user that represents multiple feature types. For example, in this workspace:

...the author might consider it sufficient to provide an option called "Roads" - that encompasses all three reader feature types - rather than "Residential," "Arterial," and "Secondary" as separate entities. If the user chooses to read "Roads", then all three feature types are read.

The way to do this is by using the Alternate Display Name option, and entering the same value for the Display Name:

That way the user is presented with groups instead of individual layers:


Professor Spatial F.M.E., E.T.L. says...
This functionality is useful because of a difference in viewpoint between author and user. The author is asking which layers should be read. But the user is responding to a different question: they are telling us which layers they want to write.

The above example illustrates the case. The user thinks they are choosing to write a layer called Roads, when in reality they are choosing to read three feature types called Residential, Arterial, and Secondary.

results matching ""

    No results matching ""