In How to compare GPS tracks I showed how the Needleman-Wunsch algorithm, originally designed for aligning DNA and protein sequences, can be used to compare GPS tracks.

The method I introduced relies on pre-processing the GPS file so that all points are evenly distributed to reduce noise in the data set, but I didn't cover how that's done.

# Trace the path

Starting from the first point, the path is followed and the great-circle distance between each point is accumulated until it exceeds the desired distribution distance.

When the distance has been exceeded, a new point is interpolated between the current point and the previous point.

gpxpy has a function for moving points when given an angle and a distance in meters. The distance is the accumulated distance minus the required distance. gpxpy doesn't have a function for calculating the angle, otherwise known as initial bearing, between two points. Using the