Tiling scheme in Folder output

This article will show you how to work with the tiling scheme for the Folder output in MapTiler Engine. You will learn what a tiling scheme is and what options MapTiler Engine offers for its utilization.

The global settings dialog is available since MapTiler Engine 11.3 (TO-BE-RELEASED). Alternative with command line for MapTiler Engine is available publicly now, see the link to the manual below.

Tiling scheme in Folder output

Open the MapTiler Engine application and go to File → Global settings, where you can change the tiling scheme. This option will be saved and used for each rendering afterward when you choose the Folder output type for your tiles (instead of GeoPackage).

global_settings_6.png

What is a tiling scheme?

The map of the world is divided into small squares, each with a fixed geographic area and scale, called the map tiles. Displaying any dynamic map using map tiles requires a system for naming these map tiles - simply called tiling scheme (or shortly scheme, in MapTiler platform).

There were defined multiple world-known standards for naming map tiles. The most popular and world-used scheme used by many map providers (such as OpenStreetMap, Google Maps, MapTiler, Mapbox, …) was defined by Open Geospatial Consortium (OGC) in the WMTS standard definition released in 2010 and is simply called XYZ, or sometimes precisely ZXY (see later).

Figure 2 - Tile Space from WMTS specification

The map tiles are structured into folders, and the final tile image is a file within one of these folders. Each zoom level is a folder, each column is a subfolder, and each tile in that column is a file. The folder structure depends directly on the tiling scheme and will be defined below for each available scheme in MapTiler Engine.

Top-Left vs Bottom-Left origin

The important part of the tiling scheme definition is the location of origin = the first tile in the defined area and vertical/horizontal orientation for the following tiles (referred to as increasing numbers).

Top-Left origin describes:

  • X goes from the left edge, starting with 0 to the right edge of the map
  • Y goes from the top edge, starting with 0 to the bottom edge of the map

Bottom-Left origin describes:

  • X goes from the left edge, starting with 0 to the right edge of the map
  • Y goes from the bottom edge, starting with 0 to the top edge of the map

The difference can be visible in the image below, where Google is Top-Left, and TMS is Bottom-Left.

OpenGIS WMTS / OpenStreetMap / Google XYZ / ZXY

Google Maps was one of the first systems to display dynamic maps on the web. They chose a Spherical Mercator projection because it preserves shape and angles. The entire world looks like a square, which makes it easy to work with on a computer. Almost every open source and commercial Maps API provider as well as OpenStreetMap and MapTiler Cloud Maps APIs are now using this projection and tiling profile and the tiles are therefore compatible with each other.

The folder path is {z}/{x}/{y}.{ext}, where {ext} is the extension of tile format (png, jpg, webp, …). Therefore, the alternative name for XYZ is ZXY, as it reads the folder structure for these tiles.

OSGEO TMS

Tile Map Service (TMS) is a specification for tiled web maps, developed by the Open Source Geospatial Foundation. This specification is very similar to Google XYZ, describe above, with one important difference. TMS has origin bottom-left, which means it has flipped Y-axis as opposed to XYZ. This tiling scheme is defined as a standard for the MBTiles package.

The equation to calculate Y: y = (2^z - 1) - y

Microsoft Bing QuadKey

Microsoft Bing Maps introduced two specifications for naming tiles - QuadKey and ZYX.

To optimize the indexing and storage of tiles, the two-dimensional tile XY coordinates are combined into one-dimensional strings called quadtree keys, or quadkeys for short. Each quadkey uniquely identifies a single tile at a particular level of detail, and it can be used as a key in common database B-tree indexes.

Quadkeys have several interesting properties:

  • The length of a quadkey (the number of digits) equals the level of detail (zoom) of the corresponding tile
  • The quadkey of any tile starts with the quadkey of its parent tile (the containing tile at the previous level)
  • Quadkeys provide a one-dimensional index key that usually preserves the proximity of tiles in XY space. In other words, two tiles that have nearby XY coordinates usually have quadkeys that are relatively close together. This is important for optimizing database performance, because neighboring tiles are usually requested in groups

Microsoft Bing ZYX

Bing Maps also supports custom tile layers that use a hierarchical directory structure and custom file names, rather than the native quadkey file naming structure. In the hierarchical Bing Maps structure, all of the tile files for each zoom level are stored in a correspondingly named directory. This scheme is same as ZXY, but Y-axis is swapped with X-axis. Y-axis are folder names, while X-axis are file names.

The folder path is {z}/{y}/{x}.{ext}.

Conclusion

MapTiler Engine provides some tiling scheme - the naming of map tiles for Folder output. The differences and short history were introduced for each supported tiling scheme. To see different in a fast way, you can look at the GIF below:

Tiling scheme in MapTiler Engine
Tiles à la Google Maps
OpenGIS WMTS Standard
Slippy map tile names (OSM)