Skip to content

Vector Tiles ​

This service delivers vector map tiles and styles through a RESTful API. The vector tiles are provided according to the Mapbox Vector Tile Specification while the map styles implement the MapLibre Style Specification, ensuring compatibility with MapLibre-based clients and other applications supporting the specification.

Styles ​

Use the following endpoint to get a certain style:

https://vectortiles.geo.admin.ch/styles/{layerName}/style.json

where layerName is one of the following values:

  • Base Map: ch.swisstopo.basemap.vt
  • Base Map Winter: ch.swisstopo.basemap-winter.vt
  • Light Base Map: ch.swisstopo.lightbasemap.vt
  • Imagery Base Map: ch.swisstopo.imagerybasemap.vt

TIP

See the corresponding page on geo.admin.ch for more details on the available vector styles.

An example request to get the Light Base Map:

Request
Response
sh
curl https://vectortiles.geo.admin.ch/styles/ch.swisstopo.lightbasemap.vt/style.json

Tiles ​

Vector tiles and their meta data can be retrieved by specifying the right layerName parameter at the endpoints below. Possible values for layerName are:

  • Base: ch.swisstopo.base.vt
  • Relief: ch.swisstopo.relief.vt

TIP

See the corresponding page on geo.admin.ch for more details on the available vector tilesets.

Get a Tile ​

Use the following endpoint to get a specific tile:

https://vectortiles.geo.admin.ch/tiles/{layerName}/{version}/{zoomLevel}/{x}/{y}.pbf
ParameterExampleDescription
layerNamech.swisstopo.base.vtThe technical name of the vector tile layer
versionv1.0.0Version of the tileset
zoomLevel7Zoom level (integer)
x67Tile column (X coordinate in the tile grid)
y44Tile row (Y coordinate in the tile grid)

An example request for one .pbf tile in the Relief tileset:

http
curl -o demo.pbf https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.relief.vt/v1.0.0/7/67/44.pbf

Get a Tileset ​

MBTiles are used for storing tiled map data in SQLite databases for immediate or offline usage and for efficient transfer.

A request to get a tileset follows the following pattern:

https://vectortiles.geo.admin.ch/tiles/{layerName}/{version}/{layerName}.mbtiles
ParameterExampleDescription
layerNamech.swisstopo.base.vtThe technical name of the vector tile layer
versionv1.0.0Version of the tileset

An example request for a .mbtiles file in the Base Map dataset:

WARNING

The file in the example below is approximately 900MB in size.

http
curl -o demo.mbtiles https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.base.vt/v1.0.0/ch.swisstopo.base.vt.mbtiles

Metadata ​

Each tileset has a corresponding metadata json file that describes the available set of tiles.

A request to the metadata file looks like this:

https://vectortiles.geo.admin.ch/tiles/{layerName}/{version}/tiles.json
ParameterExampleDescription
layerNamech.swisstopo.base.vtThe technical name of the vector tile layer
versionv1.0.0Version of the tileset

An example request to get the metadata for the Base tileset:

Request
Response
sh
curl --compressed https://vectortiles.geo.admin.ch/tiles/ch.swisstopo.base.vt/v1.0.0/tiles.json

Examples ​

MapLibre ​

An example using MapLibre to display the Light Base Map:

OpenLayers ​

Another example that is using OpenLayers' ol-mapbox-style library to display the Light Base Map.

The same example but using LV95 frame with OpenLayers: