Author here. Trail Router is a running route planner that prefers greenery and nature in the routes it generates, and biases against busy roads. It can generate round-trip routes that meet a specified distance, as well as point-to-point routes.
I've written a detailed blog post about how Trail Router works here: https://trailrouter.com/blog/how-trail-router-works/ I developed this because I am (or was...) a frequent traveller for work, and I like to run wherever I visit. But I don't enjoy running on busy main roads, and I found that without careful and time consuming route planning that is often what would end up happening if I didn't know the area. Trail Router is my solution to this problem. After a previous discussion (https://news.ycombinator.com/item?id=23177351) received quite a lot of attention, dang reached out to suggest I post a Show HN to reach a wider audience. I've addressed some of the original feedback too - for example, you can now prefer hills in your routes, as well as avoid them.
Thanks! Cycling is on the to-do list. But I'm conscious it probably wouldn't just be a single category - there would need to be separation for road cycling and mountain biking.
The routing algorithm does already prefer roads with low speed limits, but there is definitely more that could be done in this space (e.g. a slider to set a preference to avoid higher speed roads). It also depends on the availability of speed limit data (I use the OpenStreetMap database).
I frequently do 50km - 60km cycling routes from my home and I've manually figured out the greenest and least busiest routes.
I tested it with your app and the route is near identical to what I've figured (over the course of several thousand km's of trial an error). I'm amazed! Edit: I'm usually on a mountain bike.
Thanks for the recommendation - cycle.travel’s my site!
I’d like to do a dirt/gravel profile. Main reason I haven’t so far is that it’s very hardware-intensive (as in tipping over into renting another Hetzner box).
This is actually a wonderful product - thanks for making it! I've looked for a website that did this for a long time, and this works surprisingly well. It actually produced a route that is very similar to one I found myself.
The blog post provides a lot of insights. Good read. Some questions.
Do you plan to support area routing? And you write: "However, the good news ended there: Openrouteservice does not publish the code for calculating this green index". Is your code publicly available and allows "the news to end good" ;) and maybe even integrated elsewhere?
Good point RE the green index calculation. The very least I could do would be to upstream a reference implementation and documentation back to Openrouteservice. I will take care of that.
Wow, great project. I was working on exactly this in 2015 using Grasshopper but never finished it. I like how much time you invested to solve all the tiny details around the edge cases. Like prefering certain streets, no-hills and trying not to run the same street twice. It wasn’t clear to me from the blog article, does prefer “green” also prefer water areas?
Hey Sam, I run ridewithgps.com and have been reaching into the guts of graphhopper to do interesting routing stuff as well. We just silently rolled out popularity based routing, where we used our database of 50mm rides to build a popularity graph which is used to add a popularity weight in routing decisions. Got a long pipeline of other projects coming out in the same space. Drop me a line if you ever want to yack about these things! cullen@ridewithgps.com
Are you guys considering adding in more social features to compete with Strava? It’s seems an excellent opportunity right now with so many people upset with them. A simple UI update showing a feed, add a kudos system... you’re halfway there.
That's actually one of our main focuses over the next two months, along with mapping and routing improvements. We've seen a decent uptick in people migrating, and they are asking for more social stuff. We've always been shy about becoming a social network, so our focus is on making it much easier to connect with people you know, see what they are doing, while making it optional and not pushing it too hard to our existing users.
I certainly will, thanks! And congratulations on all your success with Ride with GPS. I'm not really a cyclist, so I only used it for the first time last night, but it looked and worked great for me.
Nice job, the algorithm is really effective! I tried this in multiple cities where it ended up recommending very similar routes to some of my established running routes, and even some new combinations :)
Love that your algorithm tries to exclude out-and-backs, I think that goes a long way to make the routes feel organic and appeal to runners. This is really polished and I wish you the best! One feature suggestion: I wonder if you could have a flag to generate routes starting in parking lots/park entrances in a radius around the starting location. This could go a long way to recommend some common long-run routes where you need to travel a brief distance via car or public transportation but then can get 10-20 miles entirely in the woods.
Thanks! The avoidance of out-and-backs was a must-have for me. It can definitely be improved though. For example, right now the algorithm tries to avoid traversing the same path twice, but it will happily use a path that is only a few metres away! So adding some buffer around that (to penalise paths that are close to one already taken, if not the same) is a future bit of work.
Your suggestion is a nice one. Here in the UK, where it's common to have trains connecting most towns and larger areas, I have thought about adding the ability to say "I want to run 20 miles, and finish at a train station that can get me home in under an hour". Assuming the user is using a car makes it more easily achievable though. Consider it on the todo list!
wait, it avoids out-and-backs? could have fooled me, all the routes it showed for my house were out and backs, some had multiple points of out and back(like a letter Y or E)... i guess thats why i hate running near home, everything is an out and back and even the computer cant find an alternative. :)
It tries to! But if there's no good way to avoid them, then it will end up taking them anyway.
More specifically, when 'avoid repetition' is enabled (it is by default), then the routing algorithm has a very significant penalty weight applied to any existing path already taken.
I live in a small town that is getting grown over by suburbia. The routes ignore all the nice open farm fields to the east of me, and runs me down the busiest streets through some of the most dangerous intersections in my entire state, just to skim by the edge of a park in the city.
In that same 6 mile distance, in addition to running past the farms, it could have run me up to the base of the mountains, down the nice bike trail that goes through groves of trees and open field, then back home. This is one reason I love testing apps like this - my town almost always messes them up.
Would you mind sharing the name of your town? Feel free to email me directly if you wish, contact details are in my profile. It could be that OpenStreetMap data (which I use extensively in the algorithm) isn't very detailed for your area, but I'm keen to investigate further.
I don't mind sharing the town - Spanish Fork, UT 84660
Especially check out the east side of town, it seems like it wants to go into town for anything short of a 15 mile loop, whereas going east is far more natural.
It's not finding any green 'features' in the vicinity (I know, the mountain range off to the east would beg to differ...), so it's falling back to guessing a direction in which to head. I can see that the Uinta-Wasatch-Cache National Forest is tagged properly in OpenStreetMap though (https://www.openstreetmap.org/relation/3502235), so this should be something I'm able to improve on. Thanks again for your feedback!
Comments (128) 41 threads
I've written a detailed blog post about how Trail Router works here: https://trailrouter.com/blog/how-trail-router-works/
I developed this because I am (or was...) a frequent traveller for work, and I like to run wherever I visit. But I don't enjoy running on busy main roads, and I found that without careful and time consuming route planning that is often what would end up happening if I didn't know the area. Trail Router is my solution to this problem.
After a previous discussion (https://news.ycombinator.com/item?id=23177351) received quite a lot of attention, dang reached out to suggest I post a Show HN to reach a wider audience. I've addressed some of the original feedback too - for example, you can now prefer hills in your routes, as well as avoid them.
This is awesome!
EDIT: In addition to optimizing for green routes, optimizing for low speed car zones would be a killer feature.
The routing algorithm does already prefer roads with low speed limits, but there is definitely more that could be done in this space (e.g. a slider to set a preference to avoid higher speed roads). It also depends on the availability of speed limit data (I use the OpenStreetMap database).
Continue this thread — 4 replies
I tested it with your app and the route is near identical to what I've figured (over the course of several thousand km's of trial an error).
I'm amazed!
Edit: I'm usually on a mountain bike.
I’d like to do a dirt/gravel profile. Main reason I haven’t so far is that it’s very hardware-intensive (as in tipping over into renting another Hetzner box).
Continue this thread — 9 replies
Do you plan to support area routing?
And you write: "However, the good news ended there: Openrouteservice does not publish the code for calculating this green index". Is your code publicly available and allows "the news to end good" ;) and maybe even integrated elsewhere?
Good point RE the green index calculation. The very least I could do would be to upstream a reference implementation and documentation back to Openrouteservice. I will take care of that.
Continue this thread — 1 reply
Continue this thread — 4 more replies
Love that your algorithm tries to exclude out-and-backs, I think that goes a long way to make the routes feel organic and appeal to runners. This is really polished and I wish you the best!
One feature suggestion: I wonder if you could have a flag to generate routes starting in parking lots/park entrances in a radius around the starting location. This could go a long way to recommend some common long-run routes where you need to travel a brief distance via car or public transportation but then can get 10-20 miles entirely in the woods.
Your suggestion is a nice one. Here in the UK, where it's common to have trains connecting most towns and larger areas, I have thought about adding the ability to say "I want to run 20 miles, and finish at a train station that can get me home in under an hour". Assuming the user is using a car makes it more easily achievable though. Consider it on the todo list!
More specifically, when 'avoid repetition' is enabled (it is by default), then the routing algorithm has a very significant penalty weight applied to any existing path already taken.
Since people were interested, we invited Sam to repost it.
In that same 6 mile distance, in addition to running past the farms, it could have run me up to the base of the mountains, down the nice bike trail that goes through groves of trees and open field, then back home.
This is one reason I love testing apps like this - my town almost always messes them up.
Especially check out the east side of town, it seems like it wants to go into town for anything short of a 15 mile loop, whereas going east is far more natural.
All comments shown.
Couldn't load more comments. Check your connection and try again.