From 8799e784dba350e6b0521ea34c0f369f03963dd2 Mon Sep 17 00:00:00 2001 From: Drabble Date: Thu, 12 May 2022 15:15:44 +0200 Subject: [PATCH] Update the documentation on `QuadKey` --- maplibre/src/coords.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maplibre/src/coords.rs b/maplibre/src/coords.rs index 36a6132ba..acd76c426 100644 --- a/maplibre/src/coords.rs +++ b/maplibre/src/coords.rs @@ -31,10 +31,11 @@ const fn create_zoom_bounds() -> [u32; DIM] { result } -/// Represents the position of a node within a quad tree. It stores the number of one of the four -/// squares for each subdivision of the quad tree from zoom level 0. +/// Represents the position of a node within a quad tree. The first u8 defines the `ZoomLevel` of the node. +/// The remaining bytes define which part (north west, south west, south east, north east) of each +/// subdivision of the quadtree is concerned. /// -/// TODO: Would it be useful to optimize the quadkey and store the keys on 3 bits instead of 8? +/// TODO: We can optimize the quadkey and store the keys on 2 bits instead of 8 #[derive(Ord, PartialOrd, Eq, PartialEq, Clone, Copy)] pub struct Quadkey([u8; MAX_ZOOM]);