Vector tiles - OpenStreetMap Wiki
Vector tiles
From OpenStreetMap Wiki
Jump to navigation
Jump to search
Help
Vector tiles
In other languages
Afrikaans
asturianu
azərbaycanca
Bahasa Indonesia
Bahasa Melayu
bosanski
brezhoneg
català
čeština
Crnogorski
dansk
eesti
Esperanto
euskara
Frysk
Gàidhlig
galego
hrvatski
Ido
interlingua
íslenska
italiano
Kreyòl ayisyen
kréyòl gwadloupéyen
kurdî
latviešu
Lëtzebuergesch
lietuvių
magyar
Nederlands
norsk
norsk nynorsk
occitan
polski
português
română
sardu
shqip
slovenčina
slovenščina
srpski (latinica)
suomi
svenska
Tagalog
Tiếng Việt
Türkçe
Zazaki
Ελληνικά
беларуская
български
македонски
монгол
русский
српски / srpski
українська
հայերեն
עברית
العربية
سرائیکی
فارسی
پنجابی
پښتو
नेपाली
मराठी
हिन्दी
বাংলা
ਪੰਜਾਬੀ
தமிழ்
മലയാളം
සිංහල
ไทย
မြန်မာဘာသာ
한국어
ქართული
ⵜⴰⵎⴰⵣⵉⵖⵜ
中文(简体)
中文(繁體)
粵語
Other languages...
Vector tiles
are a way to deliver geographic data in small chunks to a browser or other client application. Vector tiles are similar to
raster tiles
, but instead of raster images, the data returned is a vector representation of the features in the tile. Clients must then render the data into a visual representation on the fly, typically with the help of a separate
stylesheet
that describes how the data should look when it is presented to the user.
Contents
Motivation
Mapbox Vector Tiles
MapLibre Tile
Rendering
4.1
Rendering libraries
4.2
Styling
4.3
Tile schemas
MBTiles and PMTiles
Providers
Generators
History
Examples
10
See also
Motivation
Vector tiles were developed to address some limitations of raster tiles. The key difference is that vector tiles contain map data, which is loaded by client applications and then rendered on the fly. This adds complexity to the application, but also enables features that are not practical with raster tiles:
Customization
: since the client application renders the tile data, it can adapt what it shows to different use cases. For example, a map could show bicycle lanes more prominently if the user is looking up biking directions, or switch to a "dark mode" version of the map at night that uses the same data but with different styling.
Smooth zooming
: the application can render the data at exactly the size and resolution appropriate for the device's screen and the current zoom level, meaning the map always looks crisp (never pixelated).
Rotation
: the user can rotate the map and the labels can remain upright, since the application can redraw them at whatever angle is required.
Interactivity
: the application can query data stored in the tiles and present it to the user, for example letting them tap on the map to see details about an object, or search for things nearby, without needing to talk to a separate web service.
Mapbox Vector Tiles
When people say "vector tiles", they almost always mean tiles in a data format called
Mapbox Vector Tiles
or
MVT
. The
Mapbox Vector Tile Specification
defines this file format. Mapbox also offers a
guide with visuals
explaining how the format works.
At a high level, MVT tiles provide an efficient binary encoding for map features. Features have geometries (which can be points, lines, or polygons, similar to GeoJSON) and may also have attributes (key-value pairs, where keys are strings and values are strings, ints, floats, or booleans). MVT provides a compact binary encoding of this data, based on the
Protobuf
binary serialization format. Note that although the
OpenStreetMap planet file
is distributed in a Protobuf-based
.osm.pbf
file format, the two formats are unrelated except for the fact that they are built on top of the same low-level serialization format.
Like raster tiles, vector tiles are usually served to clients over HTTP. The file extension is typically either
.mvt
or
.pbf
. The recommended MIME type is
application/vnd.mapbox-vector-tile
MapLibre Tile
MapLibre Tile (MLT) is a newer, faster and more compact vector tile format which is not as widely supported as MVT, but it is considered stable. Decoders are available for Rust, JavaScript / TypeScript and C++. Encoders are available for Rust and Java. The file extension is typically
.mlt
. The specification is available at on the
MapLibre website
Rendering
Vector tiles are somewhat more complex to display in a client application than raster tiles, since the client must interpret the data in the tiles and produce a visual representation from it. This process is called rendering.
Rendering libraries
Rendering nice maps from vector tiles is complex. It involves problems like
intersection
rasterization
, and
label placement
. Most websites and apps that render maps using vector tiles do so with the help of a rendering library that handles these details. Some available options are:
MapLibre GL JS
(Web) and
MapLibre Native
(iOS/Android)
Mapbox GL JS
(Web) and Mapbox Maps SDK for
iOS
and
Android
Tangram
(Web) and
Tangram ES
(iOS/Android)
Styling
In addition to the tiles themselves, the client needs instructions that define how various features should look (which icons to use for different POI types, how thick should lines for roads be drawn, etc).
The two most widely used styling languages is the closely related
Mapbox Stylesheet Specification
and
Maplibre Stylesheet Specification
(sometimes known as "the style spec"). The Mapbox and MapLibre rendering engines both support their respective stylesheet format and there are differences, such as Mapbox' Projection support or Maplibres'
font-faces
Tile schemas
When creating a set of vector tiles, the author must decide what data to include in them. Applications will only be able to display information that is present in the tiles, but including too much data in the tiles will make the map very slow to load. Tileset authors must also decide how to organize the data they include.
Any given stylesheet will generally only work when combined with tiles that the stylesheet was designed for, in much the same way that a CSS stylesheet will generally only have the expected effect when applied to the HTML page it was intended for, and not to a page on a different website.
Several companies and organizations have created
standardized tile schemas
with the goal of providing a common set of map data that will be sufficient to build maps for a variety of purposes. This allows website and app developers to customize the look of a map to their needs, without needing to create and host their own tilesets (instead they can use the tiles hosted by one of these companies or organizations). These include:
MapTiler's
OpenMapTiles
Geofabrik's
Shortbread
Mapbox's
streets-v8
Thunderforest's
transport-v2
and
outdoors-v2
However, it's also common for applications that use vector tiles to have their own, bespoke tile schemas designed to suit their particular needs.
MBTiles and PMTiles
MBTiles
and
PMTiles
are two file formats designed for storing large sets of tiles in a single file. Both are capable of storing either raster (image) or vector tiles, and both support fast random access so that a single tile can efficiently be retrieved by its Z, X and Y coordinates without needing to scan the entire file. Many tools that create vector tiles support outputting to MBTiles or PMTiles archives. This is often more convenient than producing millions of tiles as individual files (e.g. can be more efficient to upload the resulting tileset to a server).
Providers
The following companies or organizations host vector tiles in MVT format as a service. Some require an API key and/or payment to use.
The
Operations Working Group
provides Vector Tiles on
OSMF servers
. Currently (April 2025) the usage policy is not yet final, but it can be used now. See the
announcement
on the community forum for more information.
Mapbox
provides the
Mapbox Vector Tiles API
– in
their own tile schema
MapTiler
provides a
vector tile API
hosting tiles in the OpenMapTiles schema.
Geofabrik
provides a
vector tile API
hosting tiles in the
Shortbread
schema.
Stadia Maps
provides a
vector tile API
hosting tiles in an OpenMapTiles-compatible schema.
The
OpenStreetMap U.S. Tileservice
is free for low-volume, noncommercial use, or for higher-volume, commercial use by permission. It is used by
OpenStreetMap Americana
and other OSM US affiliated projects.
OpenHistoricalMap
maintains
a public vector tile server
. Tiles are in a custom schema suitable for the needs of the project, and
can be inspected here
Versatiles.org
OpenFreeMap is an open-source project that provides a
vector tile API
with an OpenMapTiles schema for free.
Tracestrack provides a
vector tile API
hosting tiles derived from OpenMapTiles schema.
MapRiot
provides an outdoor focused
vector tile API
hosting tiles derived from OpenMapTiles schema.
Generators
The following programs can generate MVT tiles from OSM data:
Tilemaker
- Command line tool to generate vector tiles (MBtiles) directly from .osm.pbf files
Planetiler
- Flexible tool to build planet-scale vector tilesets from OpenStreetMap data in a few hours; output as MBTiles (sqlite) or PMTiles
OpenMapTiles Tools
- Generate vector tiles from OSM data
Martin (MapLibre)
- Generate vector tiles (/archives) from OSM data in a PostGIS database via the
martin-cp
command; output as MBTiles (sqlite)
Sequentially-generate-planet-mbtiles
- Generate planet-scale vector tilesets on low memory / low cpu count devices.
Update 2025: Last release in 2022 and GitHub issues not monitored.
geodesk-tiles
- Generate and serve vector tiles on demand from a
GeoDesk
library
History
2016-01-19: Mapbox Vector Tile Specification 2.1 is released
2014-04-13: Mapbox Vector Tile Specification 1.0.0 is released
2010-11-29:
TileStache
can serve clipped
GeoJSON
tiles to
Polymaps
Examples
Some examples of OSM-based maps using vector tiles are:
OsmAPP
wiki
OpenStreetMap Americana
wiki
VK Maps (former Mail.ru maps)
See also
Mapbox styles
The
OSM Editing API
can also return tiled
OSM XML
data via
bounding box queries
; the
iD editor
uses this mechanism to access OSM source data. Note however that as per the
API Usage policy
the API should only be used for editing, and explicitly not for read-only purposes or projects.
/Links
— a page with many links about vector tiles
mapbox/awesome-vector-tiles on GitHub
GitHub
Retrieved from "
Category
Vector tiles
Hidden categories:
Pages unavailable in German
Pages unavailable in Spanish
Pages unavailable in French
Pages unavailable in Italian
Pages unavailable in Dutch
Pages unavailable in Japanese
Navigation menu
US