I'm looking into possibilities to align track data from a GPX file with known roads, perhaps coming from OSM.

So far I'm able to show the tack as such on a map powered by leaflet. Since the app should be as easy to use as anyhow possible I look for web based and if possible fully automated solutions.

The GPX files are stored in a standard CouchDB, so is the App itself.

I think about an approach in which users can upload their GPX file. Once they do the map goes into an edit mode that shows the track and may already suggest a "road only" version of the track. In a best case scenario all the user has to do is to accept the suggestion.

How could something like that be done? Are there any libraries or plugins doing that?