Skip to main content

OGC vector service

Query features without taking ownership of the whole service response.

WFS exposes vector features over HTTP. The loaders.gl source handles capabilities, bounds, CRS, paging, GeoJSON, and streaming GML while keeping the result usable as features, binary data, or Arrow tables.

loaders.gl support​

TypeAPI
Source loaderWFSLoader

The WFS request path

Discover the layer. Bound the request. Stream the features.

A WFS response can be large and service-specific. Keep the request explicit, then normalize the response at the source boundary for map layers and table processing.

Discover

Feature types, CRS, formats, and service limits

Bound

Layer, extent, properties, paging, and filters

Stream

GML features in bounded batches

Return

Vector features, binary data, or Arrow tables

Optional scan table view

WFS serves vector features and properties over HTTP. WFSLoader provides a read-only VectorSource with GeoJSON and streaming GML ingestion.

Detailed guide

WFS protocol and source details

The reference below covers version differences, feature requests, output formats, paging, CRS handling, filters, and the optional scan table view.

Feature support​

The source combines service discovery, protocol-aware requests, streaming GML, three feature representations, and optional table and spatial-query integrations. Supported means implemented in the named API; Partial identifies a narrower path; Not implemented identifies a gap. These are implementation capabilities, not certification of every optional WFS conformance class.

AreaCapabilityStatusAPI, guarantee, or boundary
DiscoveryWFS 2.0.0✅ SupportedDefault request version; TYPENAMES, COUNT, and standard operation URLs
DiscoveryWFS 1.1.0✅ SupportedVersion-aware TYPENAME, MAXFEATURES, and axis handling
DiscoveryCapabilities and feature types✅ SupportedgetCapabilities() and normalized getMetadata() layers, titles, CRSs, and WGS84 bounds
DiscoveryOriginal service metadata✅ SupportedParsed capabilities retained in formatSpecificMetadata
DiscoveryAutomatic DescribeFeatureType schema discovery❌ Not implementedgetSchema() currently returns an empty schema; result-table schemas are inferred separately
RequestsExtent filtering✅ SupportedgetFeatures() sends canonical XY bounds with protocol-aware wire axis order
RequestsSeparate bounds and output CRSs✅ SupportedrequestCrs for the bounding box, crs for returned coordinates; server performs transformation
RequestsCRS aliases✅ SupportedCommon EPSG names, URNs, and URLs are normalized
RequestsPaging controls⚠️ PartialLow-level count, startIndex, and sortBy; WFS 1.1 offset support is server dependent
RequestsAutomatic pagination to complete an extent⚠️ Supported with limitsOpt-in wfs.pagination gathers next links or WFS 2.0 numeric-count offsets; WFS 1.1 requires next links
RequestsProperty projection and sorting✅ SupportedLow-level propertyName and sortBy controls
RequestsFES XML filters⚠️ PartialCaller-authored XML passes through; no portable predicate-to-FES translator
RequestsCount-only request URLs✅ SupportedresultType: 'hits'; count parsing/planning remains application controlled
RequestsEndpoint parameters and cancellation✅ SupportedPreserves endpoint parameters; getFeatures() forwards AbortSignal to fetch
IngestionGeoJSON FeatureCollection✅ SupportedValidates the response shape and preserves count/paging foreign members in single-page output
IngestionCommon GML 2/3 features and geometry✅ SupportedSAX-based parsing; see the GML support matrix for geometry boundaries
IngestionNetwork-streamed GML batches✅ SupportedgetFeaturesInBatches() decodes chunk boundaries into bounded batches
IngestionProgressive service pages✅ SupportedgetFeaturesInPages() yields normalized GeoJSON pages; each page is materialized, without prefetch
IngestionNetwork-streamed GeoJSON batches❌ Not implementedGeoJSON feature responses are materialized one page at a time
IngestionGML property type hints✅ SupportedApplication-supplied hints guide typed properties
OutputGeoJSON, binary features, and Arrow✅ SupportedStandard format parameter; Arrow is the WFS source default
OutputGeoArrow encoding preferences✅ SupportedWKB, native optimization, or mixed geometry union through geoarrow.encodingPreference
LoadingCoverage reuse and uncovered strips✅ Supported via wrapperManagedVectorSource caches verified complete responses with explicit equivalent input/output CRSs
LoadingShared requests, retry, invalidation, bounded retention✅ Supported via wrapperIndependent caller cancellation; failed/unknown/truncated responses never establish coverage
LoadingFeature deduplication⚠️ PartialWrapper uses stable typed IDs or a custom ID accessor; unidentified features remain separate
QueriesPortable scan/query interface✅ Supported via adapterVectorFeatureTableScanSource applies relational operations to one materialized bounded request
QueriesExact coordinate/extent selection and nearest geometry✅ Supported locallyGeoArrowSpatialIndex queries loaded rows, including offscreen data; independent of picking
Renderingdeck.gl source integration✅ SupportedSourceLayer consumes the vector source; a managed source can be supplied as data
MutationWFS-T transactions, locks, and mutable feature store❌ Not implementedRead-only protocol adapter; invalidate managed coverage after external edits

Bounded automatic pagination​

Enable wfs.pagination to make getFeatures() gather pages before converting the combined result to GeoJSON, Arrow, or binary. Without this option, getFeatures() retains its single-response behavior. To consume pages progressively, call getFeaturesInPages(parameters, options); this always yields GeoJSON tables and does not fetch ahead of the consumer.

import {ManagedVectorSource, WFSVectorSource} from '@loaders.gl/ogc/wms';

const source = new WFSVectorSource(wfsUrl, {
wfs: {
wfsParameters: {version: '2.0.0', sortBy: 'id'},
pagination: {pageSize: 1000, maxPages: 100, maxFeatures: 100000}
}
});
const managed = new ManagedVectorSource(source);
const features = await managed.getFeatures({
layers: 'roads',
boundingBox: [[-10, -5], [10, 5]],
requestCrs: 'CRS84',
crs: 'CRS84',
format: 'arrow'
});
OptionDefaultMeaning
pageSize1000Requested COUNT (MAXFEATURES for WFS 1.1); the service may cap it
maxPages100Maximum requests in one traversal, including the first
maxFeatures100000Maximum accumulated rows, before application deduplication

Next links in GeoJSON, GML next attributes, or HTTP Link headers take precedence over generated offsets. Relative links resolve against the response URL. Traversal accepts same-origin HTTP(S) links without embedded credentials. WFS 2.0 can continue with STARTINDEX when a numeric numberMatched/totalFeatures proves more rows remain; offsets advance by actual returned rows, so server page caps do not skip features. Existing bounds, CRS, filters, property projection, sorting, and endpoint parameters stay in offset requests. WFS 1.1 offset paging is not standardized, so truncated 1.1 responses require advertised next links.

Cancellation, HTTP errors, invalid counts, changing totals, repeated URLs/pages/IDs, empty pages with a continuation, and exhausted bounds throw. A failed traversal never establishes managed coverage. Pages already yielded to a progressive consumer remain partial until iteration finishes. Use a stable server-side sort when available: paging is not a transactional snapshot, and concurrent dataset edits may require a retry. Stop a progressive loop early to avoid further requests.

Collected GeoJSON retains service-supplied total counts and sets numberReturned to the combined row count; page-specific next/previous links and bounding boxes are removed. Unknown totals remain unknown and are not promoted to completeness evidence. ManagedVectorSource still requires a numeric total matching the collected row count before caching coverage. A configured nonzero startIndex selects a suffix of the result and cannot certify the whole extent. GML streaming getFeaturesInBatches() remains a separate single-response API; it does not traverse service pages.

The protocol rules follow the WFS 2.0 standard.

Optional scan table view​

WFS remains a service protocol. Layers, request bounds, CRS, paging, and output format stay in the WFS request. VectorFeatureTableScanSource can bind one bounded request that returns an Arrow table and apply portable relational operations to the returned feature rows.

CapabilitySupport
Layer, bounds, CRS, paging, and service filters✅ WFS source parameters
Table schema✅ Discovered from the bounded result
Predicate, projection, expressions, ordering, aggregates, and limit✅ Residual Arrow execution
Cancellation⚠️ Cancels a caller’s wait and table query; the shared initial fetch remains available to other callers
Automatic DescribeFeatureType planning❌ Not provided by the table-view adapter
Automatic translation of portable predicates to OGC filters❌ Not provided

Prefer native WFS filters and paging when the service can reduce a large response. The table view is most useful for normalizing and refining an already-bounded result.

Query features​

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

const source = createDataSourceSync(wfsUrl, [WFSLoader], {
wfs: {wfsParameters: {version: '2.0.0'}}
});

const metadata = await source.getMetadata();
const features = await source.getFeatures({
layers: ['workspace:roads'],
boundingBox: [[-10, 35], [10, 55]],
crs: 'EPSG:4326',
format: 'arrow'
});

Stream GML​

Request GML explicitly when a service does not provide GeoJSON or when a large response should be processed incrementally:

const source = createDataSourceSync(wfsUrl, [WFSLoader], {
wfs: {wfsParameters: {outputFormat: 'application/vnd.ogc.gml'}}
});

for await (const batch of source.getFeaturesInBatches(
{
layers: ['roads'],
boundingBox: [[-10, 35], [10, 55]],
crs: 'EPSG:4326',
format: 'arrow'
},
{batchSize: 1000}
)) {
consume(batch);
}

The parser recognizes GML member structure across arbitrary network chunks and converts each batch to the requested vector representation.

Paging and filters​

getFeaturesURL() exposes request controls when an application needs explicit pages or a server-specific filter:

const requestUrl = source.getFeaturesURL({
version: '2.0.0',
typeName: 'roads',
bbox: [-10, 35, 10, 55, 'EPSG:4326'],
count: 1000,
startIndex: 2000,
propertyName: ['name', 'geometry'],
filter: '<fes:Filter>...</fes:Filter>',
sortBy: 'name A'
});

Filter XML is passed through. Escape user-controlled values and use the FES version supported by the target server.

CRS and axis order​

The source normalizes common CRS spellings and applies the WFS version's axis-order rules to bounding boxes. CRS transformation is not silently applied to returned feature coordinates; request the desired output CRS from the server.

deck.gl integration​

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

const layer = new SourceLayer({
id: 'wfs-roads',
data: wfsUrl,
loaders: [WFSLoader],
layers: ['workspace:roads'],
pickable: true
});

Live example​

WFS map service example

References​

Selection and offscreen analysis​

See Spatial queries beyond picking for cancelable extent loading, managed coverage and retries, feature-ID lookup, exact coordinate/extent selection, and nearest geometry queries on returned GeoArrow data. Local queries include offscreen loaded rows and do not depend on deck.gl picking.

WFS 2.0 requests use TYPENAMES and COUNT; WFS 1.1 uses TYPENAME and MAXFEATURES. Endpoint query parameters are preserved, request parameters replace matching keys without regard to case, and zero-valued offsets are retained. A CRS supplied as the fifth bbox value controls bounding-box axis order independently of the output srsName.

getMetadata() normalizes WFS 1.1/2.0 feature types into layers, including names, titles, advertised CRSs, and WGS84 bounds. The parsed capabilities remain in formatSpecificMetadata.