The indexed query path
Read the header. Select the index ranges. Return matching features.
A FlatGeobuf source keeps the file remote and lets the spatial index narrow the bytes before geometry decoding.
Open
Remote `.fgb` URL or supported loaded data
Filter
Bounding box, layers, and output format
Transport
Coalesced byte ranges for selected index nodes
Output
GeoJSON table, binary features, or Arrow table
Cloud-native reads
Ask for the data. Fetch only the bytes behind it.
Range-aware sources translate a logical request into scheduled byte ranges. Metadata, caching, and cancellation stay in the transport layer while the application works with a normal decoded result.
Logical request
Range scheduler
offsets · limits · HTTP Range
Useful bytes
The same access pattern powers tiled scenes, columnar files, point clouds, and windowed rasters without making the whole object a prerequisite.
Detailed guide
Source behavior and output contracts
The reference below covers construction, query results, metadata, CRS handling, range requirements, and empty-result behavior.
The FlatGeobufLoader creates an indexed vector source for remote .fgb datasets and serves viewport-sized feature subsets through HTTP range requests.
Usage
import {createDataSource} from '@loaders.gl/core';
import {FlatGeobufLoader} from '@loaders.gl/geospatial/flatgeobuf';
const source = await createDataSource(url, [FlatGeobufLoader]);
const arrowTable = await source.getFeatures({
layers: 'dataset',
boundingBox: [
[-12, 35],
[30, 60]
],
format: 'arrow'
});
Outputs
format: 'geojson'returns aGeoJSONTable.format: 'binary'returns a binary feature collection.format: 'arrow'returns an Arrow table with FlatGeobuf property columns plus a WKBgeometrycolumn annotated with geospatial schema metadata.
Metadata
getMetadata() returns one logical source layer for the dataset, including:
- dataset name and title when available
- source bounds from the FlatGeobuf header envelope
- CRS identifiers from the FlatGeobuf header
- optional
formatSpecificMetadatawhen requested
Notes
FlatGeobufLoaderis optimized for remote URL access and expects byte-range fetches.- Bounding box requests use the FlatGeobuf spatial index when present and return empty valid tables when nothing matches.
- Source-level reprojection matches
FlatGeobufLoaderbehavior.
