SpatiaLite Reader/Writer

Licensing options for this format begin with FME Professional Edition.

The SpatiaLite reader and writer provide FME with read and write access to both attribute and spatial data held in SpatiaLite databases.

Overview

SpatiaLite is a spatial extension to SQLite which provides support for the Open Geospatial Consortium’s Simple Feature Specification. SpatiaLite also provides more advanced functionality to SQLite databases such as spatial indexes and multiple coordinate systems.

In FME a SpatiaLite table is a feature type, a row is a feature, and a column is an attribute.

SpatiaLite is a relational database system that supports SQL and which stores the entire database in a single file.

For more information on SpatiaLite, see the SQLite Reader and Writer.

Reader Overview

The SpatiaLite reader takes a single SpatiaLite file as its dataset. Each table in the database is considered a feature type.

The FME SpatiaLite reader does not at this time support custom SQL queries.

Writer Overview

The SpatiaLite writer takes a single SpatiaLite file as its dataset. Each table in the database is considered a feature type.

The Spatialite writer will serialize any list attributes to be a comma separated list formatted as follows:

(3: item1, item2, item3)

The number of list items is written at the start of the list, followed by a colon which is followed by the comma delimited list. The list items may be of any attribute type and the resultant comma separated list value will be retrievable as a string.

The SpatiaLite writer supports transactions, it will cache a number of features for writing and then perform a bulk write once the specified number of features is reached. The number of features to write per transaction is configurable as a writer option. Please see the following documentation for details. Note that if a single feature fails to write it will cause all the features in the transaction to fail. To troubleshoot problem features it may be advisable to reduce the number of features per transaction.

The SpatiaLite writer can support either generic geometry columns in tables or specific geometry columns and specifically 2D or 2.5D dimensions per table. These are strictly enforced by SpatiaLite constraints once created.

The writer offers an option to choose which type of geometry to create. If choosing to create specific geometry columns, each writer feature type will offer an option of which geometry type to create for that table, including variants for both 2D (xy) and 2.5D (XYZ) geometries.