The `quadbin` library (version 0.4.2) provides essential utility functions for working with the Quadbin spatial index, a hierarchical geospatial indexing system developed by CARTO. Quadbins represent map cells using 64-bit integers, offering a distinct approach compared to variable-length indexing systems like Quadkey. This TypeScript-first library emphasizes performance and type safety, making it suitable for geospatial data processing in Node.js environments (requiring Node.js >=18). It's primarily used in WebGL and visualization contexts for efficient spatial queries and data aggregation. The library's main differentiator is its use of JavaScript's `BigInt` type for quadbin indices, which necessitates explicit conversion functions like `bigIntToHex` and `hexToBigInt` when serializing or deserializing data (e.g., for JSON). While specific release cadences aren't strictly defined, the package receives active maintenance, with recent dependency updates reflecting ongoing support.
npm install quadbinVerified import paths — ran on the pinned version, not inferred.
Demonstrates converting an XYZ tile to a Quadbin BigInt, handling JSON serialization via hex strings, and converting back.
Use `bigIntToHex(quadbin: bigint): string` to convert BigInts to hexadecimal strings before JSON serialization, and `hexToBigInt(hex: string): bigint` to convert them back for library use.
Ensure your Node.js environment is updated to version 18 or higher. Use `node -v` to check your current version.
Before `JSON.stringify()`, convert BigInt indices to hexadecimal strings using `bigIntToHex(quadbinBigInt)`. When deserializing, use `hexToBigInt(hexString)`.
This is an ESM-first library. Use named imports: `import { tileToCell } from 'quadbin';`. If using CommonJS, ensure your build setup transpiles correctly or consider `const { tileToCell } = require('quadbin');` as a last resort, though full ESM is recommended.No dependency data recorded yet.