Skip to main content

WMTSCapabilityLoader

ogc-logo

From-3.4

 

BETA

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.

LoaderCharacteristic
File Extension.xml
File TypeText
File FormatWMTS
Data FormatData structure
Decoder TypeSynchronous
Worker Thread SupportYes
Streaming SupportNo

Usage

import {WMTSCapabilitiesLoader} from '@loaders.gl/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

/** All capabilities of a WMTS service. Typed data structure extracted from XML */
export type WMTSCapabilities = {
name: string;
title?: string;
abstract?: string;
keywords: string[];
layer: WMTSLayer;
requests: Record<string, WMTSRequest>;
};

type WMTSLayer = {
name: string;
title?: string;
srs?: string[];
boundingBox?: [number, number, number, number];
layers?: WMTSLayer[];
};

type WMTSRequest = {
name: string;
mimeTypes: string[];
};

Options

OptionTypeDefaultDescription