Skip to main content

WMS module · catalog service

Give catalog search a typed application boundary.

CSWService wraps the OGC Catalogue Service for the Web protocol and parses its responses into usable metadata, catalog records, domains, and referenced services.

The CSW service path

Discover, search, and resolve without parsing XML yourself.

CSWService keeps protocol request construction and response parsing together, while leaving the decision about which discovered WMS, WMTS, or WFS endpoint to use with the application.

Capabilities

Read and normalize GetCapabilities metadata

Catalog records

Search and retrieve typed records

Service directory

Extract known service references

Boundary

GET/KVP requests; XML POST generation is not supported

Detailed guide

CSWService reference

The sections below document construction, capabilities, catalog records, service discovery, request options, and current protocol limits.

From-3.4Status: Experimental

The CSWService class provides OGC CSW (catalog service for the web) access

  • Type safe methods to call and parse results (and errors) from a CSW service's endpoints
  • In particular, the big GetCapabilities metadata is normalized into a fully typed data structure.

The CSWService generates URLs with URL parameters intended to be used with HTTP GET requests against a CSW server. The OGC CSW standard also allows CSW services to accept XML payloads with HTTP POST messages, however generation of such XML payloads is not supported by this class.

PropertyValue
Data sourceCSWCatalogSource

Usage​

A CSWService instance provides type safe methods that make calls to the service and parse the responses.

Get a normalized array of all the services and resources referenced by this catalog server:

const cswService = createDataSourceSync(CSW_SERVICE_URL, [CSWLoader]);
const serviceDirectory = await cswService.getServiceDirectory({includeUnknown: true});
console.log(serviceDirectory);

Capabilities metadata can be queried:

const cswService = createDataSourceSync(CSW_SERVICE_URL, [CSWLoader]);
const capabilities = await cswService.getCapabilities({});
// Check capabilities

For shared loading controls and parser configuration, see Source options.

Methods​

constructor()​

Creates a CSWCatalogSource instance. Prefer createDataSource to inject the core parsing API.

constructor(url: string, options: CSWLoaderOptions, coreApi?: CoreAPI)

getCapabilities()​

Get Capabilities

async getCapabilities(
cswParameters?: CSWGetCapabilitiesParameters,
vendorParameters?: Record<string, unknown>
): Promise<CSWCapabilities>

getServiceDirectory()​

Get a list of all service exposed by this catalog server.

async getServiceDirectory(
options: CSWGetMapParameters,
vendorParameters?: Record<string, unknown>
): Promise<Service[]>
export type CSWGetMapParameters = {
includeUnknown: boolean; // Include services and resources that loaders.gl cannot handle
};