Slide is based on the principles of Mathematical optimization. A coarse input line is iteratively refined to optimize its alignment with the GPS heat data.
The result is a smooth, properly sampled path representing the true path of travel.The high level idea behind Slide is to let the input line fall (or slide) into the valleys of a surface. The surface is built from GPS data where high density regions are lower, creating valleys along the high density corridors.
One can imagine a coarse input "string of beads" being placed on the surface and letting gravity pull it downward. When movement stops, the string should follow the valleys.
To mimic the flexibility of a "string of beads," or something similar, the input line is resampled. This allows the discretely sampled line to still behave like a naturally flexible object.
This resampled line is then ran through a loop where each vertex or point is corrected based on a cost function. This cost function has 3 main parts:
To speed conversion of the process, a momentum component is added. 20% of the correction from the previous loop is added in.
Once the process converges, the line is simplified again and sent back as the result.
This work is still young so there are many things left to try and improve. There are the basic things like improving the cost function weightings.
I'd also like to improve the last simplification step as sometimes the result can contain a few unnecessary points, after a visual inspection. Currently it uses a simple Douglas–Peucker algorithm but there are more advanced methods that could solve the issues.
Also, the current algorithm doesn't move endpoints and can result in some weird stuff near the ends. Letting them move freely probably isn't the answer so some other approach needs to be found.
While still under development, source code is available at github.com/paulmach/slide. Contributions welcome. Slide also makes use of go.geo, a geo/geometry library written in Go.
The source for the iD Editor integration is available on Github. If you're interesting in integrating Slide with a different editor, send an email to paul -at- strava.com