## 3 Methods
### Visualization Method Based on Density Partitioning Clustering Algorithm
#### 3.2.1 Construction of Density Partitioning Clustering Algorithm Model  
To enhance the speed of generating maps and the visualization quality for massive trajectory data, mainstream clustering algorithms often adopt DBSCAN [46; 47]. DBSCAN is one of the most classic density-based clustering algorithms. It clusters sample points based on the spatial distribution density of the dataset, making it capable of identifying clusters of arbitrary shapes within noisy data [48; 49], and it exhibits excellent clustering performance. The similarity between traffic trajectory point data is closely related to the occlusion caused by urban roads and buildings. Because the DBSCAN clustering algorithm uses Euclidean distance [50; 51] as the similarity measure, it ignores the influence of other data attributes on the distance measurement results. Hence, it has some errors when reflecting the similarity between data points, leading to decreased clustering quality. This is especially noticeable when clustering urban traffic trajectory data. Furthermore, DBSCAN's clustering results are clusters of arbitrary shapes in space, essentially collections of individual geographic points. Typically, clustering algorithms employ the mean to ascertain the central point of a cluster, yet this deviates from the actual scenario. To address these issues, this paper introduces a density partitioning clustering algorithm based on an improved DBSCAN integrated with K-means [52; 53], incorporating road coefficients to circumvent architectural obstacles. This algorithm improves upon the shortages of the traditional DBSCAN clustering algorithm when calculating the similarity distance between data points. When two data points are not on the same road, it computes the shortest accurate distance bypassing buildings between them. Subsequently, the algorithm employs the K-means clustering method to determine the cluster centroids based on the clustered results. The algorithmic process is expounded as follows:  
1. Initially, road vector data is encoded sequentially, ensuring the code remains consistent for the same road segment. It was subsequently overlaying the taxi trajectory point data onto the road data. The road encoding is attributed to trajectory points data that fall upon the corresponding road vector data. The road encoding matching the trajectory point \(X\) is noted as \(G(X)\), and the road encoding reaching the trajectory point \(Y\) is registered as \(G(Y)\). Equation (4) employs a presence factor \(R\) to distinguish whether two trajectory points, \(X\) and \(Y\), are situated along a path. \[R(X,Y)= \begin{cases}0,&G(X)=G(Y)\\ 1,&G(X)\
eq G(Y)\end{cases} \] (4) \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Row Key**} & \multirow{2}{*}{**TIMESTAMP**} & \multicolumn{4}{c}{**Column Family**} \\ \cline{3-5}  & & **LAT** & **LNG** & **PROERTIES** \\ \hline Min/Hour/Day/TS1 & T1 & [LAT1,LAT2\(\dots\)LATn] & [LNG1,LNG2\(\dots\)LNGn] & \(\dots\) \\ Min/Hour/Day/TS2 & T2 & [LAT1,LAT2\(\dots\)LATn] & [LNG1,LNG2\(\dots\)LNGn] & \(\dots\) \\ Min/Hour/Day/TS3 & \(\dots\) & \(\dots\) & \(\dots\) & \(\dots\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Optimized data storage model. 2. When the road encoding of \(G(X)\) is the same as \(\mathrm{G(Y)}\), the factor \(R\) assumes a value of 0, indicating that the two trajectory points lie on the same road. Conversely, should there be a disparity, factor \(R\) carries a weight of 1, denoting that the two trajectory points do not share the same route. 3. When \(R\) equals 0, the computation of the distance between the two data points employs the Euclidean distance formula. Conversely, when \(R\) equals 1, calculating the distance between the two data points necessitates bypassing the buildings to acquire the actual distance. 4. In the scenario where points \(X\) and \(Y\) do not lie upon the same road, the determination hinges upon whether line segment \(XY\) intersects with obstacles. If there is no intersection, the Euclidean distance is employed.