MapBox MBTiles Reader/Writer

FME can read and write data in the MBTiles format.

MapBox MBTiles Product and System Requirements

Format

FME Platform

Operating System

Reader/Writer

FME Form

FME Flow

FME Flow Hosted

Windows 64-bit

Linux

Mac

Reader

Yes

Yes

Yes

Yes

Yes

Yes

Writer

Yes

Yes

Yes

Yes

Yes

Yes

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.

Overview

The MBTiles specification is an efficient format for storing millions of tiles in a single SQLite database. MBTiles 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 file is a dataset and optionally the feature type name while a tile is read as a feature with raster geometry.

MBTile 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.

Reader Overview

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

The 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 an .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 MapBox MBTiles Writer Feature Type 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.

For comprehensive information about how FME processes raster data, see Rasters.

MBTile image data must be written with square pixel dimensions.

MBTile supports rasters with up to 4 bands.