MBTiles
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
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 inmetadatatable.name='bounds'row suggested inmetadatatable.- 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:overlayorbaselayerversion: 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:pngorjpg
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 inWGS: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:
pngjpg
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
1.1 Compliant
- Mapbox
- TileStream
- Mapbox iOS SDK (example)
- GDAL
- node.js: mbtiles-generator
- python: rio-mbtiles (write)
- python: mbutil (read/write)
- python: landez (read/write) (uses mbutil)
- python: TileStache (code) (read/write) - a full, high-quality tile server
- python: python-mbtiles
- python: TileCloud
- python: servembtiles a pure python3 wsgi application for serving MBTiles.
- python: gdal2mbtiles - convert GDAL-readable datasets into an MBTiles file (write)
- python: tpkutils (write) - convert ArcGIS tile packages into MBtiles 1.1.
- proprietary: Arc2Earth (write)
- python: mapproxy (announcement) (read/write)
- proprietary: maperitive (write)
- PHP: mbtiles-generator (read/write)
- python mbtiles2s3
- objc: osm2mbtiles
- C++: tilemaker (write vector tiles)
Others
- ruby: silent_cartographer
- python/Django: django-mbtiles
- objc: MapDBImporter (write)
- java/android: MBTilesDroidSpitter (example) (read)
- objc/iPhone: Maptual (read)
- java/Android: Locus (read)
- java/Android: MapIt (read)
- Windows compatible viewer: MBTilesViewer (read)
- java/Android: Nutiteq SDK
- Python: MBTiles-Extractor
- Java/Processing: Unfolding (read) (example)
- PHP: tileserver-php
- PHP: MBTiles-PHP
- PHP: PHP-MBTiles-Server
- PHP: TilePhlox
- ASP.NET: tilecannon
- Python: MBTiles-extractor
- C++: Example C++ mbtiler
Applications
- js: TileMill (write)
- TileMill OS X QuickLook & Spotlight plugins (read)
- Portable Basemap Server An easy to use WPF application and has implemented map tile part of Esri’s “GeoServices REST Specification” and OGC WMTS specification (read/write)
- C++: osgEarth (read)
- iOS/Android/Web: Fulcrum- mobile field data collection (read)
- C: Viking GPS Desktop application. Linux + Windows (read)
- python: QTiles QGIS plugin (write)
- Windows: TilingTools - raster to tiles (read/write)
Websites
MBTiles的更多相关文章
- 与你相遇好幸运,mbview的mbtiles文件分析
mbview是一个查看.mbtiles文件的本地程序. https://github.com/mapbox/mbview .mbtiles文件就是一个Sqlite文件,用Navicat Premium ...
- 支持 MBTiles 规范的预缓存
SuperMap iServer 支持生成符合MBTiles规范的预缓存(MBTiles是由MapBox制定的一种将瓦片地图数据存储到SQLite数据库中并可快速使用,管理和分享的规范. 该规范由Ma ...
- MBTiles地图瓦片管理工具
采用C#+GMap.NET+MBTiles数据库来实现. 具有以下功能: 1) 支持单个文件追加到mbtiles数据库. 2) 支持批量导入Google切片组织的地图瓦片. 3) 支持直接对MB ...
- 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 ...
- 基于 MBTiles 规范扩展的缓存文件格式说明
MBTiles 是由 MapBox 制定的一种将瓦片地图数据存储到SQLite数据库中并可快速使用,管理和分享的规范.该规范由MapBox制定,详见http://mapbox.com/mbtiles- ...
- MBTIles实现
MBTIles实现 3.1 Compliant(符合) python: raster2mb (write) python: mbutil (read/write) python: landez (wr ...
- MBTiles 1.2 规范翻译
MBTiles 1.2 可以参考超图的文档MBTiles扩展 具体实现可以参考浅谈利用SQLite存储离散瓦片的思路和实现方法 mapbox提供了一个简单实现测试代码,github地址在这里https ...
- [转]MBTiles 离线地图演示 - 基于 Google Maps JavaScript API v3 + SQLite
MBTiles 是一种地图瓦片存储的数据规范,它使用SQLite数据库,可大大提高海量地图瓦片的读取速度,比通过瓦片文件方式的读取要快很多,适用于Android.IPhone等智能手机的离线地图存储. ...
- [转]MBTiles移动存储简介
首先奉上官网地址http://mapbox.com/developers/mbtiles/#storing_tiles 由于英文水平有限,看资料很费眼睛,特将它翻译成中文 存储瓦片 地图制作者面对一个 ...
随机推荐
- Linux下编译安装Vim8.0
什么是Vim? Vim 是经典的 UNIX 编辑器 Vi 的深度改良版本.它增加了许多功能,包括:多级撤销.格式高亮.命令行历史.在线帮助.拼写检查.文件名补完.块操作.脚本支持,等等.除了字符界面版 ...
- Merge Sorted Array
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:Yo ...
- 最新Linux部署.NET,Mono and DNX
这几天一直在折腾在Linux下的ASP.NET 5,就下在看来在其它操作系统中ASP.NET 5或.NET应用,要想在完整的MS VM(CoreCLR)上运行还不远远达不到,应用的效果. 目前只能在M ...
- 【深入浅出jQuery】源码浅析2--奇技淫巧
最近一直在研读 jQuery 源码,初看源码一头雾水毫无头绪,真正静下心来细看写的真是精妙,让你感叹代码之美. 其结构明晰,高内聚.低耦合,兼具优秀的性能与便利的扩展性,在浏览器的兼容性(功能缺陷.渐 ...
- 【初探Spring】------Spring IOC(三):初始化过程---Resource定位
我们知道Spring的IoC起到了一个容器的作用,其中装得都是各种各样的Bean.同时在我们刚刚开始学习Spring的时候都是通过xml文件来定义Bean,Spring会某种方式加载这些xml文件,然 ...
- ABP源码分析二十三:Authorization
Permission:用于定义一个Permission,一个permission可以包含多个子Permission. PermissionDictionary:继承自Dictionary<str ...
- php中使用fsockopen实现异步请求
php执行一段程序,有可能几毫秒就执行完毕,也有可能耗时较长.例如,用户下单这个事件,如果调用了些第三方服务进行发邮件.短信.推送等通知,可能导致前端一直在等待.而有的时候,我们并不关心这些耗时脚本的 ...
- awk命令简介
awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分隔符将每行切片,切开的部分再进行各 ...
- ASP.NET MVC5+EF6+EasyUI 后台管理系统--系统模块部分图
系统日志,系统异常,组织架构等
- Lisp和SICP
大概不少programmer都看过<黑客与画家>,作者用了整整一章的篇幅讨论Lisp的强大.我自然就会手痒痒. 几个月前,几天内攻城略地搞定了Python,用的方法便是 ...