Skip to main content

FlatGeobuf loader

Decode indexed features into the shape your app needs.

FlatGeobufLoader reads binary feature records and lets applications choose a familiar GeoJSON table, Arrow table, columnar table, or binary geometry result.

From-v3.1arrow output from v5.0Status: Experimental

Choose the boundary

Keep features familiar, or make columns explicit.

The default result is an Arrow table for typed columns and direct table interoperability. GeoJSON and binary shapes remain available when application code needs them.

Default

Apache Arrow table with typed columns and WKB geometry

GeoJSON

GeoJSONTable for application code

Index

Bounding-box filtering before decode

Streaming

Source APIs for incremental reads

Loader for the FlatGeobuf format, a binary FlatBuffers-encoded format that defines geospatial geometries.

Detailed guide

Output shapes and loader options

The sections below cover usage, result shapes, GeoJSON and Arrow output, reprojection, and option details.

PropertyValue
Data sourceFlatGeobufVectorSource

Usage​

import {FlatGeobufLoader} from '@loaders.gl/geospatial/flatgeobuf';
import {load} from '@loaders.gl/core';

const arrowTable = await load(url, FlatGeobufLoader);
const geojsonTable = await load(url, FlatGeobufLoader, {
flatgeobuf: {shape: 'geojson-table'}
});

Outputs​

Shapes​

FlatGeobufLoader returns native Apache Arrow Table objects by default. Set flatgeobuf.shape to select another representation.

ShapeOutput
geojson-tableloaders.gl GeoJSON table
arrowApache Arrow Table with WKB geometry
columnar-tableloaders.gl columnar table
binary-geometryloaders.gl binary feature collection

GeoJSONTable​

The parser will return an array of GeoJSON features in the coordinate system of the input data. Set gis.reproject: true to transform coordinates; use gis.targetCrs to select the output CRS. If no target is provided, WGS84 is used for compatibility. Unknown source CRS metadata and unsupported requested transformations throw CRSReprojectionError.

Arrow​

By default, FlatGeobufLoader returns an Apache Arrow table that preserves FlatGeobuf property columns and appends a WKB geometry column annotated with geospatial schema metadata. Set flatgeobuf.shape to 'arrow' explicitly when using another default or shared option bag. From-v5.0

Options​

OptionTypeDefaultDescription
flatgeobuf.shapestring'arrow'Output shape: 'geojson-table', 'arrow', 'columnar-table', or 'binary-geometry'.
gis.reprojectbooleanfalseWhether to transform input data into gis.targetCrs (WGS84 when omitted).
gis.targetCrsCRSDefinition'WGS84' when reprojection is enabledOutput CRS for transformed coordinates.

Remarks​

The FlatGeobufLoader wraps the flatgeobuf NPM module which is published under the ISC license.