How to include off-road segments in routes?

Hi!

I’d like to go from point A to point B doing as much off-road as possible, whilst being able to limit how big a detour I make. I think I want to filter OSM tracks with smoothness set to either “bad” or “very_bad”, but I don’t know how to use this data to generate a route. Any pointers?

In case it’s relevant, I’m writing a Node.js script to output a GPX file.

@SomeoneElse The former. I want to build an app that uses OSM data to do this.