Skip to main content

Indexed geospatial format

A binary feature stream with a spatial index.

FlatGeobuf stores geospatial features in a compact binary layout and can include a packed Hilbert R-tree. loaders.gl uses that structure for streaming, Arrow conversion, and viewport-sized reads from remote files.

Indexed feature data

Read features without downloading unrelated space.

FlatGeobuf keeps feature records binary and streamable, while its optional index lets a source select records intersecting a bounding box before decoding the complete file.

Header

Schema, geometry metadata, bounds, and optional index information.

Index

Packed spatial nodes guide bounding-box range requests.

Decode

Return GeoJSON, Arrow, columnar, or binary feature data.

Stream

Process features incrementally when a complete table is unnecessary.

Detailed guide

FlatGeobuf format and API details

The reference below covers the binary layout, spatial index, feature encodings, streaming behavior, and source selection rules.

CharacteristicValue
File FormatFlatGeobuf
Data FormatGeometry Tables, Arrow tables, binary features
File Extension.fgb
MIME Typeapplication/octet-stream
File TypeBinary
Loader APIsload, loadInBatches, parse, parseSync, parseInBatches
Loader Worker Thread✅ Yes
Loader Streaming✅ Yes
Source APIscreateDataSource, getMetadata, getSchema, getFeatures

Loaders and Sources​

Spatial Indexes​

FlatGeobuf files can include a packed spatial index for range-request access. FlatGeobufLoader uses that index when present to fetch viewport-sized feature subsets from remote files.

Arrow​

Set flatgeobuf.shape: 'arrow' to preserve FlatGeobuf property columns in an Arrow table and append a WKB geometry column with geospatial metadata.