Writer Directives

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

DATASET

Required/Optional: Required

The value for this directive is the writer connection string. The connection string is a specially encoded string specifying all information required to establish a connection through an FDO Provider.

The connection string is encoded with an XML-like encoding. By entering the connection information into the format settings box dialogs, Workbench will automatically encode the connection string properly. To encode the connection string manually within a mapping file or FME Objects, contact Safe Software.

Workbench Parameter: Destination FDO Provider Connection String

DEF

Required/Optional: Required

The FDO writer uses FDO_DEF lines to define feature classes. A typical mapping file fragment specifying an output feature class looks like:

FDO_DEF <featureName> \
	[fdo_index_column <fdo_index_column>]	\
	[fdo_writer_mode <fdo_writer_mode>] \
	[fdo_geometry_column <fdo_geometry_column>] \
	[fdo_overwrite_table <fdo_overwrite_table>] \								
	[<attributeName> <attributeType>[,<indexType>]]*

The configuration parameters present on the definition line are described in the following table:

Parameter

Contents

featureName

This declares the name of the Feature Class.

fdo_identity_column

This specifies the name of the default index data property that is created if no user attribute is specified as an IDENTITY attribute.

Default: PRIMARYINDEX

fdo_writer_mode

This specifies the feature type level writer mode settings. Valid values are INSERT, UPDATE, DELETE, and INHERIT_FROM_WRITER.

Note that INSERT mode allows for only INSERT operations where as UPDATE and DELETE can be overwritten at the feature levels. INHERIT_FROM_WRITER simply indicates to take this value from the writer level and not to override it at the feature type level.

Default: INHERIT_FROM_WRITER

fdo_geometry_column

This specifies the name of the geometry property that will hold the geometry when creating a new Feature Class.

Default: Geometry

fdo_overwrite_table

This specifies the action to be taken if a Feature Class already exists in the destination Datastore with the name specified by featureName. Valid values are INHERIT_FROM_WRITER, YES, NO, and TRUNCATE.

Default: INHERIT_FROM_WRITER

attributeName

This declares the name of the data property. The maximum length of property names is 100 characters.

attributeType

This declares the type of the data property. The valid values are listed below:

boolean

datetime

decimal(width, precision)

int16

int32

int64

byte

single

double

char(width)

blob(width)

clob(width)

indexType

The valid value is for this parameter is IDENTITY.

Attributes with an IDENTITY index type must uniquely identify the feature within the Feature Class: features with non-unique values for IDENTITY attributes cannot be inserted into the destination FDO Datastore. If multiple attributes are declared with an IDENTITY index type, then those multiple attribute form a composite identity property.

DEFAULT_SCHEMA_NAME

Required/Optional: Optional

This directive specifies the FDO Schema name that is used if the destination feature type name lacks the Schema name component. If this directive is unspecified, then the string “Default” is used as the default Schema name.

DEFAULT_SCHEMA_NAME Default

Workbench Parameter: Default Schema Name

WRITER_MODE

Required/Optional: Optional

Note: For more information on this directive, see the chapter Database Writer Mode.

This directive specifies the operations that will be performed by default by this writer. The operations are INSERT, UPDATE, or DELETE. The default writer-level value for this operation can be overwritten at the feature type level. The corresponding feature type DEF parameter name is called WRITER_MODE. It has the same valid options as the writer-level mode, as well as the value INHERIT_FROM_WRITER, which causes the writer-level mode to be inherited by the feature type as the default for features written to that feature type.

The operation can also be set specifically for individual features, using the fme_db_operation attribute. Note that when the writer mode is set to INSERT, this prevents the mode from being interpreted from individual features and all features are inserted unless otherwise marked as update or delete features. These are skipped.

If the WRITER_MODE directive is not specified, then a value of INSERT is given.

FDO_WRITER_MODE INSERT

Workbench Parameter: Writer Mode

OVERWRITE_ALL_TABLES

Required/Optional: Optional

This directive informs the FDO writer on the actions to take on each Feature Class by default when the first feature is written to that Feature Class. Valid values are YES, NO, and TRUNCATE.

If the value is YES, then the Feature Class definition is destroyed then newly created before the first feature is written to that Feature Class. All existing features in the Feature Class will be erased, and any modifications made to the Feature Class definition will be reflected in the created Feature Class. The destination FDO Provider must support the Delete command and the ability to modify existing FDO Schemas.

If the value is NO, then the writer does not perform any actions. Features will be appended to the Feature Class.

If the value is TRUNCATE, then all features of that Feature Class will be erased, but the Feature Class definition stays intact: any changes made to the destination feature type will not be applied to the Feature Class definition in the destination Datastore.

The default writer-level value for this operation can be overwritten at the feature type level. The corresponding feature type DEF parameter name is called OVERWRITE_TABLES.. It has the same valid options as the writer-level mode, as well as the value INHERIT_FROM_WRITER, which causes this setting to be inherited by the feature type as the default for features written to that feature type.

If the OVERWRITE_ALL_TABLES directive is not specified, then a value of NO is given.

FDO_OVERWRITE_ALL_TABLES NO

Workbench Parameter: Overwrite all tables

BATCH_INSERT

Required/Optional: Optional

This directive specifies the number of features inserted for each invocation of the insert command. Batch inserts can significantly increase writing speeds if the FDO Provider accesses the destination Datastore through a network connection since batch inserts decreases the number of network round-trips required to write features. If the FDO Provider does not support batch inserts, then the writer will automatically revert to one feature per insert. The default number of features per insert is one.

FDO_BATCH_INSERT 1

Workbench Parameter: Features per batch

TRANSACTION

Required/Optional: Optional

This directive specifies the transaction policy.

Valid values are NONE and TRANSLATION.

If NONE is specified, the writer will not use transactions when writing through the FDO Provider. The specific behavior is dependent on the FDO Provider, but commonly, if the translation halts before the successful completion of the translation, then changes made to the destination Datastore will not be rolled-back.

If the value is TRANSLATION, then all commands executed will be part of a single transaction, and the transaction will be committed at the conclusion of the translation. If the translation halts before the successful completion of the translation, then changes are expected to be rolled-back and the destination datastore is left in the exact state as it was before the translation was executed. The default value is TRANSLATION. If the FDO Provider does not support transactions, the translation will continue without using transactions.

Mapping File Syntax

FDO_TRANSACTION TRANSLATION

Workbench Parameter

Transaction setting

SPATIAL_CONTEXT_NAME

Required/Optional: Optional

This directive specifies the FDO Spatial Context to be associated with new Feature Classes automatically created by the writer. If the writer is writing features to an existing Feature Class, then this directive does not affect those features. When a new Feature Class is created, then the writer checks if the Spatial Context specified by this directive exists in the destination Datastore. If the Spatial Context does not exist, then a new Spatial Context is created with the coordinate system of the feature together with the creation parameters specified by the related directives EXTENT_TYPE, XY_TOLERANCE, Z_TOLERANCE, and EXTENT_COORDS. If an existing Spatial Context is found with the specified name, then an action specified by the EXISTING_SPATIAL_CONTEXT directive is performed. If an existing Spatial Context is not found and the FDO Provider does not have the ability to create new Spatial Contexts, then the Provider-dependent default Spatial Context will be associated with the new Feature Class.

If this directive is not specified, then the writer will derive a Spatial Context name from the coordinate system of the first feature written to a feature type. If the feature does not have a coordinate system, then the writer will attempt to use a default spatial context in the destination Datastore.

FDO_SPATIAL_CONTEXT_NAME Default

Workbench Parameter: Spatial Context Name

EXISTING_SPATIAL_CONTEXT

Required/Optional: Optional

This directive specifies the action to take when a new Feature Class is created and the Spatial Context name specified by SPATIAL_CONTEXT_NAME exists in the destination Datastore. Valid values are USE, UPDATE, and DESTROY. If USE is specified, then the existing spatial context is associated with the new Feature Class. If UPDATE is specified, then the writer will attempt to modify the existing spatial context with the coordinate system of the feature and with the parameters specified by the related directives EXTENT_TYPE, XY_TOLERANCE, Z_TOLERANCE, and EXTENT_COORDS. If DESTROY is specified, then the existing Spatial Context is destroyed then newly created. The Spatial Context cannot be destroyed if the Spatial Context is associated with any existing Feature Classes in the destination Datastore.

The default value is USE.

FDO_EXISTING_SPATIAL_CONTEXT USE

Workbench Parameter: Existing Spatial Context

EXTENT_TYPE

Required/Optional: Optional

This directive specifies the extent type used when creating or updating Spatial Contexts. Valid values are DYNAMIC and STATIC. If the value is DYNAMIC, then the extents of the Spatial Context will grow as needed when features are inserted into a Feature Class associated with the Spatial Context. If the value is STATIC, then the extent boundaries specified by the EXTENT_COORDS directive is consulted when creating or updating the Spatial Context.

The default value is DYNAMIC. If the specified extent type is not supported by the FDO Provider, then the other extent type will be used.

FDO_EXTENT_TYPE DYNAMIC

Workbench Parameter: Spatial Context Extent Type

EXTENT_COORDS

Required/Optional: Optional

This directive specifies the extent boundaries used when creating or updating Spatial Contexts. A valid value for this directive is four floating-point numbers separated by spaces. The four numbers specify, in order, the minimum X value, the minimum Y value, the maximum X value, and the maximum Y value of the extent.

The default value is -1000000000 -1000000000 1000000000 1000000000.

FDO_EXTENT_COORDS ‘-1E9 -1E9 1E9 1E9’

Workbench Parameter: Spatial Context extent

XY_TOLERANCE

Required/Optional: Optional

This directive specifies the X/Y-axis tolerance values used when creating or updating Spatial Contexts. Valid values are floating-point numbers. The tolerances are in distance units that depend on the coordinate system.

The default value is 1.0.

FDO_XY_TOLERANCE 1.0

Workbench Parameter: Spatial Context X/Y Tolerance

Z_TOLERANCE

Required/Optional: Optional

This directive specifies the Z-axis tolerance values used when creating or updating Spatial Contexts. Valid values are floating-point numbers. The tolerances are in distance units that depend on the coordinate system.

The default value is 1.0.

FDO_Z_TOLERANCE 1.0

Workbench Parameter: Spatial Context Z Tolerance