Writer Directives

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

DATASET, USER_NAME, PASSWORD, BEGIN_SQL{n}, and END_SQL{n}

The DATASET, USER_NAME, PASSWORD, BEGIN_SQL{n}, and END_SQL{n} directives operate in the same manner as they do for the Informix Spatial reader. The remaining writer-specific directives are listed below.

DEF

Required/Optional: Required

Each Informix Spatial table must be defined before it can be written. The general form of an Informix Spatial definition statement is:

INFXSPATIAL_DEF <tableName> \
    [infx_type <type>]	\
    [infx_overwrite_table <YES|NO|TRUNCATE>] \
    [infx_update_key_columns <column>[,<column>]...] \
    [infx_delete_key_columns <column>[,<column>]...]  \
    [infx_geometry_column <geometry>] \
    [infx_multi_geometry <YES|NO|FIRST_FEATURE>] \
    [infx_offset_x  <x offset value>] \
    [infx_offset_y  <y offset value>] \
    [infx_scale_x <x/y scale value>] \
    [infx_srid <SRID value>] \
    [<fieldName> <fieldType>]*

The table definition allows complete control of the layer that will be created. If the layer already exists, the majority of the DEF line parameters will be ignored and need not be given.

If the table does not exist, then the field names and types are used to first create the table. In any case, if a <fieldType> is given, it may be any field type supported by the target database.

The Informix Spatial writer will use the infx_geometry_column parameter to set the name of geometry column for the new table. If the infx_geometry_column parameter is not specified then a default name of “geometry” will be used for the geometry column.

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

Parameter

Contents

infx_type

This specifies the type of geometry the features to be written to the layer will have.

infx_overwrite_table

This parameter can be set to one of <YES|NO|TRUNCATE>. If YES, then the table will be dropped and created again. If TRUNCATE, then all the rows from the table will be deleted. If NO, then data will be appended to the existing table.

infx_update_key_
columns

This instructs the Informix Spatial writer to perform an UPDATE operation on the table, rather than performing an INSERT. The argument is a comma-separated list of the columns which are matched against the corresponding FME attributes’ values to specify which rows are to be updated with the other attribute values.

For example:

infx_update_key_columns ID,NAME

In this case the FME attribute is always matched against the Informix column with the same name. Also, the target table is always the feature type specified in the DEF line. Each column listed with the infx_update_key_columns directive must be defined with a type on the DEF line, in addition to the columns whose values will be updated by the operation. This cannot be used with infx_delete_key_columns. Also, the keys cannot be of type BLOB, CLOB, or LONG_VARCHAR.

infx_delete_key_
columns

This instructs the Informix Spatial writer to perform a DELETE operation on the table, rather than performing an INSERT. The argument is a comma-separated list of the columns which are matched against the corresponding FME attributes’ values to specify which rows are to be deleted when their values match the other attribute values.

For example:

infx_delete_key_columns ID,NAME

would delete those rows in the table whose values match the attribute values passed in through this DEF line. The FME attribute is always matched against the Informix Spatial column with the same name. Also, the target table is always the feature type specified in the DEF line. Each column listed with the infx_delete_key_columns directive must be defined with a type on the DEF line, in addition to the columns whose values will be updated by the operation. This cannot be used with infx_update_key_columns. Also, the keys cannot be of type BLOB, CLOB, or LONG_VARCHAR.

infx_geometry_column

This parameter can be used to specify the name of the spatial layer (geometry column name). If it is not specified the default name of “geometry” will be used for the spatial layer.

infx_multi_geometry

This specifies whether the Informix types for point, linestring and polygon should be written as multi-geometries or single geometries. If YES, the table created has multi-geometries (that is, the geometry column type will be e.g. ST_MULTIPOINT, and the features are coerced into multi-geometries if they are not already). If NO, the geometry column of the created table is singular (that is, ST_POINT), and multi-geometries are split. FIRST_FEATURE allows this setting to be based on the first feature in the table.

infx_offset_x

The x-offset value for the dataset; defaults to 0.

infx_offset_y

The y-offset value for the dataset; defaults to 0.

infx_scale_x

The x and y scale value for the dataset; defaults to 1.

infx_srid The SRID that will be attached to all geometry. This SRID must exist in the SPATIAL_REFERENCE table. If left blank, the SRID will be determined from the feature coordinate system.

TRANSACTION_INTERVAL

This statement informs the FME about the number of features to be placed in each transaction before a transaction is committed to the database.

If the INFXSPATIAL_TRANSACTION_INTERVAL statement is not specified, then a value of 1000 is used as the transaction interval.

Parameter

Contents

<transaction_interval>

The number of features in a single transaction.

Default: 1000

Example:

INFXSPATIAL_TRANSACTION_INTERVAL 5000

Workbench Parameter: Transaction Interval

ABORT_ON_BAD_DATA

Required/Optional: Optional

Some features’ geometries may fail Informix Spatial’s check constraints based on the offset, scale, and coordinate system values. These features, as well as others with out-of-range or invalid attribute values, will be rejected and cannot be written to the database. If the value of this directive is YES then the translation will be aborted immediately after encountering such a problem. If this directive is set to NO then the translation will continue but the features with rejected geometry will not be written to the database.

Values: YES | NO

Default: NO

Example:

INFXSPATIAL_ABORT_ON_BAD_DATA YES

Workbench Parameter: Abort Translation on Bad Data