Skip to main content

WMS module · capabilities loader

WMTSCapabilitiesLoader

Read an OGC Web Map Tile Service capabilities response into the layer and request metadata needed to select a tile matrix set and formats.

What it reads

Turn a verbose tile catalog into selection metadata.

The loader extracts the commonly needed service, layer, request, CRS, and bounding-box fields while leaving the full XML path available through XMLLoader when an application needs more.

Layers

Names, titles, bounds, and supported CRS

Requests

Operations and advertised MIME types

Tile matrix

Metadata for choosing a compatible grid

Boundary

Typed subset of a larger XML standard

Detailed guide

WMTSCapabilitiesLoader reference

The sections below document the request, parsed data, options, and the intentionally focused extraction scope.

From-3.4Status: Experimental

The WMTSCapabilitiesLoader parses the XML-formatted response from the the OGC WMTS (Web Map Tile Service) standard GetCapabilities request into a typed JavaScript data structure.

Note that the WMTS standard is rather verbose and the XML responses can contain many rarely used metadata fields, not all of which are extracted by this loader. If full access to the capabilities data is desired, it is possible to use the XMLLoader directly.

WMTSCapabilitiesLoader
File Extension.xml
File TypeText
File FormatWMTS
Data FormatData structure
Decoder TypeSynchronous
Worker Thread✅ Yes
Streaming Support❌ No

Usage​

import {WMTSCapabilitiesLoader} from '@loaders.gl/ogc/wms';
import {load} from '@loaders.gl/core';

// Form a WMTS request
const url = `${WMTS_SERVICE_URL}?REQUEST=GetCapabilities`;

const data = await load(url, WMTSCapabilitiesLoader, options);

Parsed Data Format​

The root package exports WMTSCapabilities, WMTSLayer, WMTSDimension, WMTSTileMatrixSetLink, WMTSTileMatrixLimits, WMTSTileMatrixSet, and WMTSTileMatrix types. Native metadata is organized under contents; the source uses it to select the layer, grid, limits, and dimension defaults.

type WMTSCapabilities = {
serviceIdentification?: {title?: string; abstract?: string; serviceTypeVersion?: string};
operationsMetadata?: Record<string, unknown>;
featureInfoUrl?: string | null;
contents: {layers: WMTSLayer[]; tileMatrixSets: WMTSTileMatrixSet[]};
};
Native fieldContentRequest use
contents.layers[].identifierLayer identifierSelect by wmts.layer or per-request layers
featureInfoUrlAdvertised KVP query endpoint, null for metadata without a supported query bindingFeature-info endpoint discovery
infoFormatsOptional array of advertised query MIME typesFeature-info format selection and validation
formats, styles, resourceURLsFormats, default styles, tile/feature-info templatesREST/KVP tile configuration and independent feature-info templates
tileMatrixSetLinks[].tileMatrixSetLinked matrix set identifierGrid/CRS selection
tileMatrixSetLinks[].limitsOptional WMTSTileMatrixLimits[]Inclusive coverage check before tile fetch
dimensionsOptional WMTSDimension[]Preserve metadata and resolve default values
boundsWGS84 lower/upper cornersNormalized source extent
contents.tileMatrixSets[].matricesOrdered identifiers, scale denominators, origins, tile/matrix sizesMatrix selection and grid metadata

WMTSTileMatrixLimits contains tileMatrix, minimumTileRow, maximumTileRow, minimumTileColumn, and maximumTileColumn. The parser maps these from XML MinTileRow, MaxTileRow, MinTileCol, and MaxTileCol. Indices are nonnegative safe integers and bounds are inclusive. Missing or duplicate identifiers, missing/invalid indices, and reversed bounds are rejected while parsing. Omitted limits differ from an explicitly empty list: omission permits the full matrix, while a list allows only the matrices and ranges it contains. Supplied capabilities receive equivalent bound checks when the source tests coverage.

WMTSDimension contains identifier, optional title, abstract, unitsOfMeasure, unitSymbol, default, current, and a values array. Values/defaults are strings, preserving zero, leading zeros, ISO8601 timestamps, intervals, and reserved keywords. Intervals are not expanded, and current support alone does not select current.

See WMTS coverage and dimension handling for request precedence, synchronous coverage queries, skipped tiles, and remaining rendering limits.

Options​

OptionTypeDefaultDescription

featureInfoUrl selects an advertised HTTP GET GetFeatureInfo binding that permits KVP encoding. Endpoint, operation, and global GetEncoding constraints are respected; REST-only bindings are not used as KVP endpoints. If operation metadata is present without a supported query GET binding, this value is null. Missing operation metadata leaves it undefined for legacy/manual endpoint configuration. See WMTS feature information for request and response APIs.