## 2 Proposed Method
### Straight-Line Segment Extraction  
The main basis for identifying intersections in this paper is the fact that straight-line trajectory intersection points mostly occur in the road intersection. In order to better calculate straight-line trajectory intersection points, the straight-line segments of trajectories need to be extracted from the continuous trajectory segments. The most straightforward way to separate straight-line segments from continuous trajectories is to divide them according to the steering angle of each sample point and when the steering angle is greater than a preset threshold, the original continuous trajectory is separated by this sample point and the first half of the separated trajectory forms a straight-line segment; however, it is difficult to use this method of separation based on steering angle threshold to determine a suitable global threshold value and the separation result is very sensitive to this steering angle threshold. When the threshold is too large, trajectories with gradual steering cannot be separated effectively and trajectories with gradual steering behavior are treated as straight-line segments. On the other hand, when the threshold is too small, the separated straight-line trajectory segments are too fragmentary and some trajectories with lane-changing behavior are separated into several straight-line segments, thus losing the original trajectory characteristics. As shown in Figure 3, the lines represent the straight-line segments separated by different steering angle thresholds and the dots are the starting points of the straight-line segments. To address the difficulty of using the steering angle method to determine a reasonable threshold, this paper proposes a method based on the maximum reconstruction error to extract straight-line segments from the trajectory. The proposed method assumes that the behavior pattern of the trajectory can be approximated by a spline curve. If a trajectory is fitted well by a spline curve, then the spline and the trajectory have the same pattern; therefore, if a trajectory could be fitted well to a straight-line segment, then this trajectory can be regarded as straight. The original continuous trajectory is reconstructed as a straight line and the reconstruction errors for whole sampling points are calculated. When the maximum reconstruction error is low enough, the trajectory could be regarded as straight-line. Let the continuous trajectory with \(m\) sampling points be \(TS=\{tp_{1},tp_{2},\ldots,tp_{m}\}\) and perform a linear segment reconstruction for \(TS\) at the first and last sampling point. Figure 3: (**a**) Straight segment (steering angle threshold \(>\) 20); (**b**) Straight segment (steering angle threshold \(>\) 8). \(L\) is used to store the index results of the start and end points of each straight-line segment after separation and \(S\) is the sub-trajectory of the continuous trajectory \(TS\). When calculating the maximum reconstruction error \(\varepsilon_{\text{imax}}\) for a sub-trajectory \(S\), the index of the maximum reconstruction error in \(S\), denoted as \(i\)max, is also obtained. \(t\) is the separation threshold; when the maximum reconstruction error is greater than this threshold, the trajectory is separated by the location of the maximum reconstruction error. The separation threshold \(t\) indicates the distance between two locations expressed by latitude and longitude in the mid-latitude (30 to 60 Degrees) range, with the default value \(t=8\times 10^{-5}\) indicating approximately 10 m. Algorithm 2 is the process of separating straight-line segment. ```
Input: Trajectory sequence \([p_{1},p_{2},\ldots,p_{n}]\), threshold \(\varepsilon_{\text{thre}}\) Output: Line segment index Segldxs = \([(i_{start1},i_{end1}),\ldots]\)
1. Initialize Segldxs = [] and \(i=1\). 2. While True:
3. For \(j=i+2\) to \(n\):
4. \(\varepsilon_{\text{max}}\), \(i_{\text{split}}\) = Algorithm_1 (\([p_{i},p_{i+1},\ldots,p_{j}]\))
5. If \(\varepsilon_{\text{max}}>\varepsilon_{\text{thre}}\):
6.