Writer Directives

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

DATASET

The DATASET directive operates in the same manner as it does for the GeoPackage reader.

Workbench Parameter

Destination GeoPackage File

Required/Optional

Required

DEF

Each GeoPackage table must be defined before it can be written. The general form of a GeoPackage definition statement is:

GEOPACKAGE_DEF <tableName>	                                   \
	geopackage_type <wkb_type>                                 \
	[geopackage_geometry_column <columnName>]                  \
 	[geopackage_primary_index_column <columnName>]             \
	[fme_table_handling (CREATE_IF_MISSING | DROP_AND_CREATE)] \
	[<fieldName> <fieldType>] +

When the destination table does not exist, the table definition specifies the table that will be created. When the destination table exists and is not being dropped, the fields and types listed should match those of the existing table.

Fields in the table definition that do not match any existing columns will be ignored by the writer. Where <fieldType> is specified, it should be a field type supported by the target database.

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

Parameter Contents
tableName

The name of the table to be written. If a table with the specified name exists, it will be overwritten if the fme_table_handling DEF line parameter is set to DROP_AND_CREATE.

Otherwise the table will be appended. Valid values for table names include any character string devoid of SQL-offensive characters and less than 255 characters in length.

geopackage_geometry_column

This specifies the name of the geometry column when creating a GeoPackage table. If the table is not being created, this parameter is ignored.

If no value is supplied, a default value will be set.

geopackage_primary_index_column

This specifies the name of the primary index column when creating a GeoPackage table. If the table is not being created, this parameter is ignored.

Note: The value of this column is internal to the GeoPackage table, and is not read by the GeoPackage reader or written by the GeoPackage writer.

If no value is supplied, a default value will be set.

fieldName

The name of the field to be written. Valid values for field name include any character string devoid of SQL-offensive characters and less than 255 characters in length.

fieldType

The type of a column in a table. The valid values for the field type are listed in the GeoPackage Feature Representation section.

indexType

The type of index to create for the column.

If the table does not previously exist, then upon table creation, a database index of the specified type is created. The database index contains only one column.

The valid value for the column type is:

indexed: An index without constraints.

OVERWRITE_DATASET

Required/Optional

Optional

Workbench Parameter

Overwrite Database