Article View: comp.lang.python
Article #51Re: Python analysis of abnormal front tire wear on windy US mountain roads
From: Maria Sophia
Date: Sat, 07 Nov 2026 19:01
Date: Sat, 07 Nov 2026 19:01
177 lines
8974 bytes
8974 bytes
Chris wrote:
> Maria Sophia <mariasophia@comprehension.com> wrote:
>> 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!
>
> Which is impossible with python code posted on usenet as you cannot
> guarantee preservation of whitespace.
>
> As I've told you many times, it would be much more helpful for you to post
> code where it makes sense i.e. github
>
> Here's your code on a gh account thet only took 5 min to set up. Am sure
> you could do the same with a throwaway email address once you've verified
> it
> https://github.com/ithinkiam-ng/roadCurvature/blob/main/mountaincurves.py
>
> Of course, the code doesn't work given the issues above. I encourage Arlen
> to edit it to make it work.
> It is also impossible for others to test as we don't have an example
> dataset to run it on. I also encourage him to share a test file.
Hi Carlos,
Wow. I'm impressed. Really. You added a *lot* of value to the team!
Thank you.
You even taught me some things (see below).
I'll implement most of them, in fact.
But first, the dataset...
You're not the first person to think that I didn't include a "sample
dataset" (i.e., a GPX file), but I actually did because I showed
how to get the file (i.e., I 'taught a man how to fish for it').
This *is* the dataset, for example, for the Moki Dugway GPX file.
<https://gpx.studio/app#14.41/37.27473/-109.93787>
Of course, I "could" have posted the GPX files but anyone can
use the web site to get the same GPX file that I had used.
<https://i.postimg.cc/DydH9gFb/mokidugway.jpg>
I showed in the code and in the writeups HOW to obtain the data set.
For any given section of road, we can find the GPX inherence using this:
<https://gpx.studio/>
1. Open the appropriate road link listed below.
2. Select File > New.
3. Select the route-planning tool (pen icon).
4. Select the appropriate routing mode (e.g., bicycle to stay on asphalt)
5. Trace the complete road (or just click beginning & ending points).
6. Select File > Export > Download GPX file.
7. Save using the suggested road-based below filename.
8. Run the Python analysis.
python mountaincurves.py mokidugway.gpx
python mountaincurves.py shafercanyon.gpx
python mountaincurves.py burrtrail.gpx
python mountaincurves.py guardsmanpass.gpx
python mountaincurves.py angelescrest.gpx
python mountaincurves.py mulholland.gpx
For example, for the given unbiased kindly volunteered testcases,
the python script generated an apples-to-apples commute comparison.
Moki Dugway
<https://gpx.studio/app#14.41/37.27473/-109.93787>
<https://i.postimg.cc/DydH9gFb/mokidugway.jpg>
Shafer Canyon Road
<https://i.postimg.cc/HLjN71MB/shafercanyon.jpg>
<https://gpx.studio/app#15/38.45303/-109.82112>
Burr Trail
<https://i.postimg.cc/X7f6VWKC/burrtrail.jpg>
<https://gpx.studio/app#14.55/37.85138/-111.03141>
Guardsman Pass
<https://i.postimg.cc/JnDSSC4x/guardsmanpass.jpg>
<https://gpx.studio/app#13.81/40.61548/-111.52533>
Angeles Crest Highway (CA-2):
<https://gpx.studio/app#12.39/34.23487/-118.24127>
<https://i.postimg.cc/dV8qhd8f/angelescrest.jpg>
Mulholland Drive (Hollywood Hills):
<https://gpx.studio/app#14/34.13106/-118.44057>
<https://i.postimg.cc/8kB9fH36/mulholland.jpg>
Note that I provided another more detailed method of obtaining a GPX
file using the <https://overpass-turbo.eu/> web site as shown below.
<https://i.postimg.cc/3x8VYvxN/mokidugway.png>
<https://i.postimg.cc/9M7NJPJ1/shafercanyon.png>
<https://i.postimg.cc/CxJyq4Q0/burrtrail.png>
<https://i.postimg.cc/G3DZQR55/guardsmanpass.png>
> My observations of the code are:
>
> * no consideration for the gradient of road. a significant issue on
> "mountain roads"
Yup. Since we're ONLY looking at the DOWNHILL direction, the
elevation needs to be taken into account. It's my first WIP.
>
> * the curvature calc is hugely dependent on the gps track. Slight
> variations will make big differences.
> * the curvature calc is based only on three points which again is highly
> dependent on the gps resolution/accuracy. It could potentially find
> non-existent bends.
Yeah. I know. I don't like taking just 3 points in the curve.
I need to assess the TYPE of curve, and take as many points as needed.
That's my second WIP!
>
> * no checking of travel direction.
You made me think about that, and you're right. I need to doublecheck
that the GPX track is always downhill, and, what's worse, it can go
over the hump, and then I have to decide how to calculate the wear points.
This was NOT on my radar screen, but I've added it as the fourth WIP.
I thank you for catching that lack of error-checking in the Python script.
> * no checking of side of the road. A rh turn will naturally be tighter then
> a lh turn *of the same bend*.
That is completely correct but since the goal is to take only the DOWNHILL
motion, that should not matter as there is only one direction of curve
going in the downhill direction.
> Given the above, have you tested the code for the same road but measured by
> different people at different times? Have you compared the script with real
> world, physical measurements of the bends?
The measurements come from the web sites, where I simply put a dot at the
beginning of the road and another dot at the end, whenever possible.
That means everyone would get almost the same GPX file out of any given
road, as long as that road is simple enough that there's an obvious before
and after (although I noticed a "loop" on a road Blaine suggested).
> You really, really do need to add gradient information. You're completely
> ignoring the third dimension which is nonsensical. It's like drawing a
> straight line on a map of the world and saying that's the shortest route
> for a flight between LA and London.
What I'm missing is not only the grade (e.g., 9% or 10%) but also the pitch
of the road for runoff, which is NOT crowned on our local roads.
On our local roads, the cross slope is for drainage, and it always slopes
into the mountain wall, so it's a different pitch per turn of a degree or
two. This may be impossible to calculate so I may need to estimate it.
I suspect it won't make a big difference, but I need to test it first.
That's my third WIP.
>
> Of course, this whole exercise is based on the predicate of "abnormal"
> wear. It seems obvious that constantly driving up and down high gradient,
> twisty roads will wear tyres faster than a daily commute into the city.
> This is entirely *normal* and predicable wear.
Well, it's "normal" wear for a steep twisty mountain road.
And, more importantly, the mapping expertise, programming algorithms, and
automotive suspension particulars are technical tidbits which have
far-reaching implications in any similar exercise when comparing commutes.
Thanks for looking at the code and suggesting improvements, almost
all of which I easily agree with as I'm nothing if not sensible.
Technical Details
Message-ID:
<11cnsif$1pe0$1@nnrp.usenet.blueworldhosting.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-02.vpngate.v4.open.ad.jp!not-for-mailReferences:
<11cfe7i$2avf$1@nnrp.usenet.blueworldhosting.com> <11cficq$pl38$1@dont-email.me> <11cfveb$1q9l$1@nnrp.usenet.blueworldhosting.com> <11cn0f4$3bvd1$1@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED.public-nat-02.vpngate.v4.open.ad.jp!not-for-mail From: Maria Sophia <mariasophia@comprehension.com> Newsgroups: alt.comp.os.windows-10,comp.lang.python,rec.autos.tech,alt.satellite.gps Subject: Re: Python analysis of abnormal front tire wear on windy US mountain roads Date: Sat, 7 Nov 2026 15:01:36 -0400 Organization: BWH Usenet Archive (https://usenet.blueworldhosting.com) Message-ID: <11cnsif$1pe0$1@nnrp.usenet.blueworldhosting.com> References: <11cfe7i$2avf$1@nnrp.usenet.blueworldhosting.com> <11cficq$pl38$1@dont-email.me> <11cfveb$1q9l$1@nnrp.usenet.blueworldhosting.com> <11cn0f4$3bvd1$1@dont-email.me> Reply-To: pusvul@getTjewytR4so+mqe2.invalid Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 7 Nov 2026 19:01:35 -0000 (UTC) Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="l//KxG3Ge2LojWvwJg0Igv8F0ChK8RUC9RtOxMPUo3U"; posting-host="IfCZz72xNNlHXBkfV9B6WJEa9xVhaehMJfhAC6fCwnM"; logging-data="58816"; mail-complaints-to="usenet@blueworldhosting.com" User-Agent: Mojibake 1p3 Cancel-Lock: sha1:VDuExFKQIngVoqWQGcLcbE4PUuI= sha256:Fz2o62pdPlSeh2iafyH33DKj8TA0WNCZXFRQT6tJAyg= sha1:N9ocpiQ7sVZtVSPe42fzRntWF/M= sha256:6PXu+z/0jzKoY9AiENBWC2NwCajC2WMNQOwhWnay8qg= Content-Language: en-GB