Select to view content in your preferred language

Measure Railroad Track Curvature with arcpy

777
0
08-15-2024 11:42 AM
JimBarry
Esri Regular Contributor
3 0 777

The degree that railroad track curves along its length, is one of the most significant factors which constrain the maximum speed that trains are allowed to travel along the railway network. There are several times when it's important to measure this curvature:

1. When the track construction is originally designed.
2. After the track construction is built. (ie., the "as-built" curvature measurement)
3. Periodically as the track is in service, as required by policy or regulation.


THE GEOMETRY CAR

As for #3 above, this periodic measurement is performed by a "Geometry Car", that is scheduled to ride along the track. Every part of the track network gets this on-site measurement at least twice a year, or more often if needed. The Geometry Car has many sensors in it that measure the actual curvature of the track, but also its "cant" (ie., the way the track is designed to help trains "lean into" a turn). The Geometry Car also contains other sensors such as imagery, lidar, ultrasonic, and so on, in order to capture at high resolution the current state of the track, rails, ties, ballast, poles, overhead lines, and more.


BACK TO CURVATURE

ArcGIS can be used to compare current measurements, that come from the Geometry Car, with measurements from previous inspections, from the original as-builts, and from the original construction plans themselves.  This kind of change detection can be used to help create prioritized maintenance lists, or be fed back into the Positive Train Control (PTC) system to reduce the maximum allowed speed along that section of track.

There isn't a built-in tool in ArcGIS Pro to do this, but it is fairly straightforward to write a script that can make this measurements for you. Here is an example.

 

visualize track curvaturevisualize track curvature


THE SCRIPT

Here is a link to the script on Github that created that curvature feature class.


HOW IT WORKS

Conceptually, what the script does is that for each section of track, say, a route polyline, it "walks" along the polyline, placing a point every 50', writing that point into a new output point feature class. Then for every 3 points, an angle is measured, and then written into the middle point's attribute record. It doesn't walk vertex by vertex, it actually creates new points along the line so that each one is 50' from the previous point.

measuring curve anglesmeasuring curve angles


Each point now "knows" the angle of curve along that 100' section (50' before it, and 50' feet after it). That curvature attribute value can then be compared to previous route layers, or can simply be visualized like we're doing above, where areas of low curvature are drawn yellow, higher curves are drawn orange, and the highest curves are drawn red. This is just one way to do it.


THINGS TO KEEP IN MIND

1. The polyline feature class you run this script on needs to support measures. In other words, the polyline features need to be PolylineM or PolylineZM route features, that have already been calibrated so that every vertex knows its M value. Usually this M value is the milepost or kilometer post value along the railway network, but that's up to you.

2. You do not need to build an LRS (linear referencing system) for this script to work. The measure values along the polyline route features are good enough to work for this purpose.

3. The definition of what constitutes a "curve", I took from the US DOT FRA, which is the angular change of a track's direction over each 100' length. Some railroads measure curvature differently, so the script is flexible. In the first cell is a global variable called CURVE_LENGTH_INTERVAL_FEET, where you can set this value to 100', or 200', or convert it to metric. Whatever you need.

4. There is also a global up there called CURVE_TOLERANCE_PERCENT, which is there to basically say, that if a 100' length of track measures a curvature of below 0.5%, then consider that section to be "STRAIGHT". You can adjust that tolerance right there as you see fit.

 

IN CONCLUSION

I tried to add code comments to the script as well as I could, but I might've left some gaps. So if you have any questions or comments, feel free to let me know below, or log a New Issue on my Github's "arcpy-samples" repository.

 

About the Author
https://x.com/jimbarry