Skip to main content

WMS module · geospatial loader

GMLLoader

Parse the practical feature and geometry subset of OGC Geography Markup Language into Arrow tables with GeoArrow geometry, including incremental feature batches for large responses.

What it reads

Extract useful features from an ambitious XML standard.

GML covers a very broad space. GMLLoader focuses on the common feature-collection and geometry path, with a streaming mode that emits complete features as the response arrives.

Input

GML feature collections and responses

Geometry

Points, lines, polygons, and multiparts

Output

Arrow feature tables or explicit GeoJSON

Streaming

Feature batches for large WFS responses

Detailed guide

GMLLoader reference

The sections below document usage, parsed data, streaming behavior, options, and the supported subset.

From-3.3Status: Experimental

The GMLLoader parses the XML-formatted response from the the OGC-standardized GML (Geographic Markup Language) file format into a standard geospatial feature table.

Note that the GML standard is very ambitious and full support of the format is out of scope.

GMLLoader
File Extension.gml
File TypeText
File FormatGML
Data FormatArrow table with GeoArrow WKB geometry
Decoder TypeSynchronous
Worker Thread❌ No
Streaming SupportFeature collections

Usage​

import {GMLLoader} from '@loaders.gl/ogc/wms';
import {load} from '@loaders.gl/core';

// Form a GML request
const url = `${WFS_SERVICE_URL}?REQUEST=GetFeature&...`;

const data = await load(url, GMLLoader, options);

Parsed Data Format​

The GMLLoader supports the standard geospatial subset of geometries (points, multipoints, lines, linestrings, polygons and multipolygons). By default, it returns an Apache Arrow Table. Feature properties and IDs become columns and geometry uses geoarrow.wkb. A bare geometry becomes a one-row table; an empty result becomes an empty table. Coordinates are not reprojected, and CRS metadata is explicitly unknown (crs: null); this loader does not yet resolve GML srsName into Arrow CRS metadata.

Set gml.shape: 'geojson' to retain the previous FeatureCollection, bare geometry, or null result. Arrow conversion rejects properties that collide with the output geometry column or a feature ID's id column; explicit GeoJSON retains both values. The root GMLLoader is metadata-only (_GMLLoader remains an alias). Synchronous parsing uses GMLLoaderWithParser from @loaders.gl/ogc/gml.

For large WFS responses, the parser-bearing loader also supports incremental feature batches:

import {parseInBatches} from '@loaders.gl/core';
import {GMLLoader} from '@loaders.gl/ogc/wms';

for await (const batch of await parseInBatches(response.body, GMLLoader, {
gml: {batchSize: 500}
})) {
console.log(batch.numRows);
}

The streaming path emits complete featureMember / featureMembers features as they become available and keeps incomplete fragments buffered. Each Arrow batch infers its own property schema; heterogeneous batches can have different schemas. Bare geometries use whole-file parsing. Explicit gml.shape: 'geojson' returns FeatureCollection batches. WFS source output remains controlled by the WFS format option.

Options​

OptionTypeDefaultDescription
gml.shape'arrow' | 'geojson''arrow'Whole-file and streaming output shape.
gml.batchSizenumber1000Feature count per streaming batch.
gml.propertyTypesRecord<string, GMLPropertyType>—XML Schema scalar types keyed by local property name.
gml.transformCoords(...coordinates: number[]) => number[]IdentityOptional coordinate transformation.