Skip to main content

WMTS Layer Service

In What Are Raster and Vector Data, two forms of data products are introduced. However, in practical application, due to the consideration of development convenience and front-end display performance, TerraQuanta does not recommend users to directly obtain raw data, and to use TerraQuanta’s standardized WMTS layer service instead. Here is a brief introduction to WMTS.

What is WMTS

OpenGIS Web Map Tile Service (WMTS) provides a standardized solution for publishing digital Map services using predefined map blocks. WMTS puts more data processing operations such as layer stacking on the client side to relieve the GIS server side data processing pressure and improve the user experience.

WMTS is an open standard map service docking format proposed by OGC (Open Geospatial Consortium), and is an improved version of WMS (Web Map Service). It makes up for the lack of block map provided by WMS, and, for that reason, more and more geographic information projects use WMTS service as the base map service. At Tianditu, for example, WMTS is used to provide mapping services.

Why does TerraQuanta recommend WMTS

The biggest advantage of WMTS is its faster and more efficient loading and rendering of map data
WMTS renders a map on the server, divides the map into different tiles based on the scale, transfers the map blocks to the client based on the client's request, and provides the map blocks to the client for display. This avoids a large amount of network traffic consumption and reduces the CPU load of the client.
The tiles of WMTS are cacheable
When the client requests the WMTS service, the server returns tiles of a fixed size to the client. The client obtains each tile based on the index number and assembles them into a map for display. Because tile rules are fixed, the server can cache corresponding tiles in advance and return them to the client when needed.
WMTS supports network mechanisms such as distributed cache to achieve scalability and further improve load efficiency.
WMTS enhances scalability by providing static data, and the range boxes and scales of these data are limited to individual blocks. A Web server that simply returns existing files can handle these fixed sets of blocks to implement WMTS services, while also enabling scalability using standard networking mechanisms such as distributed caching.
WMTS supports multiple coordinate systems and scale sets, improving service compatibility.
TerraQuanta can configure the coordinate system and scale set according to the actual requirements of users to fully meet the requirements of users. Common scale sets are GlobalCRS84Scale, GlobalCRS84Pixel, GoogleCRS84Quad, and GoogleMapsCompatible.

Regular WMTS usage tips

Map Tile Acquisition
  1. PNG format tiles
  2. Each zoom level is a directory, each column is a subdirectory, and each tile is a file
  3. The file named format each tile is /z(zoom level)/x/y.png. The client requests the tile by combining the domain name and file name
  4. Because the server has a limit on the number of connections to the client's IP, the map tile server usually provides several subdomains that the browser requests equally to bypass the IP limit
Map Tile Front End Display
  1. The display of map tiles on the client is the process of grid tiling and loading corresponding tiles
  2. First, in the HTML document, create a DIV that holds the map container. Set the center coordinate and zoom level of the map container, calculate the geographic space coverage according to the center coordinate, zoom level and the length and width of DIV, and then calculate how many tiles need to be loaded and which tiles need to be loaded
  3. Then, create some DOM (document object model) with the same size as the tiles in this DIV, calculate the corresponding relationship between DOM and map tiles according to the corresponding relationship between pixel coordinates and geographic coordinates, request the URL of the tiles, and load the tile image into DOM
  4. Finally, on the front end, map tiles can be rendered by DOM splicing

Using WMTS Service by TerraQuanta

TerraQuanta has prepared specific documents, click API Access Manual for details.