binaryToGeojson
Helper function to transform binary GeoJSON generated by geojsonToBinary back to
a valid GeoJSON Geometry, Feature or array of Features.
Usage
import {load} from '@loaders.gl/core';
import {JSONLoader} from '@loaders.gl/json';
import {geojsonToBinary, binaryToGeojson} from '@loaders.gl/gis';
const geoJSONfeatures = await load('data.geojson', JSONLoader);
const binaryFeatures = geojsonToBinary(geoJSONfeatures);
const geoJSONfeatures2 = binaryToGeoJson(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. |