Trail Router
What is Trail Router?
Trail Router helps you discover new running routes. Our routing algorithm prefers paths that go through parks, forests or by water, and avoids busy roads wherever possible.
How do I use Trail Router?
Just tap on the map to set a start point (or long-press on mobile), and Trail Router will automatically create you a 5km (3.1 mile) round-trip route (one that starts and ends at the same location). You can adjust the desired distance using the drop down list.
You can also manually create your own route. Select the 'Point to Point' option, and then tap the map to set your waypoints. Alternatively, you can use the box at the top-left to search for locations.
Sometimes we will generate multiple routes for you. In this case, use the left and right arrows at the bottom of the screen to jump between them.
By default, Trail Router will create a route that follows 'green' paths and roads. You can configure this behaviour (as well as preferences for hilly areas, lit streets and repetition) in the settings menu.
Why did you make it?
It was born out of a frustration I had whilst travelling frequently on business trips to new cities. I'd often want to go for a run, but didn't know the city and was fairly short on time. This typically led to me manually plotting a running route on Google Maps or MapMyRun, which was a time consuming and manual process if you wanted to find a picturesque route that was actually runnable (i.e. not blocked off by impassable roads) and fit within my desired distance.
Essentially, I wanted to be able to say "Give me a round-trip route that's roughly 10km, and features as much nature as possible". This is one of the things that Trail Router can do.
The route that's been generated for me is way too long, why?
Trail Router favours greenery and other nature in its routes, at the expense of distance. You can dial down the effects of this by clicking on the settings cog and dialing "Prefer green areas" down. Even with this set to 0%, Trail Router will still bias against busy roads, but the route will be far more direct.
What do the routing preferences do?
Prefer green areas: This allows you to set a preference for how 'green' you want your route to be. It tells the routing engine to prefer paths and streets that are surrounded by nature, such as parks, forests, lakes and rivers. So a path that is surrounded entirely by forest will always be chosen over a path that is not. You can disable the it by moving the slider all the way to the left.
Hills preference: This allows you to set a preference for how hilly you want your route to be. Setting the slider to the far left means 'avoid hills at all costs', setting it in the middle means 'no preference for hills either way', and setting it to the far right means 'prefer hills wherever possible'.
Avoid repetition: When ticked, this option tells the routing engine to try to avoid using the same 'way' twice. Note that it does not completely prevent it; the same way can still be used as a last resort. This option is useful when you're creating a round-trip route back to your home location and you want to avoid big out-and-back sections. See the blog post for more details.
Avoid unlit streets: This option tells the routing engine to try to avoid using streets that are not tagged in Openstreetmap as being lit. As with other options, it does not prevent the use of streets without lighting, it just makes it the routing algorithm prefer streets are lit. Enabling this option will also cause an overlay to be shown that displays where streets are lit (this works best in conjunction with the dark map layer). See the blog post for more details.
The route being suggested includes a road that is unsafe for runners, why?
Trail Router respects pedestrian access restrictions recorded in OpenStreetMap. If a suggested route includes a road where walking is prohibited, please let me know.
A road can be legal to walk on but still be unsuitable for running. Trail Router automatically discourages potentially unsafe roads using the rules below. This protection is always enabled: these roads receive a 10× routing penalty, and automatically generated intermediate waypoints are moved off them. The penalty makes these roads much less attractive without completely blocking short crossings or necessary connections. Your chosen start, finish and manually placed waypoints are not automatically moved.
We apply this protection to roads matching any of these rules:
- Expressways: roads tagged
expressway=yeswhosesidewalktag is missing or set tono. This rule does not require lane counts or a speed limit. - Major roads with a recorded speed limit: trunk, primary and secondary roads, including their link roads, with a numeric
maxspeedabove 20 mph (about 32 km/h), and either at least two lanes withoneway=yes, or at least four lanes in total. Missing sidewalk information does not exempt these roads. Roads at or below the speed threshold do not match this rule; we do not infer a speed from an unrecognised or non-numeric value. - Major roads without a speed-limit tag: the same road classes with
oneway=yes, at least two lanes, and sidewalks explicitly recorded asnoorseparateon both sides. Missing sidewalk information alone is not enough for this rule.
There are exemptions to all three rules. We do not apply this penalty when a sidewalk is recorded as present on either side, or when pedestrian access is explicitly tagged foot=yes, foot=designated, foot=official or foot=permissive. Footways, paths, steps, pedestrian streets, bridleways and cycleways are also excluded from this classification. Side-specific sidewalk tags take precedence over the general sidewalk tag. A sidewalk tagged separate means it is mapped as a separate path, so it does not exempt the road itself: the route should use that path where available.
These rules rely on the available OpenStreetMap data and deliberately focus on roads with clear signs of heavy traffic. Incomplete or incorrect tags, roads outside these criteria, or a lack of suitable connections can still result in a route using a road you would prefer to avoid.
You can help improve OpenStreetMap data and future route suggestions. In Trail Router, open the help menu and choose "Report an issue". Alternatively, use the StreetComplete Android app to contribute corrections. Accurately record sidewalks, pedestrian access, lane counts, one-way restrictions and speed limits where you can verify them. If a sidewalk is mapped separately, check that it connects to the surrounding walking network.
Corrections to OpenStreetMap may take a few weeks to appear in Trail Router, as we periodically refresh our source data.
How do I run with one of the generated routes?
There's two main ways to use one of the routes generated by Trail Router.
- If you already have a GPS watch or a running app (e.g. Strava, RunKeeper, etc), then you can export a GPX file from Trail Router and import it into your watch or running app. To export a GPX file, click on the share icon on the menu, and click 'Export GPX'.
- You can also run with Trail Router directly. In the Android and iOS app, just click the "Run" button once you've created your route. This will use turn-by-turn navigation by default. If you'd prefer a simpler mode of navigation that just follows you around the map and locks the screen, then go to the settings screen and switch off "Turn-by-turn navigation".
For more details on these options, please read the dedicated blog post on navigating with a Trail Router route.
I've discovered a strange route, how do I report an error?
Please get in touch, and include a link to the faulty route and a description of what's wrong with it. Every report is reviewed and replied to.
I have an idea for a cool new feature, can you add it?
Maybe! Please get in touch.
Are the routes suitable for cycling?
Maybe, but please do not rely on it - at least not for road bikes. We use the tags associated with roads and paths (called "ways" in Openstreetmap terminology) to determine whether it is accessible by foot. We include hiking trails as being accessible by foot, and these will often be unsuitable for bikes. There are a different set of tags that indicate a way's suitability for cycling, and we are not yet using those. If there is demand, then perhaps we will introduce a cycling mode in the future.
How does Trail Router work?
Please see the blog post How Trail Router works.
What do you track and log?
Please see our privacy policy.
Is there an Android/iOS app?
Yes, there is both an Android and iOS app. Visit the app download page for more information.
What's new with Trail Router?
You can check out the release notes to find out.
Can I donate money to help support Trail Router?
Keeping Trail Router online costs around 200 USD per month. We do not have any advertising or paid plans, so that's entirely self-funded at present.
The vast majority of this cost goes on hosting two large servers (256GB RAM, and 2TB of SSD storage), which is required to keep all of the mapping data in memory to ensure routing calculations are fast. The world is a pretty big place, so this consumes a lot of memory!
If you'd like to help support Trail Router, you can donate on a monthly basis via our Patreon page.
Acknowledgements
Trail Router would not be possible without the following open source projects:
- © OpenStreetMap contributors
- Leaflet
- Leaflet routing machine
- Flickity
- PostGIS
- OpenRouteService
- sidebar-v2
- Materialize
- leaflet-locatecontrol
- klein
We would like to thank Mapbox for their support-in-kind via their community programme. This provides Trail Router with free mapping credits. This enables us to continue to grow without the fear of large bills. Read more about Mapbox's support of Trail Router in this blog post.
A big thank you is also owed to Achim Wagenknecht, it-journalist.de and Felix Görner who contributed German translations for trailrouter.com and the Android app respectively.