## 2 Proposed Method
### Intersection Points Calculation
#### 2.3.1 Straight-Line Segment Merging  
After all continuous trajectories have been separated, there is a large number of similar patterns in the line segments, leading to a large redundancy in calculating the intersection point of line segments. By combining these straight-line segments, not only can the number of straight-line segments to be calculated be effectively reduced, but the combined straight-line segments can better reflect the structure of the road network; therefore, before calculating the intersection point of straight-line segments, we first merge the separated straight-line segments. The basis for the merging of each straight-line segment is the overlapping straight-line segments that have the same direction and are on the same line; therefore, the specific steps for the merging of straight-line segments consist of three parts: classifying the straight-line segment to the same direction, clustering the co-linear straight-line segment and merging overlapped segments in the same straight line. 1. Classify straight-line segment in the same direction  
In this paper, a hard separation is used to divide the two-dimensional plane into 360-directional clusters and each straight-line segment trajectory is divided into a certain directional cluster. The specific process is to use the unit vector of the vector formed by the position of the start and end points of each straight-line trajectory segment as the direction vector of that straight-line segment trajectory. The cluster unit vector corresponding to each angle in the 360 degrees from 0 to 359 degrees is calculated as the unit direction of each directional cluster. The cluster unit vector is defined as \(p_{\text{deg}}\in\mathbb{R}^{2},\text{deg}=0,1,2,\ldots,359\). To classify the directional clusters of a linear segment trajectory, the inner product of the unit direction vector of the linear segment trajectory to the unit vector of each directional cluster is calculated and then the linear segment trajectory is divided into the directions corresponding to the maximum of the inner product. Let the unit direction of a straight-line segment trajectory be \(p_{l}\); the cluster of directions corresponding to deg that maximize \(p_{l}^{T}p_{\text{deg}}\) is then the cluster of directions in which this straight-line segment trajectory lies. 2. Clustering of the co-linear straight-line segment  
Figure 6: Straight-line segment extraction using the maximum reconstruction error method. For each directional cluster, the line segments are further divided into co-lines clusters according to distance. A co-line cluster is based on the co-normal distance relationship of the line segments within the same directional cluster and the line segments with a small distance are combined into the same line clusters. In order to automatically determine the amount of co-linear clusters and to avoid truncation caused by hard separation, we used density clustering DBSCAN [23] for co-linear clusters. We set the clustering parameter EPS to \(1.5\times 10^{-4}\) and parameter MinPts to 1. The clustering results can well represent the proximity of straight-line segments within a certain co-linear cluster. Merging overlapped segments in the same straight-line  
After Step 2, straight-line segments within the same co-linear cluster are on the same line. These straight-line segments can be merged according to whether there is an overlapped relationship between the intervals of each straight-line segment. To simplify determining the overlap of straight-line segments, all the straight-line segments in a directional cluster are first rotated toward the horizontal direction. Let \(a\) be the angle from the positive \(x\)-axis to the line segment's unit direction vector; the unit direction vector can then be written as [cos\(a\), sin\(a\)]. The rotation transformation matrix is  
\[Q= \begin{pmatrix}\cos a&\sin a\\ -\sin a&\cos a\end{pmatrix}