QUADBIN is built on the slippy-map (web-mercator) tile scheme, so a cell maps directly to a tile coordinate triple (x, y, z) and to the base-4 quadkey string used by tile servers. These conversions are the QUADBIN-specific bridge to the tiling ecosystem.
Build a cell from slippy-map tile coordinates: column x, row y, and zoom z
quadbinTileToCell(integer,integer,integer) → quadbin
SELECT quadbinTileToCell(0, 0, 0) = quadbin '480fffffffffffff'; -- true SELECT quadbinTileToCell(3, 5, 4) = quadbin '48427fffffffffff'; -- true SELECT quadbinTileToCell(524, 343, 10) = quadbin '48a6227affffffff'; -- true
Decompose a cell back into its tile coordinate triple, returned as an integer array {x, y, z} — the inverse of quadbinTileToCell
quadbinCellToTile(quadbin) → integer[]
SELECT quadbinCellToTile(quadbin '480fffffffffffff');
-- {0,0,0}
SELECT quadbinCellToTile(quadbin '48a6227affffffff');
-- {524,343,10}
Emit the base-4 slippy-tile quadkey string of a cell (one digit per zoom level, MSB-first; the resolution-0 world cell maps to the empty string). The static form takes a single quadbin; the temporal form returns the quadkey of each cell in a trajectory as a ttext.
quadbinCellToQuadkey(quadbin) → text
tquadbinCellToQuadkey(tquadbin) → ttext
SELECT quadbinCellToQuadkey(quadbin '480fffffffffffff'); -- (empty string) SELECT quadbinCellToQuadkey(quadbin '48427fffffffffff'); -- 0213 SELECT quadbinCellToQuadkey(quadbin '48a6227affffffff'); -- 1202021322