## 3 The Hierarchical Multi-Dimensional Aggregate Pyramid (MAP) Model
### Definition of the 2D Tile Pyramid Model  
As shown in Figure 3, the tile map pyramid model is widely used for 2D map display [10; 33; 34]. This is a typical LoD example, supported by hierarchical spatial aggregation, in which the resolution becomes increasingly coarser from the bottom to the top. Each layer of the pyramid contains a collection of square tiles, while each tile is composed of pixels (usually \(256\times 256\)).  
Figure 1: Cube aggregation operations of the \(S\times T\times A\) cube.  
Figure 3: Illustration of the 2D Tile model.  
Figure 2: Three types of face aggregation operations on the \(S\times T\times A\) cube.  
**Concepts:**  
(1) Pixel  
The _Pixel_, which is the smallest building block of the 2D pyramid, can be represented by Equation (1); here, \(l\) refers to the level of the pyramid; \(x\), \(y\) represents the spatial coordinates of this pixel; and \(p\) represents the attribute value of the pixel (or an aggregated statistical value, i.e., average/sum/min/max).  
\[\textit{Pixel}=\{l,x,y,p\} \tag{1}\]  
(2) Tile  
A _Tile_ is a group of spatially adjacent pixels, usually a \(256\times 256\) square grid. The tile can be represented by Equation (2); here, \(l\) is the level of the pyramid, \(X\), \(Y\) denote the tile's column/row number in this level, and the last union represents the set of pixels within this \(n^{*}n\) tile.  
\[\textit{Tile}=\left\{l,\ X,\ Y,\underset{i=1}{\overset{n=n}{\cup}}\textit{ Pixel}\right\} \tag{2}\]  
(3) Pyramid  
A collection of \(M^{*}N\) tiles are grouped into one layer, after which all \(L\) layers are stacked to form a multi-scale spatial _Pyramid_, as shown in Equation (3).  
\[\textit{Pyramid}=\underset{i=1}{\overset{L}{\cup}}\left\{\sum_{j=1}^{M} \sum_{k=1}^{N}\left\{l_{i},X_{j},Y_{k}\right\}\right\} \tag{3}\]  
**Operations:**  
(1) Extract  
The _Extract_ operation converts one or more raw data records into a pixel in the bottom level, as shown in Equation (4); here, \(l_{n}\) refers to the bottom level of the pyramid; _lon_, _lat_ represents the geographical position of the original records; and \(w\) is the pixel resolution of the output tile.  
\[\begin{split} Extract(l_{n},[\textit{lon},\ \textit{lat}],\ w, \textit{record})=\textit{Pixel}([l_{n},x,\ y])\\ \left\{\begin{array}{l}r=\log_{2}w\\ y=\left(1-\frac{\ln\left(\tan(lat\cdot\frac{n}{180})+\frac{1}{\cos(lat\cdot \frac{1}{180})}\right)}{\pi}\right)\end{array}\right..2^{l_{n}+r}\end{array} \right.,\end{split} \tag{4}\]  
(2) Group  
The _Group_ operation establishes the direct relationship between the pixels and the target tile. As shown by Equation (5), it groups the related pixels to enable the tile to be derived.  
\[\begin{split} Group(\textit{Pixel}([l_{n},x,\ y]))=\textit{Tile}([l_{n },\ X,\ Y,\underset{i=1}{\overset{n=n}{\cup}}\textit{Pixel})\\ \left\{\begin{array}{l}X=(x/w)\\ Y=(y/w)\end{array}\right.\end{split} \tag{5}\](3) Aggregate  
The above-mentioned _Extract_ and _Group_ operations are combined to produce tiles at the bottom level of the pyramid. Unlike these two operations, which function at the bottom level, the _Aggregate_ operation is conducted level-by-level from the bottom to the top to calculate all the tiles remaining in the whole pyramid. The _Aggregate_ operation is as shown in Equation (6).  
\[\begin{array}{l}Aggregate(Tile(l_{n},X_{2i},Y_{2i}),\;Tile(l_{n},X_{2i},Y_{2i+ 1}),\;Tile(l_{n},X_{2i+1},Y_{2i}),\;Tile(l_{n},X_{2i+1},Y_{2i+1}))\\ =Tile(l_{n-1},X_{i},Y_{i})\end{array} \tag{6}\]  
(4) Key-value Pair (KVP)  
For each tile in the pyramid, a key can be generated by using a space-fill curve (e.g., Z-curve), such that the set of pixels of the tile are packaged as a value, as shown in Equation (7). The key-value conversion is conducted for later persistent storage.  
\[KVP(Tile(l_{n},\;X,\;Y))=Tuple(sfc\_key,value) \tag{7}\]