Cycle Travel Question

Cycle-touring, Expeditions, Adventures, Major cycle routes NOT LeJoG (see other special board)
nirakaro
Posts: 1575
Joined: 22 Dec 2007, 2:01am

Re: Cycle Travel Question

Post by nirakaro »

An issue with an old version of Android: CT works fine on my phone (Android 10), but on my tablet (Android 5), I have the same no-hamburger-menu problem as mjr. And it's not on the right of the latitude/longitude bar, because there's no latitude/longitude bar. And the long press to add a new waypoint doesn't happen. In fact once I've put in a start and a destination, I can't do anything at all except delete them. Any solution to this?
Richard Fairhurst
Posts: 2027
Joined: 2 Mar 2008, 4:57pm
Location: Charlbury, Oxfordshire

Re: Cycle Travel Question

Post by Richard Fairhurst »

ChrisF wrote:I realy like cycle.travel but I have one problem - maybe I'm doing something wrong. I often plan a 'loop' ride, out and back a different way, choosing a few wayponts along the way where the map looks interesting. But after about half-way, if my next chosen point is nearer to the start that the last point, the planner extends the start of my ride (the green marker) to where I click, rather than extending the end. So then I have to 'undo' then choose a point nearer to the last position plotted - in effect partially choosing the route myself rather than letting the algorithms do it.


Generally it will add the point at the end if you're clicking to add one point after another, because it guesses that's what you want to do. But if you've just done something else (say, dragging one of the via points) then it doesn't know whether you might want to add at the start or end, so it tries to make an educated guess based on how near it was to either end.

If you have a particular scenario ("I click this, then I click this, then I click this"), maybe with placename examples, that'd be helpful in fine-tuning it - I don't generally plan my own routes that way so it's not something I encounter too often. Or as mjr says you can always drag the end point and add intermediate waypoints.

Bmblbzzz wrote:I've been planning a route from near Gloucester to Ashbourne in Derbyshire. Cycle.travel plots a route through the middle of Birmingham. Our second city is full of attractions, but I prefer to avoid large built up areas when touring. Normally, it's not a problem; just drag the route away from the city a bit and let it re-plot. But because the West Midlands conurbation is so huge and because the route really is right through the middle, I have to choose: do I go south and east, or west and north? The obvious answer in this case is to seek local advice. But in general it makes me wonder; is there any way of telling cycle.travel to avoid a certain area? Or in general, what's the best way of dealing with situations like this (such as Birmingham, London, Paris... )?


As ever cycle.travel's algorithm can't really do routing options (because everything's pre-computed) but there's a couple of tricks you can use here.

The easiest one is to plan a round-trip route. So if I do Gloucester-Ashbourne as a round-trip, then the return route goes west of Birmingham, through rural Staffordshire. (Interestingly if I do Ashbourne-Gloucester, the return route goes east through Meriden!) Add a via point somewhere on the return leg to "fix" it, then click on the green start point and delete that.

The other technique is to plan the route as normal, drag it away, and notice what happens to the route when you're dragging it. So, for example, plan the route and then drag it away from Birmingham to (say) Telford. As you drag you'll see that although the middle section changes depending where you drag it, the southern section pretty quickly settles on a route via Stourport. So you can move your via point to Stourport, and c.t will then find its favoured route from there on to Ashbourne.

The whole area of alternative routes and suggestions is something I'm experimenting with at the moment... there are interesting possibilities once you dive into the algorithm!

nirakaro wrote:An issue with an old version of Android: CT works fine on my phone (Android 10), but on my tablet (Android 5), I have the same no-hamburger-menu problem as mjr. And it's not on the right of the latitude/longitude bar, because there's no latitude/longitude bar. And the long press to add a new waypoint doesn't happen. In fact once I've put in a start and a destination, I can't do anything at all except delete them. Any solution to this?


I've just replaced the special "hamburger menu" character with a little image which should show up fine. I would caution though that I wouldn't rely on cycle.travel working on something as old as Android 5 - it uses a couple of open source libraries to glue everything together (in particular, Leaflet for the map display, and Flot for the elevation graph), and their latest versions may not retain Android 5 compatibility.

On mobile you can double-tap to add a new via point.
cycle.travel - maps, journey-planner, route guides and city guides
Angstrom
Posts: 178
Joined: 21 Nov 2018, 6:57am
Location: Montpellier, France

Re: Cycle Travel Question

Post by Angstrom »

Richard Fairhurst wrote:
Bmblbzzz wrote:I've been planning a route from near Gloucester to Ashbourne in Derbyshire. Cycle.travel plots a route through the middle of Birmingham. Our second city is full of attractions, but I prefer to avoid large built up areas when touring. Normally, it's not a problem; just drag the route away from the city a bit and let it re-plot. But because the West Midlands conurbation is so huge and because the route really is right through the middle, I have to choose: do I go south and east, or west and north? The obvious answer in this case is to seek local advice. But in general it makes me wonder; is there any way of telling cycle.travel to avoid a certain area? Or in general, what's the best way of dealing with situations like this (such as Birmingham, London, Paris... )?


As ever cycle.travel's algorithm can't really do routing options (because everything's pre-computed) but there's a couple of tricks you can use here.

I don't know if that is equivalent to routing options, but BRouter web allows to draw a polygon to define a "no-ride zone".

Would that be a simple solution to use "no-ride zones" combined with the algorithm used for "suggesting routes"?

In the above example, one would hand-draw an polygon over Birmingham then let CT do it's magic to route between points avoiding the defined area.
"A cycle tourist doesn't have a track record. Just memories". Jean Taboureau
Psamathe
Posts: 17616
Joined: 10 Jan 2014, 8:56pm

Re: Cycle Travel Question

Post by Psamathe »

Richard Fairhurst wrote:...
As ever cycle.travel's algorithm can't really do routing options (because everything's pre-computed) .....

Out of interest, when you say "everything's pre-computed" presumably that can't be literally "everything" e.g. routes pre-computed from my house to "everywhere" then also from my neighbours house to "everywhere" as that would be an unbelievable table. Presumably there must be some on the spot calculation from e.g. start Lat/Long to nearest pre-computed point and same at end (and with via points) - given start, end and via points could be anywhere.

e.g. Say I'm starting in Rampton (UK) and heading to Eibenstock (DE) is there a pre-computed route between those two locations? and if I then add a via point at Roden (NL) are there precomputed routes Rampton to Roden and Roden to Eibenstock. And what is the start/end/via don't happen to lie at a pre-computed point?

It's just an out of interest question and not relevant to functionality or anything.

Ian
Richard Fairhurst
Posts: 2027
Joined: 2 Mar 2008, 4:57pm
Location: Charlbury, Oxfordshire

Re: Cycle Travel Question

Post by Richard Fairhurst »

Perhaps the simplest way to explain it is by thinking of planning a car route from a house in London to a cottage in the Yorkshire Dales, without the aid of a journey planner.

You could work out the route by tallying up every possible road between the two, and choosing the combination that was shortest overall. That would give you the right answer, but it would take you a long time to work out. (This is basically Dijkstra's algorithm: https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)

Instead, what you'd do is:

  • take the minor road from your house to the nearest A road
  • take the A road as far as the M1
  • take the M1 all the way to Leeds
  • take an A road from Leeds into the Yorkshire Dales
  • take a B road from the edge of the Dales to the village where the cottage is
  • take a minor road from the village to the cottage itself

You can see that there's a hierarchy there: you start the journey by going up the hierarchy from back streets to motorways, and you finish by going down the hierarchy from motorways to back streets. This is much quicker than working out every conceivable permutation. (This algorithm is called Highway Hierarchies.)

The principle is great. But a simple hierarchy like that doesn't always work for cars, and it certainly doesn't work for bikes.

Still... what if you could calculate a hierarchy for bikes, ignoring whether something is called an A road or a B road, and just using the road/path network (suitably weighted for surfaces, hilliness, etc.)? Effectively, devising a cycle network for the UK, where the "motorways" are the best long-distance routes. Then you'd get bike-friendly results, incredibly quickly.

Well, you can, and the algorithm is called Contraction Hierarchies (https://en.wikipedia.org/wiki/Contraction_hierarchies). It was developed at the Karlsruhe Institute of Technology in c. 2008. If what you want is fast results without insane hardware requirements, it's still pretty much the best there is. This is what cycle.travel uses, courtesy of a routing engine called OSRM, initially developed by a hugely talented Karlsruhe graduate called Dennis Luxen.

The downside is that you have to calculate the hierarchy in advance. This takes a long time - about a day for cycle.travel's Europe coverage (and another day for North America). Once the hierarchy is calculated, it's set in stone - you can't make adjustments to it at query time. So that rules out things like "no ride zones", or user-settable preferences for difference types of path, or whatever. The only preference that cycle.travel has is paved/unpaved, and that's because I calculate two hierarchies in advance, then use the appropriate one depending on your paved/unpaved preference. Each one takes up about 16GB RAM on the server for Europe (and a similar amount for North America), so I can't roll out more preferences without renting more hardware, and I can't do that without spending a lot more money. :)
cycle.travel - maps, journey-planner, route guides and city guides
Bmblbzzz
Posts: 6249
Joined: 18 May 2012, 7:56pm
Location: From here to there.

Re: Cycle Travel Question

Post by Bmblbzzz »

Thank you Richard. Useful answers as usual. There's one odd thing though:
Richard Fairhurst wrote:The easiest one is to plan a round-trip route. So if I do Gloucester-Ashbourne as a round-trip, then the return route goes west of Birmingham, through rural Staffordshire. (Interestingly if I do Ashbourne-Gloucester, the return route goes east through Meriden!) Add a via point somewhere on the return leg to "fix" it, then click on the green start point and delete that.

When I do this, from Gloucester to Ashbourne, the outward leg goes through Birmingham as for the one-way journey, but the return doesn't go west, it goes east! Through Coventry, in fact. Curious! :?:
Angstrom
Posts: 178
Joined: 21 Nov 2018, 6:57am
Location: Montpellier, France

Re: Cycle Travel Question

Post by Angstrom »

THat's very informative and clear explanation, thank you.


Richard Fairhurst wrote:
The downside is that you have to calculate the hierarchy in advance. This takes a long time - about a day for cycle.travel's Europe coverage (and another day for North America). Once the hierarchy is calculated, it's set in stone - you can't make adjustments to it at query time. So that rules out things like "no ride zones", or user-settable preferences for difference types of path, or whatever.



I apologize for coming back in a manner that may look overly "insistant", but I'll take the risk:
Would it not be possible (for "no-ride zone"), to pre-calculate "virtual" way points using much simpler algorithms first, then using CT's normal algotithms between those?
I realize this might not always produce the "perfect" relsult (ie a result which would have been produced if the pre calculated hierarchy would have taken the "no-ride-zone" into account), but that may be just fine for us users.
I realize that the added complexity in your system may in the end not be worth it, considering how easy it is for a user to set those waypoints manually with the current version.
So I hope you understand this is not a request; just a mere dialogue.... :)
"A cycle tourist doesn't have a track record. Just memories". Jean Taboureau
Richard Fairhurst
Posts: 2027
Joined: 2 Mar 2008, 4:57pm
Location: Charlbury, Oxfordshire

Re: Cycle Travel Question

Post by Richard Fairhurst »

There are certainly interesting things that could be done with virtual waypoints! I think there's definitely potential in something along those lines and I've been experimenting with a few related things...
cycle.travel - maps, journey-planner, route guides and city guides
Psamathe
Posts: 17616
Joined: 10 Jan 2014, 8:56pm

Re: Cycle Travel Question

Post by Psamathe »

Richard Fairhurst wrote:Perhaps the simplest way to explain it is by thinking of planning a car route from a house in London to a cottage in the Yorkshire Dales, without the aid of a journey planner.

You could work out the route by tallying up every possible road between the two, and choosing the combination that was shortest overall. That would give you the right answer, but it would take you a long time to work out. ....

Many thanks for the detailed explanation. I'd previously been thinking about the pre-calculation as an A-B pre-calculation rather than a weighting.

Thanks
Ian
User avatar
RickH
Posts: 5832
Joined: 5 Mar 2012, 6:39pm
Location: Horwich, Lancs.

Re: Cycle Travel Question

Post by RickH »

Is it possible to fiddle with the weightings a little to reduce silly short sections where it turns you off a busy road for a hundred metres or so before turning you back on again, often with 2 right turns across traffic to boot?

Here's an example snippet out of a recent route I used that wanted me to use a layby - https://cycle.travel/map/journey/209916

Screenshot_20210401-171146.png
Former member of the Cult of the Polystyrene Head Carbuncle.
Richard Fairhurst
Posts: 2027
Joined: 2 Mar 2008, 4:57pm
Location: Charlbury, Oxfordshire

Re: Cycle Travel Question

Post by Richard Fairhurst »

I do try to avoid those. It's not always easy sadly.
cycle.travel - maps, journey-planner, route guides and city guides
Richard Fairhurst
Posts: 2027
Joined: 2 Mar 2008, 4:57pm
Location: Charlbury, Oxfordshire

Re: Cycle Travel Question

Post by Richard Fairhurst »

Something new for Easter weekend...

Screenshot 2021-04-01 at 20.39.45.png

Ordnance Survey maps!

You can now use OS maps (1:50k Explorer or 1:25k Landranger) when planning a route on cycle.travel. The routing is still the same cycle.travel routing, but you can use OS as a background map.

OS charge for their maps (of course) so I can't offer them for free on cycle.travel, sadly - but you get them if you sign up as a cycle.travel supporter. (Satellite maps too.) I'm hoping to add other specialist European and American maps for supporters in due course too.
cycle.travel - maps, journey-planner, route guides and city guides
Bmblbzzz
Posts: 6249
Joined: 18 May 2012, 7:56pm
Location: From here to there.

Re: Cycle Travel Question

Post by Bmblbzzz »

Ooh, looks like you've been visiting the Kiftsgate stone! I love OS maps but I've got rather fond of the muted earthy pallet of whatever it is that c.t uses.
LittleGreyCat
Posts: 1177
Joined: 7 Aug 2013, 8:31pm

Re: Cycle Travel Question

Post by LittleGreyCat »

On the subject of OS maps.

I am a supporter so I should be fine, I think.

However I have a subscription with OS maps so in theory I could be entitled to use them anyway even if I wasn't a supporter.
Security and stuff may be complex, but would it be possible to register your OS account with Cycle.Travel and use that to obtain the maps?

Sounds possible perhaps, but too much hassle?

Edit: route planning using the OS site is a real pain in the posterior because it doesn't support "snap to route".
I've checked and I can see the OS map so I'm now going to check what I can plan on Cycel.Travel.
Be nice if you added bridleways and footpaths! {ducks}

Edit 2: Using a route that I know I seem to be able to get a plan along a bridleway then a footpath.
However it throws a wobbler near where the footpath joins a road and insists on looping back on itself.
Now wondering if the footpath is graded into gentle and rough or something.
https://cycle.travel/map/journey/210335
I foresee loads of fun. :-)

Great new feature!
User avatar
mjr
Posts: 20297
Joined: 20 Jun 2011, 7:06pm
Location: Norfolk or Somerset, mostly
Contact:

Re: Cycle Travel Question

Post by mjr »

Could the c.t map style have barrier markings added, or these appear in the turn by turns, please?
MJR, mostly pedalling 3-speed roadsters. KL+West Norfolk BUG incl social easy rides http://www.klwnbug.co.uk
All the above is CC-By-SA and no other implied copyright license to Cycle magazine.
Post Reply