SQLite MBTiles Reader/Writer

The MBTiles Raster Reader/Writer allows FME to read and write data in the MBTiles format.

Overview

The MBTiles specification is an efficient format for storing millions of tiles in a single SQLite database. Because MBTiles uses SQLite, it is ideal for sending data over the web, or displaying data on a mobile device.

MBTiles supports PNG, PNG8, and JPEG data stored as binary blobs in the tiles column.

In FME, a single MBTiles SQLite file is a dataset and optionally the feature type name while a tile is read as a feature with raster geometry.

MBTile SQLite files contain two tables:

  • metadata: This table contains two columns, name and value which are both strings used to identify the data in the tiles table.
  • tiles: This table contains four columns: tile_row, tile_column, zoom_level, and tile_data. tile_data is a binary blob which must contain either PNG, PNG8 or JPEG data. The other values must be integers. Data is compressed by having multiple tile_row, tile_column, and zoom_level values reference the same image data, if that data is the same.

Versions Supported

Different versions of MBTiles support different values in the metadata table.

  • 1.0: supports the name, type, version, and description metadata values.
  • 1.1: supports all of the values that version 1.0 supports along with the format and bounds metadata values. Because version 1.1 has a format metadata value, all tiles in the tiles table must be the same file format.

FME supports reading and writing both version 1.0 and 1.1 .mbtiles files. When writing version 1.0 MBTiles data, the bounds and format metadata items will still be written to the metadata table.

Reader Overview

FME considers a single MBTiles SQLite file to be a dataset and prefers files with the .mbtiles extension.

The SQLite file must contain the tables tiles and metadata to be valid for reading with the MBTiles reader.

The reader allows for selecting subsets of data based on a user-provided spatial envelope and/or a specific zoom level.

Writer Overview

The MBTiles writer stores the MBTiles data inside a SQLite .mbtiles file.

The writer allows for creating subsets of data based on a user provided spatial envelope and/or a specific zoom level and allows various version, format and compression levels to be specified.

Writer-Level Format Parameters

The MBTiles writer supports additional options through the SQLite MBTiles Writer: Format Parameters dialog.

FME Raster Features

FME raster features represent raster data and use several concepts that are unlike those used in the handling of vector data. The topics below describe how FME processes raster data.

About FME Rasters Tiling and Mosaicking
Raster Properties Band Combining and Separating
Band Properties Band and Palette Selection
Palette Properties Raster Processing
Compression Raster versus Vector Features
Pyramiding Raster File Naming
Interleaving World Files
Interpretation and Data Type TAB Files
Palette Resolution  

MBTile image data must be written with square pixel dimensions.

MBTile supports rasters with up to 4 bands.