Route GuidesRoutes City GuidesCities Map Log in

Feedback from CTC thread

19 Mar 2016
Find a better bike route. Try our map & route-planner »

Become a supporter

Hi Richard, as promised I have a couple of points I'd like your comments on:

a) use of 'tracks' for cycle autorouting: you mentioned that autorouting in Spain is difficult because of the underlying OSM data, but it's a problem sometimes in the UK too: e.g if I create a route from Keighley to Ilkley, the suggestion is to go over a big hill and includes a length of track (which OSM suggests is 'dirt') - whereas there is a much less hilly route, on minor roads and an NCN, around the hill. I understand that things marked as 'tracks' can vary quite a bit, but wouldn't it be possible to give the option of avoiding 'tracks' altogether (unless perhaps they are also marked as NCN routes?)

b) detours to avoid main roads: see my route 'porthleven' for an example. I ride to Porthleven from Truro fairly often, and mostly your suggested route is good. But if you look at mile 15 (around Wendron) there's a totally unnecessary loop away from the B3297. The route goes on this road anyway, for a greater distance than the bit it avoids. Is it possible to add an algorithm that allows the use of a bit main road if that road has to be used nearby anyway?

I am a (retired) programmer so know how difficult these things can be! If any of your code is open-sourced I may be able to help....but anyway thanks for what I still think is the best cycling autorouter around.

Comments

Tue 22 Mar 2016, 15:01

Thanks for the comments!

Unfortunately (I should put this in a FAQ somewhere...) ‘options’ aren’t possible with the way the route-planner works. The underlying software, OSRM, essentially precomputes the best way from any A to any B, using a technique called Contraction Hierarchies. This takes a few days, even on a very powerful machine, and requires a big server.

The good thing about this is that it means the routing can be lightning-fast – that’s what enables you to drag the route and it to respond instantly. The bad thing is that if I were to add a ‘no tracks’ option, for example, then that’d require buying another server to host the new dataset. Add a third option, and that’d be two more servers. And so on.

So the challenge is to make the default routing as good as it can be. Generally it prefers smooth roads and flat routes, but in the Keighley–Ilkley example the discrepancy in distance is such (an extra 62%) that it grits its teeth and goes for the hilly track instead. I’ll look at the data and the weightings and see if there’s anything I can do.

On the second issue, I’m working on an update that will reduce the amount of ‘wiggling’ in cases like that. It’s mostly done, I just need to finish off a few things and then re-run the multiday process to get the routing updated. Watch this space!

Wed 23 Mar 2016, 23:36

Richard, thanks for the explanation. So if I understand correctly, your database has pre-planned routes between all possible combinations of all nodes in Europe? That certainly is a big amount of data!

I may fork OSRM and have  a play with it.