Blaine wrote:
>> I've already run a half-dozen tests on my own local roads, but I want to
>> see how well the Linux/macOS/Win script works in roads elsewhere in the US.
>>
> Moki Dugway
> Shafer Canyon
> Burr Trail
> Guardsman Pass
Perfect! Thank you for providing a random test sample, which helps
us improve the program as it's tested on control conditions now.
With more eyes on the program & results, we can improve it together!
Analyses below is manual, but everything else was done automatically.
Burr Trail
<https://i.postimg.cc/X7f6VWKC/burrtrail.jpg>
<https://i.postimg.cc/CxJyq4Q0/burrtrail.png>
Guardsman Pass
<https://i.postimg.cc/JnDSSC4x/guardsmanpass.jpg>
<https://i.postimg.cc/G3DZQR55/guardsmanpass.png>
Moki Dugway
<https://i.postimg.cc/DydH9gFb/mokidugway.jpg>
<https://i.postimg.cc/3x8VYvxN/mokidugway.png>
Shafer Canyon
<https://i.postimg.cc/HLjN71MB/shafercanyon.jpg>
<https://i.postimg.cc/9M7NJPJ1/shafercanyon.png>
Analysis of predicted abnormal front tire wear on Utah roads
Moki Dugway, Shafer Canyon, Burr Trail & Guardsman Pass
The objective was to predict abnormal outside-front tire shoulder wear
resulting from downhill braking & steering-induced tire scrub on turns.
Two websites were used to obtain the GPX tracks:
<https://gpx.studio/>
<https://overpass-turbo.eu/>
The Python script will analyze the GPX tracks, calculating corner radii,
left/right turning distributions & the 5 tightest calculated hairpins.
I selected one downhill direction for each road wherever possible:
Moki Dugway: North to South, descending Cedar Mesa.
Shafer Canyon: Island in the Sky down to Potash Road.
Burr Trail: Boulder toward Bullfrog.
Guardsman Pass: From the pass toward Park City.
Summary of GPX Analysis
1. Moki Dugway
GPX points: 220
Sharp/moderate curve windows: 154
Left turns: 76
Right turns: 78
Minimum calculated radius: 5.89 meters
Assessment:
Sustained downhill cornering with balanced tire loading.
Moki Dugway has a substantial number of tight switchbacks
over a relatively short descent.
The left/right distribution is almost perfectly balanced
(49.4% left / 50.6% right).
Consequently, the expected lateral loading is reasonably
balanced between the two front tires, with a very slight
theoretical bias toward the left front tire.
The 5.89-meter minimum calculated radius indicates a
potentially tight corner, although the actual radius
should be verified against the road geometry.
2. Shafer Canyon Road
GPX points: 162
Sharp/moderate curve windows: 131
Left turns: 66
Right turns: 65
Minimum calculated radius: 3.97 meters
Assessment:
Extremely demanding switchback geometry.
Shafer Canyon has the tightest reported minimum radius
among the first three reasonably comparable measurements.
Its 1,500-foot descent through the sandstone cliffs
makes it good test case for downhill braking and cornering.
The left/right distribution is virtually symmetrical
(50.4% left / 49.6% right).
There is therefore no meaningful predicted preference
for either front tire based on turn counts alone.
3. Burr Trail
GPX points: 199
Sharp/moderate curve windows: 139
Left turns: 71
Right turns: 68
Minimum calculated radius: 4.70 meters
Assessment:
Tight switchbacks with a slight right-front loading bias.
The Waterpocket Fold switchbacks provide a combination of
steep grades and tight curves.
The turn distribution is balanced (51.1% left / 48.9% right).
There is a slight theoretical preference for right-front
outside-shoulder loading because of the greater number
of left-hand turns in the test direction. However, the
difference is too small to suggest tire-wear asymmetry.
4. Guardsman Pass
GPX points: 219
Sharp/moderate curve windows: 135
Left turns: 70
Right turns: 65
Minimum calculated radius: 2.04 meters
Assessment:
Mountain-road cornering with a large peak-scrub component.
Guardsman Pass has the fewest curve windows proportionally
among the four roads.
Its left/right distribution is slightly biased toward
left-hand turns (51.9% left / 48.1% right).
This suggests a slight theoretical preference for
outside-shoulder loading on the right-front tire.
Overall Comparison
The four roads share an interesting characteristic that the
left/right turning distributions are reasonably balanced.
Consequently, none demonstrates a strong inherent preference
for wearing one front tire more than the other based on
turn direction alone.
The principal differences are the number of calculated
curves, steepness of descent and reported minimum corner radii.
Shafer Canyon and Burr Trail have steep switchback sections.
Moki Dugway has sustained descending switchbacks.
Guardsman Pass provides a paved mountain-road comparison.
Important Qualification
Actual outside-shoulder wear depends on tire pressure,
alignment, suspension geometry, vehicle weight, braking,
speed, road camber and driving style.
C:\> python mountaincurves.py mokidugway.gpx
Loaded 220 raw track points from 'mokidugway.gpx'.
--- Road Geometric Analysis: mokidugway.gpx ---
Detected sharp/moderate curves (R < 200m): 154
Left-hand turning distribution: 76
Right-hand turning distribution: 78
Minimum corner radius (tightest hairpin): 5.89 meters
--- Top 5 Tightest Hairpins / Curves ---
1. Radius: 5.89m | Direction: Right | Lat/Lon: 37.276825, -109.935955
2. Radius: 7.00m | Direction: Left | Lat/Lon: 37.272532, -109.944278
3. Radius: 7.67m | Direction: Left | Lat/Lon: 37.272507, -109.944243
4. Radius: 8.48m | Direction: Right | Lat/Lon: 37.276883, -109.935927
5. Radius: 8.84m | Direction: Right | Lat/Lon: 37.276849, -109.935935
C:\> python mountaincurves.py shafercanyon.gpx
Loaded 162 raw track points from 'shafercanyon.gpx'.
--- Road Geometric Analysis: shafercanyon.gpx ---
Detected sharp/moderate curves (R < 200m): 131
Left-hand turning distribution: 66
Right-hand turning distribution: 65
Minimum corner radius (tightest hairpin): 3.97 meters
--- Top 5 Tightest Hairpins / Curves ---
1. Radius: 3.97m | Direction: Right | Lat/Lon: 38.449308, -109.820485
2. Radius: 4.44m | Direction: Left | Lat/Lon: 38.448474, -109.818339
3. Radius: 6.81m | Direction: Left | Lat/Lon: 38.447882, -109.818434
4. Radius: 7.10m | Direction: Left | Lat/Lon: 38.447199, -109.819240
5. Radius: 7.93m | Direction: Right | Lat/Lon: 38.450305, -109.819414
C:\> python mountaincurves.py burrtrail.gpx
Loaded 199 raw track points from 'burrtrail.gpx'.
--- Road Geometric Analysis: burrtrail.gpx ---
Detected sharp/moderate curves (R < 200m): 139
Left-hand turning distribution: 71
Right-hand turning distribution: 68
Minimum corner radius (tightest hairpin): 4.70 meters
--- Top 5 Tightest Hairpins / Curves ---
1. Radius: 4.70m | Direction: Left | Lat/Lon: 37.848198, -111.024654
2. Radius: 6.16m | Direction: Left | Lat/Lon: 37.848657, -111.023535
3. Radius: 6.88m | Direction: Right | Lat/Lon: 37.850700, -111.027191
4. Radius: 7.59m | Direction: Right | Lat/Lon: 37.850662, -111.027217
5. Radius: 7.73m | Direction: Right | Lat/Lon: 37.850838, -111.025700
C:\> python mountaincurves.py guardsmanpass.gpx
Loaded 219 raw track points from 'guardsmanpass.gpx'.
--- Road Geometric Analysis: guardsmanpass.gpx ---
Detected sharp/moderate curves (R < 200m): 135
Left-hand turning distribution: 70
Right-hand turning distribution: 65
Minimum corner radius (tightest hairpin): 2.04 meters
--- Top 5 Tightest Hairpins / Curves ---
1. Radius: 2.04m | Direction: Left | Lat/Lon: 40.620587, -111.495800
2. Radius: 2.04m | Direction: Left | Lat/Lon: 40.620605, -111.495784
3. Radius: 2.29m | Direction: Left | Lat/Lon: 40.620597, -111.495796
4. Radius: 2.33m | Direction: Right | Lat/Lon: 40.620464, -111.495741
5. Radius: 2.71m | Direction: Right | Lat/Lon: 40.620569, -111.495601
# #################################################################
# mountaincurves.py
# GPX road geometry analysis
#
# Calculates:
# Corner radii
# Left/right turn directions
# Curvature statistics
# Top 5 tightest hairpins
#
# Use model:
# python mountaincurves.py [input.gpx]
#
# Examples:
# python mountaincurves.py mokidugway.gpx
# python mountaincurves.py shafercanyon.gpx
# python mountaincurves.py burrtrail.gpx
# python mountaincurves.py guardsmanpass.gpx
# #################################################################
# Burr Trail
# <https://i.postimg.cc/X7f6VWKC/burrtrail.jpg>
# <https://i.postimg.cc/CxJyq4Q0/burrtrail.png>
# Guardsman Pass
# <https://i.postimg.cc/JnDSSC4x/guardsmanpass.jpg>
# <https://i.postimg.cc/G3DZQR55/guardsmanpass.png>
# Moki Dugway
# <https://i.postimg.cc/DydH9gFb/mokidugway.jpg>
# <https://i.postimg.cc/3x8VYvxN/mokidugway.png>
# Shafer Canyon
# <https://i.postimg.cc/HLjN71MB/shafercanyon.jpg>
# <https://i.postimg.cc/9M7NJPJ1/shafercanyon.png>
# #################################################################
# v1.7 20261104 Ran a random control test on Utah mountain roads
# Suggested by Blaine Message-ID: <11cf…@dont-email.me>
# #################################################################
# Four Utah test roads (randomly selected on comp.lang.python)
# 1. Moki Dugway
# 2. Shafer Canyon Road (Shafer Trail)
# 3. Burr Trail
#
# Shafer Canyon and Burr Trail have steep switchback sections.
# Moki Dugway has sustained descending switchbacks.
# Guardsman Pass is a paved-mountain-road comparison.
# ###################################################################
# <https://gpx.studio/>
# 1. Open the appropriate road link below.
# 2. Select File > New.
# 3. Select the route-planning tool (pen icon).
# 4. Select the appropriate routing mode (bicycle).
# 5. Trace the complete road or click beginning & ending points.
# 6. Select File > Export > Download file.
# 7. Save using the suggested filename.
# 8. Run the Python analysis.
# C:\> python mountaincurves.py [input.gpx]
# -------------------------------------------------------------------
# <https://overpass-turbo.eu/>
# 1. Open the appropriate road link below.
# 2. Delete the existing query in the editor (if any).
# 3. Copy ONE query below into the editor and press the "Run" icon.
# 4. Press the "Search" icon to zoom into the highlighted results.
# 5. Select Export > Data > GPX
# 6. Save using the suggested filename.
# 7. Run the Python analysis.
# C:\> python mountaincurves.py [input.gpx]
# ###################################################################
# Moki Dugway, Utah State Route 261, Cedar Mesa, Utah.
# I traced the steep switchback section
# <https://gpx.studio/app#14.41/37.27473/-109.93787>
# <https://overpass-turbo.eu/>
# [out:xml][timeout:60];
# // Moki Dugway - southern hairpin extension
# (
# way["highway"]
# (37.17,-109.96,37.23,-109.91);
# );
# (._;>;);
# out body;
# Save as mokidugway.gpx
# -------------------------------------------------------------------
# Shafer Canyon Road (Shafer Trail) Canyonlands National Park, Utah
# <https://gpx.studio/app#15/38.45303/-109.82112>
# <https://overpass-turbo.eu/>
# [out:xml][timeout:60];
# way["highway"]["name"~"Shafer Trail|Shafer Canyon",i]
# (38.43,-109.84,38.51,-109.77);
# (._;>;);
# out body;
# Save as shafercanyon.gpx
# -------------------------------------------------------------------
# Burr Trail, Boulder, Utah, through Long Canyon and Waterpocket Fold.
# <https://gpx.studio/app#14.55/37.85138/-111.03141>
# <https://overpass-turbo.eu/>
# [out:xml][timeout:60];
# // Burr Trail, Boulder, Utah
# // Long Canyon and Waterpocket Fold
# (
# way["highway"]["name"~"Burr Trail",i]
# (37.81,-111.08,37.90,-110.98);
# );
# (._;>;);
# out body;
#
# Save as burrtrail.gpx
# -------------------------------------------------------------------
# Guardsman Pass, Wasatch Mountains, between Brighton & Park City, Utah.
# <https://gpx.studio/app#13.81/40.61548/-111.52533>
# <https://overpass-turbo.eu/>
# [out:xml][timeout:60];
# // Guardsman Pass
# // Wasatch Mountains, between Brighton and Park City, Utah
# (
# way["highway"]["name"~"Guardsman Pass|Guardsman Pass Road",i]
# (40.55,-111.62,40.66,-111.48);
# );
# Save as guardsmanpass.gpx
# ###################################################################
# RUNNING THE FOUR TESTS
# python mountaincurves.py mokidugway.gpx
# python mountaincurves.py shafercanyon.gpx
# python mountaincurves.py burrtrail.gpx
# python mountaincurves.py guardsmanpass.gpx
# ###################################################################
# Results will be inserted here after GPX analysis.
#
# Moki Dugway:
# Pending GPX analysis.
#
# Shafer Canyon:
# Pending GPX analysis.
#
# Burr Trail:
# Pending GPX analysis.
#
# Guardsman Pass:
# Pending GPX analysis.
#
# ###################################################################
import xml.etree.ElementTree as ET
import math
import sys
def parse_gpx(filename):
tree = ET.parse(filename)
root = tree.getroot()
points = []
for trkpt in root.iter(
'{http://www.topografix.com/GPX/1/1}trkpt'
):
lat = float(trkpt.get('lat'))
lon = float(trkpt.get('lon'))
points.append((lat, lon))
return points
def calculate_curvature(p1, p2, p3):
lat_scale = 111132.92
lon_scale = 111412.84 * math.cos(math.radians(p2[0]))
def to_m(p):
return (
(p[1] - p2[1]) * lon_scale,
(p[0] - p2[0]) * lat_scale
)
A = to_m(p1)
B = (0.0, 0.0)
C = to_m(p3)
a = math.hypot(B[0]-C[0], B[1]-C[1])
b = math.hypot(A[0]-C[0], A[1]-C[1])
c = math.hypot(A[0]-B[0], A[1]-B[1])
s = (a + b + c) / 2.0
area_sq = s * (s-a) * (s-b) * (s-c)
if area_sq <= 0 or a*b*c == 0:
return float('inf'), "Straight"
area = math.sqrt(abs(area_sq))
radius = (a*b*c) / (4.0*area)
cross = (
(A[0]-B[0]) * (C[1]-B[1])
- (A[1]-B[1]) * (C[0]-B[0])
)
direction = "Left" if cross > 0 else "Right"
return radius, direction
if __name__ == "__main__":
if len(sys.argv) > 1:
gpx_filename = sys.argv[1]
else:
gpx_filename = 'mokidugway.gpx'
print(
f"No filename provided. "
f"Defaulting to '{gpx_filename}'..."
)
try:
pts = parse_gpx(gpx_filename)
except FileNotFoundError:
print(
f"Error: Could not find GPX file "
f"'{gpx_filename}'."
)
sys.exit(1)
except ET.ParseError:
print(
f"Error: Could not parse GPX file "
f"'{gpx_filename}'."
)
sys.exit(1)
print(
f"Loaded {len(pts)} raw track points "
f"from '{gpx_filename}'."
)
left_turns = 0
right_turns = 0
curve_records = []
for i in range(len(pts)-2):
r, direction = calculate_curvature(
pts[i],
pts[i+1],
pts[i+2]
)
if r < 200:
curve_records.append(
(
r,
direction,
pts[i+1][0],
pts[i+1][1]
)
)
if direction == "Left":
left_turns += 1
elif direction == "Right":
right_turns += 1
print(
f"\n--- Road Geometric Analysis: "
f"{gpx_filename} ---"
)
print(
f"Detected sharp/moderate curves (R < 200m): "
f"{len(curve_records)}"
)
print(
f"Left-hand turning distribution: {left_turns}"
)
print(
f"Right-hand turning distribution: {right_turns}"
)
if curve_records:
curve_records.sort(key=lambda x: x[0])
print(
f"Minimum corner radius (tightest hairpin): "
f"{curve_records[0][0]:.2f} meters"
)
print("\n--- Top 5 Tightest Hairpins / Curves ---")
for idx, (r, direction, lat, lon) in enumerate(
curve_records[:5], 1
):
print(
f"{idx}. Radius: {r:.2f}m | "
f"Direction: {direction} | "
f"Lat/Lon: {lat:.6f}, {lon:.6f}"
)
# ###################################################################
# END OF mountaincurves.py
# ###################################################################
# Results:
# C:\> python mountaincurves.py mokidugway.gpx
# Loaded 220 raw track points from 'mokidugway.gpx'.
# --- Road Geometric Analysis: mokidugway.gpx ---
# Detected sharp/moderate curves (R < 200m): 154
# Left-hand turning distribution: 76
# Right-hand turning distribution: 78
# Minimum corner radius (tightest hairpin): 5.89 meters
#
# --- Top 5 Tightest Hairpins / Curves ---
# 1. Radius: 5.89m | Direction: Right | Lat/Lon: 37.276825, -109.935955
# 2. Radius: 7.00m | Direction: Left | Lat/Lon: 37.272532, -109.944278
# 3. Radius: 7.67m | Direction: Left | Lat/Lon: 37.272507, -109.944243
# 4. Radius: 8.48m | Direction: Right | Lat/Lon: 37.276883, -109.935927
# 5. Radius: 8.84m | Direction: Right | Lat/Lon: 37.276849, -109.935935
#
# # -------------------------------------------------------------------
# C:\> python mountaincurves.py shafercanyon.gpx
# Loaded 162 raw track points from 'shafercanyon.gpx'.
#
# --- Road Geometric Analysis: shafercanyon.gpx ---
# Detected sharp/moderate curves (R < 200m): 131
# Left-hand turning distribution: 66
# Right-hand turning distribution: 65
# Minimum corner radius (tightest hairpin): 3.97 meters
#
# --- Top 5 Tightest Hairpins / Curves ---
# 1. Radius: 3.97m | Direction: Right | Lat/Lon: 38.449308, -109.820485
# 2. Radius: 4.44m | Direction: Left | Lat/Lon: 38.448474, -109.818339
# 3. Radius: 6.81m | Direction: Left | Lat/Lon: 38.447882, -109.818434
# 4. Radius: 7.10m | Direction: Left | Lat/Lon: 38.447199, -109.819240
# 5. Radius: 7.93m | Direction: Right | Lat/Lon: 38.450305, -109.819414
#
# # -------------------------------------------------------------------
# C:\> python mountaincurves.py burrtrail.gpx
# Loaded 199 raw track points from 'burrtrail.gpx'.
#
# --- Road Geometric Analysis: burrtrail.gpx ---
# Detected sharp/moderate curves (R < 200m): 139
# Left-hand turning distribution: 71
# Right-hand turning distribution: 68
# Minimum corner radius (tightest hairpin): 4.70 meters
#
# --- Top 5 Tightest Hairpins / Curves ---
# 1. Radius: 4.70m | Direction: Left | Lat/Lon: 37.848198, -111.024654
# 2. Radius: 6.16m | Direction: Left | Lat/Lon: 37.848657, -111.023535
# 3. Radius: 6.88m | Direction: Right | Lat/Lon: 37.850700, -111.027191
# 4. Radius: 7.59m | Direction: Right | Lat/Lon: 37.850662, -111.027217
# 5. Radius: 7.73m | Direction: Right | Lat/Lon: 37.850838, -111.025700
#
# # -------------------------------------------------------------------
# C:\> python mountaincurves.py guardsmanpass.gpx
# Loaded 219 raw track points from 'guardsmanpass.gpx'.
#
# --- Road Geometric Analysis: guardsmanpass.gpx ---
# Detected sharp/moderate curves (R < 200m): 135
# Left-hand turning distribution: 70
# Right-hand turning distribution: 65
# Minimum corner radius (tightest hairpin): 2.04 meters
#
# --- Top 5 Tightest Hairpins / Curves ---
# 1. Radius: 2.04m | Direction: Left | Lat/Lon: 40.620587, -111.495800
# 2. Radius: 2.04m | Direction: Left | Lat/Lon: 40.620605, -111.495784
# 3. Radius: 2.29m | Direction: Left | Lat/Lon: 40.620597, -111.495796
# 4. Radius: 2.33m | Direction: Right | Lat/Lon: 40.620464, -111.495741
# 5. Radius: 2.71m | Direction: Right | Lat/Lon: 40.620569, -111.495601
# -------------------------------------------------------------------
# ###################################################################
# Analysis of predicted abnormal front tire wear on Utah roads
# Moki Dugway, Shafer Canyon, Burr Trail & Guardsman Pass
#
# The objective was to predict abnormal outside-front tire shoulder wear
# resulting from downhill braking & steering-induced tire scrub on turns.
#
# Two websites were used to obtain the GPX tracks:
# <https://gpx.studio/>
# <https://overpass-turbo.eu/>
#
# The Python script will analyze the GPX tracks, calculating corner radii,
# left/right turning distributions & the 5 tightest calculated hairpins.
#
# I selected one downhill direction for each road wherever possible:
# Moki Dugway: North to South, descending Cedar Mesa.
# Shafer Canyon: Island in the Sky down to Potash Road.
# Burr Trail: Boulder toward Bullfrog.
# Guardsman Pass: From the pass toward Park City.
#
# Summary of GPX Analysis
# 1. Moki Dugway
# GPX points: 220
# Sharp/moderate curve windows: 154
# Left turns: 76
# Right turns: 78
# Minimum calculated radius: 5.89 meters
# Assessment:
# Sustained downhill cornering with balanced tire loading.
# Moki Dugway has a substantial number of tight switchbacks
# over a relatively short descent.
# The left/right distribution is almost perfectly balanced
# (49.4% left / 50.6% right).
# Consequently, the expected lateral loading is reasonably
# balanced between the two front tires, with a very slight
# theoretical bias toward the left front tire.
# The 5.89-meter minimum calculated radius indicates a
# potentially tight corner, although the actual radius
# should be verified against the road geometry.
#
# 2. Shafer Canyon Road
# GPX points: 162
# Sharp/moderate curve windows: 131
# Left turns: 66
# Right turns: 65
# Minimum calculated radius: 3.97 meters
# Assessment:
# Extremely demanding switchback geometry.
# Shafer Canyon has the tightest reported minimum radius
# among the first three reasonably comparable measurements.
# Its 1,500-foot descent through the sandstone cliffs
# makes it good test case for downhill braking and cornering.
# The left/right distribution is virtually symmetrical
# (50.4% left / 49.6% right).
# There is therefore no meaningful predicted preference
# for either front tire based on turn counts alone.
#
# 3. Burr Trail
# GPX points: 199
# Sharp/moderate curve windows: 139
# Left turns: 71
# Right turns: 68
# Minimum calculated radius: 4.70 meters
# Assessment:
# Tight switchbacks with a slight right-front loading bias.
# The Waterpocket Fold switchbacks provide a combination of
# steep grades and tight curves.
# The turn distribution is balanced (51.1% left / 48.9% right).
# There is a slight theoretical preference for right-front
# outside-shoulder loading because of the greater number
# of left-hand turns in the test direction. However, the
# difference is too small to suggest tire-wear asymmetry.
#
# 4. Guardsman Pass
# GPX points: 219
# Sharp/moderate curve windows: 135
# Left turns: 70
# Right turns: 65
# Minimum calculated radius: 2.04 meters
# Assessment:
# Mountain-road cornering with a large peak-scrub component.
# Guardsman Pass has the fewest curve windows proportionally
# among the four roads.
# Its left/right distribution is slightly biased toward
# left-hand turns (51.9% left / 48.1% right).
# This suggests a slight theoretical preference for
# outside-shoulder loading on the right-front tire.
#
# Overall Comparison
# The four roads share an interesting characteristic that the
# left/right turning distributions are reasonably balanced.
#
# Consequently, none demonstrates a strong inherent preference
# for wearing one front tire more than the other based on
# turn direction alone.
#
# The principal differences are the number of calculated
# curves, steepness of descent and reported minimum corner radii.
#
# Shafer Canyon and Burr Trail have steep switchback sections.
# Moki Dugway has sustained descending switchbacks.
# Guardsman Pass provides a paved mountain-road comparison.
#
# Important Qualification
# Actual outside-shoulder wear depends on tire pressure,
# alignment, suspension geometry, vehicle weight, braking,
# speed, road camber and driving style.
# #################################################################
--
On Usenet, every post should strive to add unique added value to the
combined tribal knowledge on the topic currently being discussed.