Skip to main content

geo_cell_level

Function geo_cell_level 

Source
pub fn geo_cell_level(cell_id: u64) -> Option<u8>
Expand description

S2 level of a u64 cell id: the trailing 1-bit sentinel sits at bit 60 − 2·level. Returns None for a malformed id (sentinel at an odd bit position, above bit 60, or a face value ≥ 6 — S2 defines six faces, so bits 63–61 holding 6 or 7 is not a cell).