MBTiles Specification

MBTiles is a specification for storing tiled map data in SQLite databases for immediate usage and for transfer. MBTiles files, known as tilesets, must implement the specification below to ensure compatibility with devices.

UTFGrid

The MBTiles specification previously contained the UTFGrid specification. It was removed in version 1.2 and moved into its own specification with synced version numbers - so MBTiles 1.2 is compatible with UTFGrid 1.2. The specs integrate but do not require each other for compliance.

Versions

  • Development - NOT USABLE: 1.2
  • Stable: 1.1
  • 1.0

Changelog

Roadmap

  • The format will switch tile ordering to the XYZ schema popularized by OpenStreetMap and away from the Tile Map Service specification.

1.1

  • name='format' row required in metadata table.
  • name='bounds' row suggested in metadata table.
  • optional UTFGrid-based interaction spec.

Concept

MBTiles is a compact, restrictive specification. It supports only tiled data, including image tiles and interactivity grid tiles. Only the Spherical Mercator projection is supported for presentation - tile display - and only latitude-longitude coordinates are supported for metadata such as bounds and centers.

It is a minimum specification - only specifying the ways in which data must be retrievable. Thus MBTiles files can internally compress and optimize data, and construct views that adhere to the MBTiles specification.

Unlike Spatialite, GeoJSON, and Rasterlite, MBTiles is not raw data storage - it is storage for presentational data, like rendered map tiles.

One MBTiles file represents a single tileset, optionally including grids of interactivity data. Multiple tilesets - layers, or maps in other terms, can be represented by multiple MBTiles files.

Implementations.

License

The text of this specification is licensed under a Creative Commons Attribution 3.0 United States License. However, the use of this spec in products and code is entirely free: there are no royalties, restrictions, or requirements.

Authors

  • Tom MacWright (tmcw)
  • Will White (willwhite)
  • Konstantin Kaefer (kkaefer)
  • Justin Miller (incanus)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

MBTiles 1.2

Sub-sections:

  • Interaction: HTTP endpoints needed for implementing interactivity
  • UTFGrid: This specification relies on UTFGrid 1.2 for interactivity.

Abstract

MBTiles is a specification for storing tiled map data in SQLite databases for immediate usage and for transfer. MBTiles files, known as tilesets, must implement the specification below to ensure compatibility with devices.

Database Specifications

Tilesets are expected to be valid SQLite databases of version 3.0.0 or higher. Only core SQLite features are permitted; tilesetscannot require extensions.

MBTiles databases can optionally use the officially assigned magic number to be easily identified as MBTiles.

Database

Note: the schemas outlined are meant to be followed as interfaces. SQLite views that produce compatible results are equally valid. For convenience, this specification refers to tables and virtual tables (views) as tables.

Metadata
Schema

The database is required to contain a table or view named metadata.

This table must yield exactly two columns named name and value. A typical create statement for the metadata table:

CREATE TABLE metadata (name text, value text);
Content

The metadata table is used as a key/value store for settings. Five keys are required:

  • name: The plain-english name of the tileset.

  • type: overlay or baselayer
  • version: The version of the tileset, as a plain number.
  • description: A description of the layer as plain text.
  • format: The image file format of the tile data: png or jpg

One row in metadata is suggested and, if provided, may enhance performance.

  • bounds: The maximum extent of the rendered map area. Bounds must define an area covered by all zoom levels. The bounds are represented in WGS:84 - latitude and longitude values, in the OpenLayers Bounds format - left, bottom, right, top. Example of the full earth: -180.0,-85,180,85.

  • attribution: An attribution string, which explains in English (and HTML) the sources of data and/or style for the map.

Several additional keys are supported for tilesets that implement UTFGrid-based interaction.

Tiles
Schema

The database is required to contain a table named tiles.

The table must yield four columns named zoom_level, tile_column, tile_row, and tile_data. A typical create statement for the tiles table:

CREATE TABLE tiles (zoom_level integer, tile_column integer, tile_row integer, tile_data blob);
Content

The tiles table contains tiles and the values used to locate them. The zoom_level, tile_column, and tile_row columns follow the Tile Map Service Specification in their construction, but in a restricted form:

The global-mercator (aka Spherical Mercator) profile is assumed

The tile_data blob column contains raw image data in binary.

A subset of image file formats are permitted:

  • png

  • jpg
Grids

See the UTFGrid specification for implementation details of grids and interaction metadata itself: the MBTiles specification is only concerned with storage.

Schema

The database can have optional tables named grids, grid_data.

The grids table must yield four columns named zoom_level, tile_column, tile_row, and grid. A typical create statement for the grids table:

CREATE TABLE grids (zoom_level integer, tile_column integer, tile_row integer, grid blob);

The grid_data table must yield five columns named zoom_level, tile_column, tile_row, key_name, and key_json. A typical create statement for the grid_data table:

CREATE TABLE grid_data (zoom_level integer, tile_column integer, tile_row integer, key_name text, key_json text);
Content

The grids table contains UTFGrid data, gzip compressed.

The grid_data table contains grid key to value mappings, with values encoded as JSON objects.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Implementations

Brendan Ward edited this page on Sep 8 · 65 revisions

<?XML:NAMESPACE PREFIX = "[default] http://www.w3.org/2000/svg" NS = "http://www.w3.org/2000/svg" />Pages 1
Clone this wiki locally

Clone in Desktop

1.1 Compliant

Others

Applications

Websites

MBTiles的更多相关文章

  1. 与你相遇好幸运,mbview的mbtiles文件分析

    mbview是一个查看.mbtiles文件的本地程序. https://github.com/mapbox/mbview .mbtiles文件就是一个Sqlite文件,用Navicat Premium ...

  2. 支持 MBTiles 规范的预缓存

    SuperMap iServer 支持生成符合MBTiles规范的预缓存(MBTiles是由MapBox制定的一种将瓦片地图数据存储到SQLite数据库中并可快速使用,管理和分享的规范. 该规范由Ma ...

  3. MBTiles地图瓦片管理工具

    采用C#+GMap.NET+MBTiles数据库来实现. 具有以下功能: 1)  支持单个文件追加到mbtiles数据库. 2)  支持批量导入Google切片组织的地图瓦片. 3)  支持直接对MB ...

  4. Exploring the MapBox stack: MBTiles, TileJSON, UTFGrids and Wax

    转自:http://blog.thematicmapping.org/2012/11/exploring-mapbox-stack-mbtiles-tilejson.html In my last b ...

  5. 基于 MBTiles 规范扩展的缓存文件格式说明

    MBTiles 是由 MapBox 制定的一种将瓦片地图数据存储到SQLite数据库中并可快速使用,管理和分享的规范.该规范由MapBox制定,详见http://mapbox.com/mbtiles- ...

  6. MBTIles实现

    MBTIles实现 3.1 Compliant(符合) python: raster2mb (write) python: mbutil (read/write) python: landez (wr ...

  7. MBTiles 1.2 规范翻译

    MBTiles 1.2 可以参考超图的文档MBTiles扩展 具体实现可以参考浅谈利用SQLite存储离散瓦片的思路和实现方法 mapbox提供了一个简单实现测试代码,github地址在这里https ...

  8. [转]MBTiles 离线地图演示 - 基于 Google Maps JavaScript API v3 + SQLite

    MBTiles 是一种地图瓦片存储的数据规范,它使用SQLite数据库,可大大提高海量地图瓦片的读取速度,比通过瓦片文件方式的读取要快很多,适用于Android.IPhone等智能手机的离线地图存储. ...

  9. [转]MBTiles移动存储简介

    首先奉上官网地址http://mapbox.com/developers/mbtiles/#storing_tiles 由于英文水平有限,看资料很费眼睛,特将它翻译成中文 存储瓦片 地图制作者面对一个 ...

随机推荐

  1. linux系统维护时的一些小技巧,包括系统挂载新磁盘的方法!可收藏!

    这里发布一些平时所用到的小技巧,不多,不过会持续更新.... 1.需要将history创建硬链接ln 全盘需要备份硬链接 ln /etc/xxx /home/xxx 2.root用户不可以远程 /et ...

  2. VMware安装CentOS

    centos镜像地址:https://www.centos.org/download/ VMware版本:12.5.2 build-4638234 创建新的虚拟机 直接默认下一步 稍后安装操作系统-& ...

  3. 【完全开源】知乎日报UWP版(上篇):界面设计、官方API分析

    目录 说明 使用Fiddler分析android版API 部分效果图 关于源码 说明 在做博客园UWP版的时候其实就有做知乎日报的打算了,前段时间一直出差,在酒店里用Fiddler简单的分析了一下An ...

  4. 使用Metrics监控应用程序的性能

    在编写应用程序的时候,通常会记录日志以便事后分析,在很多情况下是产生了问题之后,再去查看日志,是一种事后的静态分析.在很多时候,我们可能需要了解整个系统在当前,或者某一时刻运行的情况,比如当前系统中对 ...

  5. protocol buffers vs json vs XML

    原创文章转载请注明出处:@协思, http://zeeman.cnblogs.com   在分布式系统中,数据序列化传递的情形非常常见,主流的三种,JSON.XML.Protobuf.   XML现在 ...

  6. oracle11g 重装操作系统后,如何利用原有oracle表空间文件还原数据库

    最近由于系统重装,在还原dmp备份文件时,由于数据原因(用exp命令导出时表没有导出全部),导致系统不能正常运行.根据网上的信息和个人实际情况,做个记录,便于后用. oracle 导出空表方法: 1. ...

  7. iOS---观察者模式之--->KVO

    文章结构如下: Why? (为什么要用KVO) What? (KVO是什么) How? ( KVO怎么用) More (更多细节) 原理 自己实现KVO 在我的上一篇文章浅谈 iOS Notifica ...

  8. seajs的使用

    写在前面 seajs是什么? Seajs是一个js文件加载器. 遵循 CMD 规范模块化开发,依赖的自动加载.配置的简洁清晰. 用于Web开发的模块加载工具,提供简单.极致的模块化体验 一:使用 文件 ...

  9. 【解决方案】cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-r

    [JAVA错误] cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One o ...

  10. 逆向工程 - Reveal、IDA、Hopper、HTTPS抓包 等

    目录: 一. iOS 如何做才安全 二.ipa文件 三.沙盒 中的数据 四.Reveal:查看 任何APP 的UI结构 五.反编译工具:IDA 六.反编译工具:Hopper Disassembler ...