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:
I would like to take this zigzag and smooth it out to linearize the underlying street.
I can think of a couple of solutions:
- Calculate centroids using rolling averages of six or so points, and use those.
- Spline regression.
Is there a better or best way to approach this problem? (I am using Python 3.5)