Skip to main content

OGC service module

@loaders.gl/ogc/wms

The WMS module covers classic OGC Web Services, modern OGC APIs, and GML response parsing. It keeps capability discovery, request construction, and decoded results in explicit source contracts.

OGC Web Map Service example

Remote data, explicit steps

Discover once. Request only what the application needs.

Service sources keep endpoint metadata, request construction, and decoded results separate. That makes a remote dataset behave like a predictable part of the data path.

01 · discover

OGC service endpoint

Capabilities describe collections, operations, CRS, and response formats.

WMS / WMTSWFS / FeaturesWCS / EDR

02 · request

Build a standards-shaped request

Select a layer, collection, extent, time, or coverage slice.

layersbboxdatetimeformat

03 · application result

ImageSource · VectorSource · RasterSource

Decoded results can move into maps, analysis, scans, or application-owned code. ↗

The source owns protocol details; the application owns how returned features, pixels, tiles, or tables are used.

The service path

Discover capabilities before requesting data.

Service endpoints vary in operations and response formats. The module exposes that variability explicitly so an application can choose the right source, request, and output path.

Maps and tiles

WMS, WMTS, and OGC API Tiles

Features

WFS, OGC API Features, and GML

Coverages

WCS, OGC API Coverages, and EDR

Catalogs

CSW and OWS Context discovery paths

The @loaders.gl/ogc/wms module provides read-only clients and response parsers for classic OGC Web Services, modern OGC APIs, and GML. Despite the historical package name, it covers maps, tiles, features, coverages, environmental observations, and catalogs.

Detailed guide

Service support details

The sections below provide the service matrix, installation instructions, source APIs, and protocol-specific boundaries.

Service matrix​

Service or formatLoaderData sourceData categoryStatusBest use
WMSWMSLoaderWMSImageSourceRendered image✅ SupportedDynamic maps, feature information, legends
WMTSWMTSLoaderWMTSImageTileSourceImage tiles✅ SupportedCapability-driven tiled imagery
WFSWFSLoaderWFSVectorSourceVector features✅ SupportedGeoJSON or streaming GML feature queries
WCSWCSCoverageLoaderWCSCoverageSourceAnalytical raster⚠️ FocusedBinary coverages and decoded LERC
CSWCSWLoaderCSWCatalogSourceCatalog records⚠️ FocusedRead-only catalog search and service references
GMLGMLLoader—Vector format⚠️ Supported subsetHigh-volume WFS feature ingestion
OGC API FeaturesOGCAPIFeaturesLoaderOGCAPIFeaturesSourceVector features⚠️ MinimalCommon collections/items read path
OGC API TilesOGCAPITilesLoaderOGCAPITilesSourceTile bytes⚠️ MinimalKnown tile templates
OGC API CoveragesOGCAPICoveragesLoaderOGCAPICoveragesSourceCoverage data⚠️ MinimalCommon collection coverage endpoint
OGC API EDROGCAPIEDRLoaderOGCAPIEDRSourceEnvironmental observations⚠️ FocusedPosition, area, cube, and path queries
WMCNone—Map context❌ Not implementedDocumented to clarify scope
OWS ContextNone—Service context❌ Not implementedDocumented to clarify scope

“Focused” means the important read operations are implemented without claiming every optional operation. “Minimal” means a deliberately small interoperability adapter for the most common OGC API path.

ArcGIS REST services are provided by @loaders.gl/arcgis.

Installation​

npm install @loaders.gl/core @loaders.gl/ogc

Install @loaders.gl/deck-layers when visual services should render directly through deck.gl.

Standard source workflow​

Every service source can be created through the loaders.gl core API:

import {createDataSourceSync} from '@loaders.gl/core';
import {WMSLoader} from '@loaders.gl/ogc/wms';

const source = createDataSourceSync(wmsUrl, [WMSLoader], {
wms: {wmsParameters: {layers: ['workspace:roads']}}
});

const metadata = await source.getMetadata();
const image = await source.getImage({
layers: ['workspace:roads'],
boundingBox: [[-10, 40], [10, 50]],
crs: 'CRS:84',
width: 1024,
height: 512
});

The concrete runtime contract reflects the data category:

ContractTypical methodsServices
ImageSourcegetMetadata, getImageWMS
TileSourcegetMetadata, getTile, getTileDataWMTS, OGC API Tiles
VectorSourcegetMetadata, getSchema, getFeaturesWFS, OGC API Features
Coverage sourcegetMetadata, getCoverageWCS, OGC API Coverages
Catalog sourcegetMetadata, searchCSW
EDR sourcegetLandingPage, getCollections, queryOGC API EDR

deck.gl integration​

Visual service sources work through one generic SourceLayer:

import {SourceLayer} from '@loaders.gl/deck-layers';
import {WMTSLoader} from '@loaders.gl/ogc/wms';

const layer = new SourceLayer({
id: 'satellite',
data: wmtsUrl,
loaders: [WMTSLoader],
sourceOptions: {wmts: {layer: layerId, tileMatrixSet: matrixSetId}}
});

WMS, WMTS, WFS, and OGC API Features map naturally to visual source contracts. Catalog, EDR, and analytical coverage outputs require an application choice before rendering: select a catalog record, EDR representation, raster band, color ramp, and NoData policy first.

Shared service infrastructure​

  • ServiceRuntime adds loader selection, source caching, retries, cancellation, shared headers, and telemetry.
  • CapabilityGraph records relationships among discovered endpoints and ranks them by type, format, CRS, latency, and quality.
  • CRS and tile-grid utilities normalize identifiers, axis order, matrix sets, ArcGIS LODs, and antimeridian-sensitive metadata.
  • Service capabilities provide a provider-neutral metadata shape while concrete sources retain provider-specific details.

These pieces are optional. If an endpoint and protocol are already known, creating the concrete source directly remains the smallest API.

Authentication and errors​

All sources inherit loaders.gl fetch configuration. Applications can provide headers, credentials, request middleware, proxies, and custom fetch functions without protocol-specific wrappers. Abort signals are accepted by data requests that may be long-running.

Pass exact-origin query or bearer credentials through core.credentials, or configure them once on ServiceRuntime. They are propagated to the concrete source and redacted from runtime telemetry and normalized errors. See the authentication guide.

Protocol errors are checked before parsing. WMS and related XML service exceptions use dedicated error parsers; focused adapters report the operation and HTTP status.

Testing and conformance policy​

Fast tests use deterministic fixtures and block public-network access. Fixtures cover protocol versions, namespace variations, axis order, matrix grids, streaming chunk boundaries, and provider metadata. Live examples are demonstrations, not CI dependencies.

loaders.gl documents its actual implemented subset on each service page. Optional standards features are marked pass-through or unsupported instead of being implied by the existence of a capabilities parser.

Attributions​

@loaders.gl/ogc/wms uses @loaders.gl/documents for XML parsing. Some test fixtures originated from OpenLayers and retain their licenses in the test data; no OpenLayers runtime code is included in the published module.

Spatial queries beyond picking​

Use capability-derived WMTS configuration for advertised tile styles, formats, matrix sets, and grid resolutions. The spatial-query guide covers extent-based WFS loading and local GeoArrow selection and snapping, including offscreen data.

The remaining GIS work tranches distinguish delivered source/query support from planned grid rendering, predicate pushdown, schema discovery, streaming, and global spatial semantics.