Writer Directives

The directives that are processed by the Generic writer are listed below. The suffixes shown are prefixed by the current <WriterKeyword> in a mapping file. By default, the <WriterKeyword> for the Generic writer is GENERIC.

DATASET

The Generic writer processes use this directive to specify the folder into which it will produce its output.

If at run time, the Generic writer is instructed to output to a format that requires an output filename, the Generic writer will turn the output folder into a filename by appending the last portion of the folder name and the most common file extension (as read from the FME formats database) to the folder.

For example, if at runtime the Generic writer was given an output dataset of

c:/data/roads

and was told to write to a Design file, then it would pass an output dataset of

c:/data/roads/roads.dgn 

to the Design file writer that it would employ to do the actual writing.

Required/Optional

Required

Workbench Parameter

Destination Generic (AnyFormat) Folder

DEF

The Generic writer uses this directive to define the structure of its output feature types.

Required/Optional

Required

Description

The definition specifies the feature type, the geometry that is allowed, and the names and the types of all attributes. The output feature type name will be used in different ways depending on the output format chosen at runtime. In some output formats, the feature type will define a table or filename; in other formats, it will define a layer or level.

If the Generic writer is operating in its “dynamic schema” mode (as directed by a DYNAMIC_SCHEMA directive) the DEF line provides a template of how the writer should modify the input feature type schema definition to form its output feature type definitions. In this mode, the feature type name is disregarded (and typically specified as <DYN>), and there is an optional list which specifies a set of attributes to be removed from the source schema definitions.

The syntax of a GENERIC_DEF line is:

<ReaderKeyword>_DEF <baseName> 	
	fme_type <fmeType> \ 
	[ATTRS_TO_REMOVE <attrList>] \ 
	[<attrName> <attrType>]+

The fmeType restricts the types of geometry that the feature type can accommodate, and must be one or more of these constants:

  • fme_point
  • fme_line
  • fme_area
  • fme_arc
  • fme_text
  • fme_rectangle
  • fme_rounded_rectangle
  • fme_ellipse
  • fme_collection
  • fme_no_geom
  • fme_raster
  • fme_any

fme_any is used to signify that any potential geometry is allowed, while the other constants identify specific kinds of geometry that are accepted by the feature type. If the feature type should allow a subset of geometries, then these can be space delimited and enclosed in quotation marks:

GENERIC_DEF roads  \
	fme_type  "fme_line fme_arc" \
...

The optional ATTRS_TO_REMOVE keyword may be present when the Generic writer is operating in “dynamic schema” mode. Its attrList argument defines a set of attributes which are not copied from any source schema features to the generated output definitions. This set is defined as a single, space delimited list, which must appear enclosed in quotation marks if there is more than one such attribute:

GENERIC_DEF roads  \
	fme_type  "fme_line fme_arc" \
	ATTRS_TO_REMOVE  "width direction" \
...

The following table shows the attribute types that are supported by the Generic writer. If an output format does not support a particular attribute type, the Generic writer will attempt to do its best to pick the closest supported output attribute type, if one is available, otherwise, an error is reported.

Field Type

Description

char(<width>)

Character fields store fixed length strings. The width parameter controls the maximum number of characters that can be stored by the field. No padding is required for strings shorter than this width.

varchar(<width>)

Variable length character fields store variable length strings. The width parameter controls the maximum number of characters that can be stored by the field. If the target format cannot support variable length fields, these will be turned into char(<width>) fields.

buffer

Unknown length character fields store strings whose length is unknown and potentially unbounded. If the target format cannot support unbounded length fields, these will be turned into varchar(255) or char(255) fields.

date

Date fields store dates as character strings with the format YYYYMMDD.

datetime

Datetime fields store datetimes as character strings with the format YYYYMMDDhhmmss.ss.

decimal(<width>,

<decimals>)

 

Decimal fields store single and double precision floating point values. The width parameter is the total number of characters allocated to the field, including the decimal point. The decimals parameter controls the precision of the data and is the number of digits to the right of the decimal.

real32

real32 fields store single precision floating point values.

real64

real64 fields store double precision floating point values.

int32

int32 fields store 32 bit signed integers.

boolean

Boolean fields store TRUE/FALSE data. Data read or written from and to such fields must always have a value of either true or false.

int16

int16 small integer fields store 16 bit signed integers and therefore have a range of -32,768 to +32,767.

FORMAT

This directive specifies the FME "short name" of the format that will be used at runtime to output the data.

Format short names are listed in the Quick Facts as part of each writer's documentation, in the Reader/Writer Gallery in Workbench, and can also be queried for at runtime using a GUI WRITERPICK directive.

Required/Optional

Required

Mapping File Syntax

GENERIC_FORMAT SHAPE

Workbench Parameter

Output Format

DYNAMIC_SCHEMA

This directive specifies whether the writer should operate in a special “dynamic schema” mode. In this mode, the actual output feature type definitions are computed at runtime, based on the schema definitions reported by the readers associated with the translation.

A single, specially formatted DEF line directive directs the writer on how to modify the schema features to form the target writer’s feature type definitions.

When operating in this mode, the Generic writer routes each feature to the automatically generated definition whose name matches the feature’s type.

Required/Optional

Optional

Values

YES | NO (default)

Mapping File Syntax

DYNAMIC_SCHEMA Yes

Workbench Parameter

Dynamic Schema Mode

READER_SCHEMAS_TO_SKIP

This directive limits the set of readers from which a Generic writer in “dynamic schema” mode retrieves schema information for the output features.

Normally all readers referenced by a Multi-reader are polled for schema information. When this directive is specified with a non-empty value, the Generic writer will parse its value as a comma-separated list of numeric indices of readers whose schema is not to be considered. The readers within the Multi-reader whose positions are in the specified list will not be consulted when the Generic writer generates its output feature type definitions.

If this directive is not present, all input readers’ schema will contribute to the output feature type definitions.

Required/Optional

Optional

Mapping File Syntax

READER_SCHEMAS_TO_SKIP 0,2,4

Workbench Parameter

Comma-separated List of Reader Schemas to Ignore