A5Grid
Purpose
A5Grid wraps the A5 discrete global grid system and exposes it through the shared GlobalGrid contract. It bridges the a5-js utilities used by deck.gl into a uniform API so the GlobalGridLayer can fetch cell centers and polygon boundaries for A5 indices.
Usage
import {GlobalGridLayer, A5Grid} from '@deck.gl/geo-layers';
const layer = new GlobalGridLayer({
id: 'a5-grid',
data: dataset,
globalGrid: A5Grid,
getCellId: d => d.a5Token,
extruded: true
});
Use A5Grid.lngLatToCell(lngLat, resolution) when you need to derive cell identifiers from coordinates. The helper accepts either a hexadecimal string or a bigint identifier, automatically performing conversions through tokenToCell/cellToToken.
Shared conventions
hasNumericRepresentationistrue; bigint identifiers are supported alongside hexadecimal tokens.tokenToCellandcellToTokenconvert between hexadecimal string tokens and bigint IDs.cellToLngLatandcellToBoundaryboth accept either representation and dispatch througha5-jsto return longitude/latitude values.