# Interactive Visualization of Geographic Vector Big Data Based on Viewport Generalization Model
## 3 Materials and Methods
### VPQTree-Based Preview Algorithm of BGVD  
In the VGVM of geographic vector data, the issue of geographic vector data visualization is transformed into the query of matching vector features in the spatial range corresponding to screen pixels. The judgment criterion for calculating pixel display values is as follows: if the number of vector features within the spatial range corresponding to the pixel is greater than the set threshold, the pixel value will be generated; otherwise, no pixel value will be generated. In the VPQ index constructed from geographic vector data, the index nodes that hit the vector features in the spatial range are created and the spatial range of the index nodes in the VPQ index is mapped to the spatial range corresponding to the pixel. Therefore, with the support of the VPQ index, the issue of geographic vector data visualization can be transformed to query whether the index node corresponding to the pixel to be calculated exists in the VPQ index. In this section, we propose a VPQTree-based preview algorithm of BGVD (VPQP) to generate the pixel display value in the viewport for the final preview display effect. The main process is as follows: in the process, \"partial matching\" means that the encoding of the child node of query node \(S\) is consistent with the corresponding prefix digit of the encoding of the pixel, and \"equal matching\" means that the encoding of the child node of query node \(S\) is completely consistent with the encoding of the pixel. 1. Calculate the corresponding spatial range of the pixel according to the pixel number. 2. Encode the spatial range of the pixel, and set the number of encoding times to 8 at the tile level to which the pixel belongs, so as to obtain the Geohash encoding of the pixel. 3. Start the query from the root node of VPQ index, and take the root node as the current query node \(S\). 4. Match the Geohash encoding of the pixel with the encoding of the child node of query node \(S\). 5. If the two encodings exhibit \"partial matching\", the last two digits of the matching result are used: if they are\"00\", the pointer is positioned to the lower left child node; if they are \"10\", the pointer is positioned to the lower right child node; if they are \"01\", the pointer is positioned to the upper left child node; and if they are \"11\", the pointer is positioned to the upper right child node. Otherwise, the pixel value does not need to be generated and the process ends. 6. Take the newly positioned index node as the new current query node \(S\) and skip to Step 4 to continue the execution. 7. The pixel value is generated until the encoding of the child node of query node \(S\) and the encoding of the pixel exhibit \"equal matching\". The VPQP algorithm of geographic vector data is shown as Algorithm 2. In the algorithm, \(\leftarrow\) is the assignment operation; \(RT\) is the stack, which is a data structure that follows the \"first in, first out\" rule; \(Range(. )\) is the function of obtaining the spatial range of the pixel; \(Geohash(. )\) is the function of obtaining the binary Geohash encoding of a spatial range; \(Match(. )\) is the function that obtains the same substring of both encodings; and \(S.Cnodes[lu/ru/lb/rb]\) represent the four children of node \(S\), respectively. ```
input :VPQ index \(VPQTree\), pixel \(P\), tile level \(z\), threshold of vector features \(\delta\). output :True: the value of pixel \(P\) is generated; False: the value of pixel \(P\) is not generated.