How to simplify a spline?
<p>I have an interesting algorithmic challenge in a project I am working on. I have a sorted list of coordinate points pointing at buildings on either side of a street that, sufficiently zoomed in, looks like this:</p>

<p><a href="https://i.stack.imgur.com/UJa6G.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UJa6G.jpg" alt="enter image description here"></a></p>

<p>I would like to take this zigzag and smooth it out to linearize the underlying street.</p>

<p>I can think of a couple of solutions:</p>

<ol>
<li>Calculate centroids using rolling averages of six or so points, and use those.</li>
<li><a href="https://en.wikipedia.org/wiki/Multivariate_adaptive_regression_splines" rel="nofollow noreferrer">Spline regression</a>.</li>
</ol>

<p>Is there a better or best way to approach this problem? (I am using Python 3.5)</p>