Skip to main content

OGC API services

Use the service path that matches the data.

The OGC API family exposes linked JSON resources and focused HTTP operations. loaders.gl provides small source adapters for the common read paths, with the protocol boundaries kept visible.

A focused service client

Discover, request, and keep the response shape explicit.

Each OGC API source follows the links and operations it understands, then returns a documented result. Applications can add service-specific parameters without adopting a universal abstraction.

Features

Collections and items with bounding boxes, CRS, and preserved paging links.

Tiles

Known tile links and templates returned as raw tile bytes.

Coverages

Collection subsets returned as JSON or binary coverage data.

EDR

Position, area, trajectory, corridor, cube, and radius queries.

Detailed guide

OGC API service details

The reference below compares the supported APIs, source loaders, response paths, and intentional conformance boundaries.

The OGC API family replaces monolithic XML web-service protocols with linked JSON resources and focused HTTP APIs. @loaders.gl/ogc/wms provides deliberately small, interoperable adapters for the common read paths. They are useful compatibility clients, not claims of complete conformance to every optional OGC API building block.

Family overview​

APISource loaderDiscoveryData pathOutputScope
OGC API FeaturesOGCAPIFeaturesLoaderLanding page and collectionsCollection items with bbox and CRSGeoJSON, binary, ArrowMinimal read client
OGC API TilesOGCAPITilesLoaderLanding-page tile link and tileset tile matrix setExplicit tile templateRaw tile bytesMinimal template client
OGC API CoveragesOGCAPICoveragesLoaderLanding page and collectionsCollection coverage with subsetsJSON object or binary bytesMinimal read client
OGC API EDROGCAPIEDRLoaderLanding page and collectionsSix spatiotemporal query shapesJSON object or binary bytesFocused query client

All four sources support standard loaders.gl fetch options for headers, credentials, proxies, cancellation, and custom transports.

OGC API Features​

The Features path shares the vector-source, Arrow, managed-loading, and local-query integrations used by WFS. The table distinguishes implemented read operations from optional protocol classes.

AreaCapabilityStatusAPI, guarantee, or boundary
DiscoveryLanding page and collections✅ SupportedgetLandingPage() and getCollections()
DiscoveryCollection URL or service URL✅ SupportedCollection inferred from URL or selected by collectionId/layers
DiscoveryNormalized metadata✅ SupportedCollection title, description, advertised CRSs, and first spatial extent
DiscoveryAutomatic queryables/schema negotiation❌ Not implementedSource schema is currently empty; materialized Arrow schemas are inferred
RequestsCollection items✅ Supported/collections/{id}/items and GeoJSON Accept negotiation
RequestsBounding box✅ SupportedStandard bbox, with canonical XY input and wire axis normalization
RequestsIndependent bounds and output CRSs✅ SupportedrequestCrs sends bbox-crs; crs controls the requested response CRS
RequestsFeature request cancellation✅ SupportedAbortSignal forwarded to the items fetch
RequestsCredentials and custom transport✅ SupportedCommon source fetch options
RequestsPortable attribute predicate pushdown / CQL2❌ Not implementedRelational adapter evaluates predicates locally; custom HTTP requests remain possible
RequestsAutomatic next-link pagination⚠️ Supported with limitsOpt-in ogc-api.pagination gathers same-origin body/HTTP-header next links, with bounded requests and cancellation
RequestsPage-size control✅ Supportedpagination.pageSize requests limit; services may cap it
RequestsItem-by-ID and datetime convenience methods❌ Not implementedCurrent normalized API focuses on bounding-box item requests
OutputGeoJSON validation and foreign members✅ SupportedRequires FeatureCollection and a features array; single-page responses preserve links/counts
OutputBinary feature collections✅ Supportedformat: 'binary'
OutputArrow and GeoArrow encoding preferences✅ Supportedformat: 'arrow', WKB/native/mixed union preferences
LoadingComplete extent reuse and uncovered rectangles✅ Supported via wrapperManagedVectorSource requires verified complete results and explicit equivalent CRSs
LoadingShared requests and independent cancellation✅ Supported via wrapperLast waiting consumer can abort the underlying request
LoadingRetry, invalidation, and bounded retention✅ Supported via wrapperFailed, incomplete, and unknown-completeness pages do not establish coverage
LoadingStable-ID deduplication⚠️ PartialTyped IDs or custom accessor; features without stable IDs are retained separately
QueriesCommon scan/query interface✅ Supported via adapterVectorFeatureTableScanSource evaluates one materialized bounded result
QueriesID, bounds, exact intersection, nearest geometry✅ Supported locallyGeoArrowSpatialIndex includes offscreen loaded rows
Renderingdeck.gl integration✅ SupportedImplements VectorSource; direct or managed source works with SourceLayer
MutationTransactions and mutable feature-store events❌ Not implementedRead-only adapter; explicit cache invalidation after external changes
ConformanceAll optional OGC API Features classes❌ Not implementedFocused read client; no blanket standards certification claim

Progressive pages and complete collection​

Configure {'ogc-api': {pagination: {pageSize: 1000, maxPages: 100, maxFeatures: 100000}}} to gather service pages in getFeatures() before converting to the requested encoding. Omit pagination to retain one-page behavior. The three positive-integer bounds default to those values. Exhausting a bound throws instead of returning a silently truncated aggregate.

import {OGCAPIFeaturesSource} from '@loaders.gl/ogc/wms';

const source = new OGCAPIFeaturesSource(serviceUrl, {'ogc-api': {collectionId: 'roads'}});
for await (const page of source.getFeaturesInPages({
layers: 'roads', boundingBox: [[-10, -5], [10, 5]], format: 'geojson', signal
}, {pageSize: 500, maxPages: 20})) {
// Every yield is a normalized GeoJSON table, without fetching the next page ahead.
processFeatures(page.features);
}

Traversal follows relative or absolute rel: 'next' links from the body or HTTP Link header, resolving against the response URL. It does not invent an offset parameter. Links must use the original origin and HTTP(S), without embedded credentials. Initial endpoint parameters are preserved, and opaque next URLs are followed as supplied by the service. A numeric total that exceeds the collected count without a next link is an error. An empty terminal page is allowed; an empty page with another continuation is rejected.

Cancellation, failed later pages, inconsistent counts, repeated URLs/pages/IDs, and exhausted limits fail the traversal and prevent managed coverage from being established. Early loop exit stops further requests. Pages already yielded remain partial until traversal finishes. Stable paging depends on the service; concurrent dataset changes are not a transactional snapshot.

Collected GeoJSON removes page-specific links/extents and updates numberReturned. Unknown numberMatched stays unknown; it never becomes fabricated completeness evidence. ManagedVectorSource can retain a collected result only when the service's numeric total matches its rows. Arrow and binary conversion happens once after collection; per-page GeoJSON remains materialized rather than a network-streamed feature parser. These rules follow OGC API Features Core.

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

const source = createDataSourceSync(
'https://demo.ldproxy.net/daraa',
[OGCAPIFeaturesLoader],
{'ogc-api': {collectionId: 'VegetationSrf'}}
);

const features = await source.getFeatures({
layers: ['VegetationSrf'],
boundingBox: [[36.0, 32.5], [36.2, 32.7]],
format: 'arrow'
});

OGC API Tiles​

CapabilitySupportBehavior
Landing-page metadata✅ SupportedReads title and advertised tileset media type
Explicit tile template✅ RequiredConfigure ogc-api.tileTemplate
OGC placeholders✅ Supported{tileMatrix}, {tileRow}, {tileCol}; {tileMatrix} is the tileMatrix parameter, or the configured or discovered matrix id for z
XYZ placeholders✅ Supported{z}, {y}, {x}
Tile retrieval✅ SupportedgetTile() returns the original ArrayBuffer
Tile matrix set✅ Supportedogc-api.tileMatrixSet (a TileMatrixSet 2.0 document or URL) is reported as tileGrid
Tile matrix set discovery✅ SupportedWithout ogc-api.tileMatrixSet, found from the tileset that tileTemplate belongs to; a failure rejects, and discoverTileMatrixSet: false opts out
Tile matrix set endpoints✅ SupportedgetTileMatrixSets() lists /tileMatrixSets; getTileMatrixSet(id) fetches /tileMatrixSets/{id}
Tile matrix set limits✅ SupportedDiscovered or configured inclusive limits are exposed as tileGrid.limits; unavailable tiles return null without fetching
Tile matrix set negotiation❌ Not implementedThe tileset is the one the configured template names; other tilesets are not compared
Tile decoding❌ Not automaticParse bytes with the loader matching the advertised media type
deck.gl⚠️ Foundation onlyThe generic tile contract is present; callers must provide the appropriate decoded tile type
import {createDataSourceSync} from '@loaders.gl/core';
import {OGCAPITilesLoader} from '@loaders.gl/ogc/wms';

const source = createDataSourceSync(landingPageUrl, [OGCAPITilesLoader], {
'ogc-api': {
tileTemplate: 'https://example.com/tiles/{tileMatrix}/{tileRow}/{tileCol}.png'
}
});

const tileBytes = await source.getTile({z: 3, x: 4, y: 5});

Tile URL resolution​

Relative tile templates and matrix-set URLs resolve against the API landing page treated as a directory. Root-relative paths use its origin. Path-relative APIs such as ../api remain path-relative, including parent-directory segments, so metadata and tile content use the same base.

Tile matrix sets​

convertOGCTileMatrixSetToTileGrid() converts an OGC TileMatrixSet 2.0 JSON document (OGC 17-083r4) to the shared TileGrid shape. Configuring ogc-api.tileMatrixSet on the tiles source does the same conversion in getMetadata(), fetching the document once when it is a URL; a relative URL resolves against the landing page.

  • Origins are returned in XY order. Declared orderedAxes decide the swap (a first axis naming latitude, northing, southing, or Y); without them, only EPSG:4326 is swapped.
  • A bottom-left origin is reported per level only; the grid-wide tileGrid.origin is top-left by definition and is omitted.
  • cornerOfOrigin: 'bottomLeft' is preserved on each matrix; omitted means top-left.
  • tileGrid.tileMatrixSet holds every level as a math.gl TileMatrix, for use with the @math.gl/geospatial tile-matrix utilities, when every level has a resolution, origin, tile size and matrix size that pass validateTileMatrix(). tileGrid.matrices keeps the levels as advertised, which may be incomplete.
  • cellSize is used when present. A scale denominator alone becomes a resolution only for a known unit: EPSG:4326, CRS:84, Web Mercator, or the metersPerUnit option.
  • A crs URI string or {uri} object is reported as tileGrid.crs; embedded WKT and PROJJSON definitions are not interpreted.
  • variableMatrixWidths bands are preserved in native row numbering. Complete coalesced geometry supports canonical tile requests and row-aware fixed-frame selection. Limits use base-grid columns; a canonical column may precede the first covered alias. Coalesced requests require complete geometry, and the default XYZ renderer rejects these grids.
  • Matrix identifiers are URL encoded when expanding {tileMatrix}. Duplicate identifiers, invalid cellSize, and unknown origin corners are rejected. Missing tile dimensions remain incomplete instead of assuming square tiles.
  • Tile requests fill {tileMatrix} with the tileMatrix parameter when given. Otherwise they use the matrix whose id equals z, then the matrix at index z, as in WMTS; this legacy rule is kept for compatibility. With a tile matrix set, a matrix it does not contain throws a RangeError instead of being requested as z. {z} stays numeric. getTile() loads a matrix set given by URL first; getTileURL() uses it once getMetadata() has loaded it.
  • setProps() replaces an inline tileMatrixSet document as a whole rather than merging fields.

Matrix dimensions must either include both matrixWidth and matrixHeight or omit both. A one-axis dimension declaration is rejected rather than silently losing its request bounds.

Tile availability limits​

Discovered tileset tileMatrixSetLimits values are normalized into tileGrid.limits. Each entry names a tileMatrix and has inclusive minTileRow, maxTileRow, minTileColumn, and maxTileColumn bounds. Coverage is independent of geometry: limits remain useful when a matrix lacks the resolution or origin needed for a complete tileGrid.tileMatrixSet.

An omitted limits list allows all positions inside known matrix dimensions. A present list allows only its listed matrices and ranges; [] allows no tiles. Unknown explicit matrix identifiers, invalid indices, and malformed coverage metadata throw. An absent numeric level or a position outside coverage is unavailable.

After await source.getMetadata(), use source.isTileAvailable(parameters) for synchronous selection. getTile() returns null outside coverage without a tile request; getTileURL() throws for those positions. Matrix dimensions, when known, also bound requests. Availability does not guarantee nonempty tile content.

Set ogc-api.tileMatrixSetLimits to override discovered coverage, including with an empty list. Native option fields use the OGC names minTileCol and maxTileCol. Pass a new array through setProps() to replace coverage and invalidate the cache; setting it to undefined restores discovered limits. Configured matrix sets do not discover tileset coverage, so supply limits alongside them when needed.

See Tile matrices and tile matrix sets for geometry, CRS, origin, identifier, and rendering concepts.

Tile matrix set discovery​

When ogc-api.tileMatrixSet is not set and tileTemplate contains /{tileMatrix}, the source discovers the tile matrix set as OGC API - Tiles Part 1 describes it:

  1. The tileset metadata is the template path before /{tileMatrix}, such as /tiles/{tileMatrixSetId} or /collections/{collectionId}/tiles/{tileMatrixSetId}. Query parameters other than the f format selector are kept.
  2. Its http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link (or the older tiling-scheme) is followed, preferring a JSON link and resolving it against the tileset URL.
  3. Without such a link, tileMatrixSetId is fetched from /tileMatrixSets/{tileMatrixSetId}, and a tileMatrixSetURI is looked up by uri in the /tileMatrixSets list. Registry URIs are not fetched, and no built-in tile matrix sets are used.

/tileMatrixSets paths resolve against the landing page, and every request uses the source's fetch options. The discovered grid is used for tileGrid and for {tileMatrix}, like a configured one, and is reused until tileTemplate, tileMatrixSet, tileMatrixSetLimits or metersPerUnit changes. getTile() waits for discovery before its first request.

Discovery failure is an error, not an approximation. getMetadata() and getTile() reject with the cause, and getTileURL() throws until the matrix set has loaded, so z is never requested in place of a matrix identifier. A failure is not cached: the next getMetadata() or getTile() call tries again, and concurrent calls share one attempt. A configured tileMatrixSet that fails to load behaves the same way. A tileMatrix tile parameter is used verbatim before discovery.

For a service whose matrix identifiers are zoom numbers and that publishes no tileset metadata, set discoverTileMatrixSet: false: {tileMatrix} is then the tileMatrix parameter, otherwise z, as before discovery existed. Templates that use only {z}, {x} and {y} never discover.

const source = createDataSourceSync('https://example.com/ogcapi', [OGCAPITilesLoader], {
'ogc-api': {
tileTemplate:
'https://example.com/ogcapi/tiles/WebMercatorQuad/{tileMatrix}/{tileRow}/{tileCol}?f=mvt'
}
});
// Reads /tiles/WebMercatorQuad, then the tile matrix set its tiling-scheme link names
const {tileGrid} = await source.getMetadata();
import {convertOGCTileMatrixSetToTileGrid} from '@loaders.gl/ogc/wms';

const response = await fetch('https://example.com/ogcapi/tileMatrixSets/UTM18N');
const tileGrid = convertOGCTileMatrixSetToTileGrid(await response.json(), {metersPerUnit: 1});
// tileGrid.tileMatrixSet?.matrices[i]: {id, resolution, origin, cornerOfOrigin, tileSize, matrixSize}

const tileBytes = await source.getTile({z: 3, x: 4, y: 5, tileMatrix: 'UTM18N:3'});

OGC API Coverages​

CapabilitySupportBehavior
Landing page✅ SupportedgetLandingPage()
Collections✅ SupportedgetCollections()
Collection coverage✅ SupportedRequests /collections/{id}/coverage
Bounding box✅ SupportedSends bbox
Dimension subsets✅ SupportedSends repeated subset parameters
Time selection✅ SupportedSends datetime
Format negotiation✅ SupportedSends f and an Accept header
JSON representations✅ SupportedReturned as parsed objects
Binary representations✅ PreservedReturned as ArrayBuffer
Coverage decoding⚠️ Application controlledPass binary output to GeoTIFF, LERC, or another appropriate loader
Processing and visualization❌ Not providedValues are not resampled or colorized implicitly
import {createDataSourceSync} from '@loaders.gl/core';
import {OGCAPICoveragesLoader} from '@loaders.gl/ogc/wms';

const source = createDataSourceSync(landingPageUrl, [OGCAPICoveragesLoader], {
'ogc-api-coverages': {collectionId: 'temperature'}
});

const coverage = await source.getCoverage({
bbox: [-10, 40, 10, 50],
subset: ['Lat(40,50)'],
datetime: '2025-01-01/2025-01-31',
format: 'application/json'
});

OGC API EDR​

EDR—Environmental Data Retrieval—queries multidimensional observations by space, time, vertical level, and parameter.

CapabilitySupportBehavior
Landing page and collections✅ SupportedCommon OGC API discovery methods
Position query✅ SupportedPoint observations
Radius query✅ SupportedObservations around a position
Area query✅ SupportedPolygon or bounding-area observations
Cube query✅ SupportedMultidimensional bounding volume
Trajectory query✅ SupportedObservations along a path
Corridor query✅ SupportedObservations in a buffered path
Time, vertical, parameter, and CRS controls✅ SupportedStandard query parameters are generated
GeoJSON and CoverageJSON✅ SupportedJSON media types are returned as objects
Binary representations✅ PreservedNon-JSON responses are returned as ArrayBuffer
Domain-specific interpretation⚠️ Application controlledUnit conversion and scientific analysis remain explicit
deck.gl❌ Not directConvert the selected response representation into a visual source first
import {createDataSourceSync} from '@loaders.gl/core';
import {OGCAPIEDRLoader} from '@loaders.gl/ogc/wms';

const source = createDataSourceSync(edrUrl, [OGCAPIEDRLoader], {
'ogc-api-edr': {collectionId: 'weather'}
});

const observations = await source.query({
queryType: 'position',
coords: 'POINT(10 20)',
datetime: '2025-01-01',
parameterName: ['temperature', 'wind'],
format: 'application/geo+json'
});

Choosing OGC API or classic OGC Web Services​

NeedPrefer
Broad server compatibility and mature map renderingWMS or WMTS
High-volume GML feature streamingWFS
A straightforward GeoJSON collection endpointOGC API Features
Capability-driven tiled imagery with complex matrix setsWMTS
A known modern tile templateOGC API Tiles
Established coverage servers and LERC decodingWCS
A modern JSON coverage endpointOGC API Coverages
Environmental position, area, trajectory, or corridor queriesOGC API EDR

Scope boundary​

The adapters intentionally avoid implementing optional conformance classes merely to check boxes. Advanced CQL2 filters, transactions, schema extensions, process execution, and provider-specific extensions should be added only when real service interoperability requires them. Standard fetch APIs remain available for those escape hatches.

For a live Features endpoint, see the ldproxy Daraa demonstration. Live services are not used by CI; deterministic repository fixtures remain the conformance source of truth.