PMTiles
PMTiles is a general format for storing tiled data addressed by Z/X/Y coordinates in a single (big) archive file. PMTiles is optimized for the cloud and can be hosted on commodity storage platforms like S3, enabling low-cost, zero-maintenance map applications, without requiring a server in the middle. PMTiles is structured to minimize overhead requests. The current V3 version of the format includes directories and tile data.
PMTiles is commonly used for visualization (e.g. for cartographic basemap vector tiles), and then often contains vector data, where each tile data contained within the archive is encoded as a Mapbox Vector Tile (MVT), however it can also be used to store image tiles (in PNG and JPEG format) containing e.g. raster data or terrain mesh data.
A PMTiles archive replaces a big directory tree of thousands of individual tile files, allowing an entire tileset to be manipulated (uploaded, downloaded, served, analyzed) as a single file.
In addition, there is a range of utilities and libraries for working with PMTiles, such Python packages for reading and writing, and support for various programming languages and tools as well as a number of viewers. And tiling tools such as tippecanoe can now output directly to PMTiles.
Tile types
PMTiles is a container format and can in principle contain any type of quadtree-organized tiles. A number of vector and image tile types are predefined.
Type | MIME type | Supported | Description |
---|---|---|---|
MVT | 'application/vnd.mapbox-vector-tile' | ✅ | Mapbox Vector Tile |
PNG | 'image/png' | ❌ | Map imagery |
JPEG | 'image/jpeg' | ❌ | Map imagery |
WEBP | 'image/webp' | ❌ | Map imagery |
AVIF | 'image/avif' | ❌ | Map imagery |
... | 'application/octet-stream' | ❌ | Can be used for custom tile types |
Metadata
The pmtiles header has a metadata field that can store arbitrary JSON metadata about the tileset. This means that for MVT pmtiles, TileJSON is typically available in the PMTiles header, which enables a better visualization experience in Foursquare Studio.
Updated 8 months ago