Validating track geometry

When creating a route the track geometry is read from the global tsection.dat file and incorporated into the track database. Currently when routes are run the geometry is read from the global tsection.dat file. But this is not necessary as this geometry is in the track database. When the global tsection.dat file does not have this geometry then Open Rails has an error, see https://bugs.launchpad.net/or/+bug/1397695

As an example of calculating the geometry from the track database the following track vector will be used.

183 218 -12781 14686 186 0 1 00 -12781 14686 457.969 324.245 10.8839 0.00431981 3.49037 -2.36043e-007
175 218 -12781 14686 186 0 1 00 -12781 14686 457.453 324.238 9.46428 0.00431981 3.49037 -2.36043e-007
32115 29061 -12781 14686 195 0 1 00 -12781 14686 450.058 324.115 -18.1616 0.00431964 3.31584 3.6129e-007
176 218 -12781 14686 192 1 0 00 -12781 14686 445.081 323.99 -46.4338 0.0043197 3.31584 -1.54252e-007
183 218 -12781 14686 192 1 0 00 -12781 14686 437.687 323.867 -74.0594 0.0042541 3.49037 0.000749961

P1 and P2 are the points for track section 183 218 and LC is the chord distance between these points.

P1 457.969 324.245 10.8839
P2 457.453 324.238 9.46428
LC 1.511

A1 and A2 are the angles for the points above. DA is the difference in angles showing this is a straight section.

A1 3.49037
A2 3.49037
DA 0

Below is the definition for this section showing a match between length of 1.511 and length of 1.51059.

TrackSection ( 183
SectionSize ( 1.5 1.51059 )
)

P1 and P2 are the points for track section 175 218 and LC is the chord distance between these points.

P1 457.453 324.238 9.46428
P2 450.058 324.115 -18.1616
LC 28.599

A1 and A2 are the angles for the points above. DA is the differnce in angles showing this is a 10 degree curve.

A1 3.49037
A2 3.31584
DA 0.17453 (10 deg)

Using formulaes from http://www.ctre.iastate.edu/educweb/ce353/lec05/lecture.htm to calculate radius of curve given angle and chord distance.

LC = 2 R sin (DA/2)
R=LC/(2 sin (DA/2)

R = 164.068

Below is the definition for this section showing a match between radius of 164.068 and radius of 164.0639.

TrackSection ( 175
SectionSize ( 1.5 0 )
SectionCurve ( 164.0639 -10 )
)

Calculating the geometry of the track from the track database can be used to validate a match between the track database and the global tsection.dat file. It could also be used to enable Open Rails to run when the definition of the track section is missing.

TrackShape ( 218
FileName ( A1tPnt10dLftMnl.s )
NumPaths ( 2 )
MainRoute ( 1 )
ClearanceDist ( 26 )
SectionIdx ( 2 0 0 0 0 183 175 )
SectionIdx ( 1 0 0 0 0 179 )
ManualJunctionShape ( )
)

Portions of the global tsection.dat file not encoded in the track database are tunnel, water scoop, and clearance distance for switches.

Leave a Reply