Feature Representation

In addition to the generic FME feature attributes that FME Workbench adds to all features (see Feature Attributes and Supported Geometries), this format adds a format-specific attribute described in this section and the format-specific attributes described in the Text File Reader documentation.

Features read from a database consist of geometry and a series of attribute values. The feature type of each GeoPackage feature is as defined on its DEF line. Features written to the database have the destination table as their feature type, and attributes as defined on the DEF line.

GeoPackage attributes cannot have names that contain non ASCII characters; however, the attribute values support full UTF-8.

The GeoPackage attribute types are as follows:

Field Type Description
text

Text fields store UTF-8 strings of unlimited length.

text(<width>)

Text fields store UTF-8 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.

Notes:

  • Strings encountered that have length greater than width will still be returned; they will not be truncated.
  • The width parameter is only valuable if the features will be passed to another format that requires this information.
blob

Blob fields store an array of bytes of unlimited length.

blob(<width>)

Blob fields store an array of bytes. The width parameter controls the maximum number of bytes that can be stored by the field. No padding is required for blobs shorter than this width.

Notes: Blobs encountered that have length greater than width will still be returned; they will not be truncated. The width parameter is only valuable if the features will be passed to another format that requires this information.

boolean

Boolean fields store TRUE/FALSE data, which is represented in GeoPackage as 1 for TRUE and 0 for FALSE. Data read or written from and to such fields must always have a value of either 1 or 0.

FME represents Booleans as Yes and No for TRUE and FALSE respectively, so any logging within FME will reflect this. Round tripped values will be written as 1 or 0 as expected.

date

Date fields convert dates in GeoPackage to FME date string format.

YYYYMMDD (Year, Month, Day)

datetime

Datetime fields convert datetimes in GeoPackage to FME datetime string format.

YYYYMMDDHHmmSS

(Year, Month, Day, Hour, Minute, Second)

If a timezone is specified, then the offset from GMT is included at the end of the string in the format:

[+/-]HH:mm

(Plus or Minus, Hour, Minute)

double

Double fields store double precision floating point values.

float

Float fields store single precision floating point values.

int

Int fields store 64-bit signed integer values.

mediumint

Mediumint fields store 32-bit signed integer values.

smallint

Smallint fields store 16-bit signed integer values.

tinyint

Tinyint fields store 8-bit signed integer values.

The GeoPackage attribute type mapping is as follows:

GeoPackage Attribute Type FME Attribute Type
text fme_buffer
text(width) fme_varchar(width)
text(width) fme_char(width)
blob fme_buffer
blob(width) fme_varchar(width)
tinyint fme_char
text(1) fme_char
date fme_date
datetime fme_datetime
datetime fme_time
float fme_real32
double fme_real64
double fme_decimal(width, decimal)
boolean fme_boolean
smallint fme_int16
smallint fme_uint8
mediumint fme_int32
mediumint fme_uint16
int fme_int64
int fme_uint32
text(20) fme_uint64