pub fn cell_hilbert(cx: u32, cy: u32, bits: u8) -> u64Expand description
Hilbert index of an (x, y) cell on a 2^bits x 2^bits grid – the classic level-parameterized xy2d walk (public domain; PostGIS uses the same curve family via a 32-bit bit-scan for its sorted R-tree builds, which inspired this keyspace). The bit-scan variant is fixed to 32-bit grids; our cells live at 8- and 16-bit levels, and a cell’s index must be computed AT ITS LEVEL or aligned squares stop being contiguous runs – the oracle test below caught exactly that with a scaled-shift shortcut. O(bits) per call, index-time only.