Introduction to Vector Tiles¶
GeoServer supports the vector tile output format for WMTS services, through the vector tiles extension. Unlike the traditional image formats for WMTS, which are a set of images georeferenced next to each other, a vector tile is a packet of vector data layers, georeferenced and clipped into tiles for easy retrieval.
Vector tiles rendering is done by the client, so the styling of vector tiles WMTS output affects the scales and contents in which each layer and features are supplied. Styles used in GeoServer for vector tiles WMTS output can be used to reduce the size of tiles in smaller map scales.
The Advantages of Vector Tiles Are:¶
- The size of a vector tile is usually smaller compared to an image tile of the same map, resulting in faster data transfer and lower bandwidth usage.
- Rendering done by the client saves storage for GeoWebCache, as it only needs to store one tile for all the styles of the same data.
- The client has access to attributes as well as geometry, this can be used to query the features and create impressive renderings based on those attributes.
The most common vector tile output format is the MapBox vector tile format, there are however other formats, such as GeoJSON and TopoJSON, which are less widely supported as a tile format.
Installing The Vector Tiles Extension¶
Serving vector tiles from GeoServer requires a specific extension available from the GeoServer Downloads page.
If you have installed GeoServer from the training package, you are using version 2.26,
You can find the zip files for both of these plugins in the $TRAINING_MATERIAL/data/plugins
folder.
After downloading the extension for the version of GeoServer that you are using, extract them into the WEB-INF/lib
of the GeoServer webapp.
Extenstions to Install:¶
Vector Tiles -
$TRAINING_MATERIAL/data/plugins/geoserver-2.26-SNAPSHOT-vectortiles-plugin.zip
This extension adds the vector tile output format for Geoserver, which contains georeferenced vector data, clipped into tiles for easy retrieval.
For the Using Maputnik To Style Vector Tiles section you will also need the MBStyle Styling extension.
MBStyle Styling -
$TRAINING_MATERIAL/data/plugins/geoserver-2.26-SNAPSHOT-mbstyle-plugin.zip
This module allows GeoServer to use Mapbox style documents directly. The key advantage of Mapbox style documents is their compatibility with Mapbox GL JS, MapLibre GL JS and OpenLayers. It also allows you to use styles created in Maputnik or MapBox Studio.