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).
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.
Thus, a lot of route creation is dependent on hyperlocal knowledge. Strava Route Builder, with the heatmap, goes fairly far on this, but it too isn't the best.
This is a really hard problem to solve.
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).
And thanks for building on top of it and making a useful app :)
I usually tend to export routes and navigate with komoot. Komoot for long distance planning is terribly slow as soon as you hit ~200km+.
btw: in general Komoot is a nicely polished app. I can only recommend it :)
Besides large response data and a slaggish planning interface @ komoot: try routing from northern Italy to Sicily: Komoot doesn't seem to know the ferry departing in Villa s. Giovanni to Messina. Komoot will always - no matter how may vias you place - route you back north and send you on a ferry in Salerno. Yes, I know, I could split my route and such. Yet, I love the idea of my planning tool to show me the complete route - including official transportation ;-)
For years I've contributed trail data to OpenStreetMap, mostly to support mountain biking, but this is the exact kind of other project it benefits. It was really neat being able to try this on local trails and see just what happens.
One question: What tags does it give priority to?
I ask because I tried it on a local trail system, and it seemed to prefer the wide paved and dirt path as opposed to the mountain bike trail. It was weird in that sometimes it'd use the single track, but in others it'd do sort of an awkward thing through the parking lot / service road (highway=service, service=parking_aisle) then use some of the single track (eg markers 1-2) before jumping on the paved path and pretty much ignoring the single track. The single track is really popular with trail runners in this park, so it got me wondering.
An example of that is here:
https://trailrouter.com/#wps=42.65195,-83.05484%7C42.65088,-...
foot=designated route=root, hiking highway=footway, path, track, bridleway, pedestrian, living_street, residential, service, unclassified maxspeed < 20km/h
Looking at your area (https://www.openstreetmap.org/way/191828180#map=15/42.6423/-...), all of the trails are given equal preference. As a result, it then falls back to whichever gives the shortest path. It's choosing the asphalt one (linked above) just because it's the shortest path. In the future, I may add a surface preference option - so you could give additional preference to non-paved paths.
(Making it worse, someone naively editing a mountain bike trail in iD will end up inadvertently flagging it as highway=cycleway. And then people using OSM for cycling directions get routed down an MTB trail... Yay.)
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.
Very neat app.
I know for a fact that the second one is about right, because I ran it already. The first one however is somehow showing "shorter" kilometers, by the end it should be about 2.5km. Did I do something wrong?
Also the first kilometer seems way too short in comparison to the second
Edit: Wait, the numbers are not every kilometer, right?
And yes, the numbers do not represent km, they represent the numbered waypoints listed in the top left box. Any usability suggestions are very much welcome!
And then you can toggle distance measurements.
And for the direction problem, maybe a change of color every kilometer or a gradient? Although that might also be confusing.
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.