GeoArrow module · conversion API
Cross the binary-to-GeoJSON boundary deliberately.
convertBinaryFeatureCollectionToGeojson turns the compact binary feature representation produced by convertGeojsonToBinaryFeatureCollection back into GeoJSON features for APIs, inspection, and application code that needs the familiar shape.
Choose the representation
Keep binary features for processing; convert at the edge.
Binary feature collections are useful for compact transfer and rendering pipelines. Convert back to GeoJSON for interoperability, debugging, or consumers that expect the standard object model.
Input
BinaryFeatureCollection
Output
GeoJSON feature array, or one selected feature
Selection
Optionally extract one global feature id
Trade-off
Materializes object-oriented geometry data
Detailed guide
convertBinaryFeatureCollectionToGeojson details
The reference below documents usage and the options that control geometry interpretation and feature selection.
convertBinaryFeatureCollectionToGeojson
Helper function to transform binary GeoJSON generated by convertGeojsonToBinaryFeatureCollection back to
an array of GeoJSON Features, or one Feature when selecting a global feature id.
Usage
import type {Feature} from '@loaders.gl/core/schema';
import {convertGeojsonToBinaryFeatureCollection, convertBinaryFeatureCollectionToGeojson} from '@loaders.gl/core/geoarrow';
const features: Feature[] = [{
type: 'Feature',
geometry: {type: 'Point', coordinates: [1, 2]},
properties: {name: 'Example'}
}];
const binaryFeatures = convertGeojsonToBinaryFeatureCollection(features);
const restoredFeatures = convertBinaryFeatureCollectionToGeojson(binaryFeatures);
Options
| Option | Type | Default | Description |
|---|---|---|---|
| type | 'Point' | 'LineString' | 'Polygon' | (derived from data) | Geometry type |
| globalFeatureId | number | If specified, only returns the feature that matches the given global id. |