Skip to main content

Service discovery

Find the right endpoint before creating a source.

Service directories and OGC landing pages describe relationships, formats, coordinate systems, and quality at different levels of detail. discoverServiceGraph records that information so an application can make an explicit choice.

Discovery without lock-in

Collect options, keep the decision in application code.

The graph follows known service relationships and normalizes the capabilities it can identify. It does not crawl arbitrary pages or hide protocol-specific source behavior.

Discover

Follow typed links, landing pages, and service-directory children.

Describe

Preserve type, formats, CRS, tile grids, latency, and quality.

Rank

Apply application preferences to produce candidate endpoints.

Create

Pass the chosen endpoint to its concrete source loader.

Detailed guide

Discovery graph details

The reference below defines graph contents, ranking inputs, serialization, invalidation, and the boundary between discovery and source execution.

discoverServiceGraph follows service-directory JSON and OGC landing-page links and returns a serializable CapabilityGraph. The graph records what was discovered without forcing applications through a universal service abstraction.

Feature support​

CapabilitySupportBehavior
OGC landing-page links✅ SupportedFollows typed and related service links
ArcGIS-style service directories✅ SupportedRecords listed child service endpoints
Relationship graph✅ SupportedPreserves service, service-desc, and other link relations
Endpoint capabilities✅ SupportedStores type, formats, CRS, tile grid, and quality when available
Ranking✅ SupportedPreferences include type, format, CRS, latency, and quality
Latency observations✅ SupportedOptional measurements contribute to ranking
Serialization✅ SupportedGraph data can be cached outside the runtime
Automatic invalidation❌ Application controlledPersisted graphs require an application cache policy
Deep web crawling❌ Not performedDiscovery follows service relationships, not arbitrary pages
Source creation✅ ExplicitSelect an endpoint, then use its concrete source loader
import {discoverServiceGraph} from '@loaders.gl/ogc/wms';

const graph = await discoverServiceGraph('https://example.com/rest/services');
const preferred = graph.rank({
types: ['wmts', 'arcgis-image-server'],
formats: ['image/png'],
crs: ['EPSG:3857']
});

Each ranked item remains a normal endpoint description. Applications can inspect the reasoning, apply business rules, or create a source with the relevant loader. Discovery is therefore useful without becoming a mandatory abstraction layer for direct service access.