## 3 The Hierarchical Multi-Dimensional Aggregate Pyramid (MAP) Model
### Multi-Dimensional Aggregated Pyramid Model  
As illustrated in Figure 4, the \(S\times T\times A\) cube and the 2D tile pyramid are combined to define the multi-dimensional aggregation pyramid (MAP) model; this enables the hierarchical aggregation to be achieved not only on the spatial dimension but also on the temporal and attribute dimensions. Similarly, the four basic operations involved in constructing the proposed multi-dimensional aggregate pyramid are as follows:  
(1) Flattened Attribute Aggregation Tree (_faa_tree_)  
The aggregation of the different attributes of the spatio-temporal objects will result in a tree-shaped structure, _faa_tree_, after which the derived tree structure can be flattened using a breadth-first traversal to simplify later access and also preserve level locality. As illustrated by Figure 5, there are four taxi records in the sample table, each of which has three attributes, namely, guest, car color and driver gender. Figure 4: Multidimensional aggregation pyramid model. The _fa_tree_ of these four records, as shown on the right side, are derived through hierarchical aggregation; subsequently, the _fa_tree_ is flattened to a fixed-length one-dimensional (1D) array (as expressed by Equation (8)), in which the total count is arranged in the first position. Compared to the original tree structure, the fixed-length 1D array structure is much more convenient for subsequent storage and processing. \[fa\_tree=\{a_{all},\ a_{1},\ a_{2},\ \ldots,\ a_{n}\} \tag{8}\]  
(2) Spatio-temporal Pixel (_st-pixel_)  
We define the smallest \(S\times T\times A\) cube as the Spatio-temporal Pixel (_st-pixel_), as shown in Figure 6. Due to the existence of _fa_tree_, the _st-pixel_ is actually a 4D unit structure; it can be located by both the spatial coordinates (_longitude x_, _latitude y_) and temporal position \(t\) and is also labeled with a cell from the _fa_tree_ array. As shown in Equation (9), \(t\) represents the transformed coordinates in the predefined temporal granularity, and \(a_{j}\) is one cell in the _fa_tree_, while \(l\), \(x\), \(y\) are the same as in the 2D pixel. \[st-pixel=\big{\{}[l,x,\ y,\ t],\ a_{j}\big{\}}(a_{j}\in faa\_tree) \tag{9}\]  
(3) Spatio-Temporal Tile (_st-tile_)  
The \(S\times T\times A\) cubes in the lower level can be aggregated level by level to the cube in the higher level. Since the _st-pixel_ is now a 4D unit structure, it is inconvenient for 2D map display in the client. A similar 2D concept, Spatio-Temporal Tile (_st-tile_), is defined in Figure 7. As a 2D tile with _pixels_, _st-tile_ contains a collection of _st-pixels_ that have the same time tag and attribute value. The tile size is still \(256\times 256\). Here in Equation (10), \(l\) also refers to the level in the pyramid; \(X\) and \(Y\) refer to the row and column of the tile; \(t_{k}\) represents one position in the discretized temporal intervals, and \(a_{j}\) is still one cell in the _fa_tree_. Figure 5: Illustration of the flattened attribute aggregation tree (_fa_tree_) structure. Figure 6: The illustration of the spatio-temporal pixel. \[st-tile=\big{\{}[l,\ X,\ Y],t_{k},a_{j}\big{\}}(t_{k}\in T,a_{j}\in fa\_tree) \tag{10}\]  
In a similar way to the above, there are four basic operations involved in constructing the proposed multi-dimensional aggregate pyramid, which are listed as follows:Extract  
Both the geographic location information and temporal information are transformed to the \(st\)-_tile_'s coordinates. As shown in Equation (11), all attribute information is used to generate and serialize the \(st\)-_tile_'s _fa_tree_. \[ \begin{array}{l}Extract(l,[Lon,\ Lat],\ w)\\ =st-pixel([l,x,\ y],\ t,\ fa\_tree)\end{array}