Periodic recreation of existing railway horizontal alignment geometry is needed for smoothing the deviations arising from train operations. It is important for calibrating track and rebuilding existing railways to ensure safety and comfort. Track calibration repairs the existing distorted track centerline to match the smoothed recreated alignment, which may differ considerably from the originally designed track centerline. Identifying the boundaries of all the geometric elements including tangents, circular curves, and transition curves is the key problem. Existing methods recreate the horizontal alignment semi‐automatically and can only generate a locally optimized solution while considering a few constraints. Based on the principle that the attributions of all the measured points to geometric elements should be consistent with the ranges of recreated geometric elements (i.e., for points‐alignment consistency), a method called swing iterations is proposed to reclassify point placements and identify all the tangents, circular curves, and transition curves simultaneously. In a swing iteration, the boundary of a geometric element segment repeatedly changes from left to right, then from the right to left, and finally stabilizes. Before the swing iterations, preliminary tangents and curves are identified based on the heading gradient (i.e., the rate of change of heading), and are set as initial values for the swing iterations. A genetic algorithm is developed to further refine the entire recreated alignment after the swing iterations. In the above processes, multiple constraints are handled. Applications demonstrate that this method can identify all horizontal geometric elements automatically and generate an optimized recreated alignment geometry for an existing railway while satisfying all the applicable constraints.