The Generic Writer

A Generic Writer is used in the same way as any other Writer; by specifying the format in the new Reader dialog:

Unlike the Generic Reader, the Generic Writer cannot determine the format to write by a file extension, so it has to use a Format Parameter to specify the output format:

Whatever format is chosen will be the format the data is written in. The same parameter is available in the Navigator window once the workspace is created.

This parameter is one of those that FME automatically creates a linked user parameter for. That way the end-user can choose at runtime which format to write to.

The Destination Dataset parameter, like all dataset parameters, is also linked to a user parameter. Note that the destination for this writer is always a folder, even when the selected format is file-based.


Sister Intuitive says…
It’s important to remember that FME sometimes transforms output data to fit the definitions and rules of the destination format. Therefore, the same Generic Writer may produce slightly different results for different data formats.

Generic Writer Feature Types

Feature Types are less of an issue for the Generic Writer (than the Generic Reader) because they are already pre-defined in the workspace.

The main limitation will be if you wish to have both a Generic Reader and Generic Writer, with the Reader accepting any layers and the Writer writing ones to match.

In that scenario, you could use a feature type fanout with the Generic Writer, based on the format attribute fme_feature_type. Then the destination dataset will have the same layers as the source – even if that varies from translation to translation!


Generic Writer Parameters

Like the Generic Reader, the Generic Writer has only one or two parameters of its own (output format being one of them). To apply a particular format parameter you need to add a dummy Writer of the same format.

The dummy Writer does not need to have any feature types defined, or any data sent to it; in fact it should not as this would only slow the translation.

Here, for example, the author has added a dummy GML Writer (with no feature types) in order to use the parameters for GML writing.


Sister Intuitive says…
Generic Readers and Writers by nature only deal with a flexible format, but can also be set up to be flexible with layers.

However, each dataset being read must have the same attribute schema, and each dataset being written will end up with the same attribute schema. This part is not flexible.

Flexible attribute schemas require the use of either Automatic Attribute Definitions or a Dynamic Translation.

Miss Vector says…
Now tell me which of these statements about Generic Reading/Writing are true?

1. Because you select an output folder, the Generic Writer won't write to a file format like AutoCAD DWG
2. If the feature types of the chosen format are limited to a single geometry, the Generic Writer will drop all features except a single geometry type
3. The Generic Writer does not support either type of Fanout
4. The ParameterFetcher transformer can be used to retrieve the format of data being Read/Written in order to route features in a specific way through the workspace

results matching ""

    No results matching ""