## Materials and Methods
### Omnidirectional Search  
Railway reconstruction can be regarded as a nonlinear optimization problem with constraints, after the objective function is established and the constraints are determined. According to railway design specifications, the railway stake point is certain to be at the central line of the railway. With consideration of the point cloud data's characteristic of having a large density and small interval, the stake point must be near the point cloud data of the railway central line. Therefore, the centerline point cloud data can be seen as the regarded as the solution space of the stake point. The coordinates of the main stake point can be found by searching the center point cloud data. This study focused on the coordinates of the main stake points. For a calculation of the curve parameters, please refer to the literature [7]. Here, it must be noted that the calculating methods described in the literature are all based on the curve-independent coordinate system. However, the point cloud data involved in this paper is in the geodetic coordinate system. Therefore, it needs to undergo coordinate system conversion according to Equation (8). \[\left\{ \begin{array}{c}\left[\begin{array}{c}x\\ y\end{array}\right]=\mathbf{R}\left[\begin{array}{c}x^{\prime}\\ y^{\prime}\end{array}\right]+\mathbf{T}\\ \mathbf{R}=\left[\begin{array}{cc}\cos\alpha&-\sin\alpha\\ \sin\alpha&\cos\alpha\end{array}\right]\\ \mathbf{T}=(t_{x},t_{y})\end{array} \right. \tag{8}\]  
where \(\mathbf{R}\) is the rotation matrix, \(\alpha\) is the rotation angle between the independent coordinate system and the point cloud data coordinate system, \(\mathbf{T}\) is the translation vector, and \(t_{x},t_{y}\) are the translation components of the translation vector in horizontal and vertical directions, respectively. The classical solution methods for optimization problems are analytical methods and numerical methods. The analytical method requires the derivative of the objective function. However, the distance from the point to the transition curve has no simple close form, which makes the objective function difficult to derive. The numerical method is used to search for optimal solutions with iterative methods. However, the result is directly related to the initial value and the learning rate, and often falls into the local optimal solution. In order to improve the above problems, this paper proposes an omnidirectional search particle swarm optimization algorithm to calculate the reconstruction parameters based on the clustering idea in intelligent algorithms [29; 30; 31]. There are \(n\) point cloud data in the experiment, i.e., the number of particle swarms is \(n\) particles. The location of particle \(i\) is a vector solution \(\mathbf{X}_{i}\) in the particle searching space. Every particle can find the learning rate and searching direction according to local and global information. The standard particle swarm algorithm is as follows:  
\[\mathbf{V}_{i}(t+1)=\varpi\mathbf{V}_{i}(t)+c_{1}r_{1}(\mathbf{P}_{i}(t)- \mathbf{X}_{i}(t))+c_{2}r_{2}(\mathbf{P}_{g}(t)-\mathbf{X}_{i}(t)) \tag{9}\]  
\[\mathbf{X}_{i}(t+1)=\mathbf{X}_{i}(t)+\mathbf{V}_{i}(t+1) \tag{10}\]  
Based on Equations (9) and (10), \(\mathbf{X}_{i}(t)=(x_{i1},x_{i2},\cdots,x_{iT})\) is the current location of the particle \(i\). \(\mathbf{V}_{i}(t)=(v_{i1},v_{i2},\cdots,v_{iT})\) is the current speed of particle \(i\). \(\mathbf{P}_{i}(t)=(p_{i1},p_{i2},\cdots,p_{iT})\) is the optimal location of particle \(i\), and \(\mathbf{P}_{g}=(p_{g1},p_{g2},\cdots,p_{gn})\) is the optimal location that all particles experience. In addition, \(\varpi\) is the inertial weight coefficient, \(r_{1},r_{2}\in[0,1]\) is the random number, and \(c_{1},c_{2}\) are learning factors. The iterative direction of particle \(i\) is decided by tracing \(\mathbf{P}_{i}\), and then the iteration can run. The iterative direction is a linear combination of the individual optimal position and the global optimal position from Equations (9) and (10).