Quadtree leaf bounds Dense grid at matching depth Point (click canvas to add)

Spatial Compression: Quadtree vs Dense Grid Memory

This 2D companion to the octree spatial-partitioning simulator asks a different question about the same tree structure: not how many nodes a query visits, but how many bytes the structure itself costs to store. It builds a real PR quadtree over your point set, computes its exact memory footprint from fixed per-node and per-point byte costs, and compares that against a naive dense grid sized to the same finest resolution the tree actually reached. For uniformly scattered points the two stay close — but drag the clustering slider up and the dense grid, forced to apply its finest resolution across the whole domain, balloons while the adaptive tree's footprint barely grows, making the actual memory-compression benefit of spatial trees visible as a number instead of an analogy.