Closed HilaryN closed 3 years ago
Yes; would be good to add this to the Android app - there is definitely demand.
@mvl22 could you point me at the relevant API call, please?
@si-the-pie Could you e-mail Oliver, Hilary, and Jez the details for leisure routing under the API V1 layout? It should be the same as what the iPhone app is using.
It would be good to have the circular route on the website journey planner, too - I'm not sure where to request that. (Unless circular route is already there and I can't see it.)
It would be good to have the circular route on the website journey planner, too - I'm not sure where to request that. (Unless circular route is already there and I can't see it.)
Yes, we hope to have news on this soon. The current whole main website UI is horrendously outdated and that has slowed down getting the leisure routing in.
I'm not sure where to request that.
Via the main feedback system, but I've seen it now anyway :)
In the absence of an email from @si-the-pie, I've just gone ahead and reverse engineered this from the (already public) iOS code. We need to use something like the following:
I knew I had something buried in my email, so I've dug through and can confirm this is correct.
We must have either distance
or duration
, you can't have both. The must be only one waypoint passed in the itinerarypoints
parameter.
We may also pass a poitypes
parameter, containing a comma-separated list of poi types. Leisure routes will 'tend to find routes through these POI types, if they are available'.
My email also describes some additional return types, although I don't know if this is still correct.
otherRoutes string A comma separated list of the leisure routes found, which can be some or all of: leisure1,leisure2,leisure3,leisure4,leisure5,leisure6,leisure7,leisure8. These can be used as the plan argument to retrieve a particular one of the (up to) eight routes that were previously generated. (This may not be/have ever been relevant. Or possibly only applies in a small area of North Staffordshire :slightly_smiling_face:)
POI These contain points of interest, POIs (if found) near to the requested waypoints.
Yes, that is all correct - thanks.
Screenshot from an iPhone:
Yep, that UI is good to replicate.
I might even use this feature... except the app would probably tell me to avoid all the fun hills 😂
If you're up for developing this one @HilaryN then feel free to crack on. Personally I'd start from the API calls but that's because I've never been a UI person... 😀
The documentation is now public, at: https://www.cyclestreets.net/api/v1/leisure/
Progress update.
Here is a series of screenshots showing what happens currently when 0/1/2/3 waypoints are selected:
I've changed the second one (when 1 waypoint is selected) so that the text at the top now reads “Tap map to set Waypoint” / “Tap here for Circular Route”. The other screens (2 or more waypoints selected) are the same as before, and tapping at the top would bring back an A-B route as before:
Tapping at the top for a Circular Route brings up this screen, and you can drag the bar to change the minutes:
I've only done duration so far, not distance or POI's yet.
I'm thinking to save whatever duration / distance is selected here to bring up next time this screen is brought up.
When the “Create circular route” button is pressed, the route is retrieved and displayed. According to the API documentation, up to 8 routes are plotted and the quietest one is returned. Here, “leisure2 route” is shown (see description at top):
If you were to tap and hold on this screen for an A-B route you would get the menu allowing you to replan as quietest, balanced etc. For a circular route you get a choice of the alternative leisure routes (excluding the one already displayed, of course). Here are a couple of screenshots of the context menu for an A-B route and a circular route:
Or if you press the Options menu at the top, you will get one of the following, depending on whether an A-B route or Circular route is displayed – the last option on this menu has slightly different wording:
Selecting a different alternative retrieves the relevant alternative circular route, and the context menu changes accordingly:
btw The number of minutes on the route seems to vary quite a lot from that selected (17 mins here) – is that what you would expect, @mvl22, or have I done something wrong?
Any other feedback welcome. @oliverlockwood @jezhiggins
Also, I haven't looked at LiveRide yet, but any thoughts on what should happen when one goes too far off the route? Maybe replan a route from current position to nearest point on route and append the rest of the route, if that's possible?
It's snowing tomorrow so I can't try it out for real - I'll have to make do with the emulator :-)
Tapping at the top for a Circular Route brings up this screen, and you can drag the bar to change the minutes:
What's the current range of the slider you have? Please do make it the same as the iPhone app. (We want to avoid super-long times/distances.)
The number of minutes on the route seems to vary quite a lot from that selected (17 mins here)
Yes, unfortunately the resulting output time compared to the requested time is not particularly accurate yet. Unfortunately the leisure routing is quite complex so this needs some engineering. Please just assume this will improve over time.
Also, I haven't looked at LiveRide yet, but any thoughts on what should happen when one goes too far off the route? Maybe replan a route from current position to nearest point on route and append the rest of the route, if that's possible?
It should just be the same as whatever happens with a normal A-B route.
What's the current range of the slider you have? Please do make it the same as the iPhone app. (We want to avoid super-long times/distances.)
Good question. The iPhone seems to have a range of 15 mins to 240 mins, according to the screenshot above. But when I tested the API I found it accepted 5 - 203 mins, hence I've made the range 5 - 200 mins. Do you mind if I keep the lower limit of 5 mins, to allow for less fit / beginner cyclists?
I haven't checked the distance limits yet on the API and I'm not sure what they are on the iPhone - I'll need to ask someone with an iPhone.
Yes, unfortunately the resulting output time compared to the requested time is not particularly accurate yet. Unfortunately the leisure routing is quite complex so this needs some engineering. Please just assume this will improve over time.
I can imagine, yes.
Also, I haven't looked at LiveRide yet, but any thoughts on what should happen when one goes too far off the route? Maybe replan a route from current position to nearest point on route and append the rest of the route, if that's possible?
It should just be the same as whatever happens with a normal A-B route.
Hmm, I would expect a normal replan to plan from my current location to my destination, via relevant waypoints I specify, which wouldn't work for a circular route, and it wouldn't make sense to plan a new circular route from current location.
Though in fact what seems to happen for an A-B route is that it just tries to take me back to my original route, no matter how far off it I go. (My experiences from having to go round 3 sides of a park when either it's closed or I don't want to get mugged by going through it after dark!)
So I guess that would work for a circular route.
hence I've made the range 5 - 200 mins. Do you mind if I keep the lower limit of 5 mins, to allow for less fit / beginner cyclists?
5-200 is good. Definitely good to have a low range of 5 minutes - yes!
Hmm, I would expect a normal replan to plan from my current location to my destination, via relevant waypoints I specify, which wouldn't work for a circular route, and it wouldn't make sense to plan a new circular route from current location.
Yes, sorry I clearly wasn't thinking very clearly at all! You're completely right this doesn't actually translate well.
Maybe replan a route from current position to nearest point on route and append the rest of the route, if that's possible?
Yes, I think that's the best that can be done.
Currently I'm just displaying the start point as a waypoint for a circular route, as in the screenshots above. I don't really want to clutter the display with lots of waypoints. Is that how it shows on the iPhone, do you know?
But if a replan is needed in LiveRide it would then turn into an A-B route with lots of waypoints, which would need to be displayed - I can't see any easy way around. Again, is that what happens on the iPhone for a replan?
Currently I'm just displaying the start point as a waypoint for a circular route, as in the screenshots above. I don't really want to clutter the display with lots of waypoints. Is that how it shows on the iPhone, do you know?
The iPhone app does actually show the waypoints, but it shouldn't really. Ideally you should just show the planned point, not the virtual points.
But if a replan is needed in LiveRide it would then turn into an A-B route with lots of waypoints, which would need to be displayed - I can't see any easy way around. Again, is that what happens on the iPhone for a replan?
There is no LiveRide equivalent yet on the iPhone :(
I don't think you can avoid doing what you suggest. I wouldn't worry too much about this - it would be better to have replanning with the points showing explicitly than not having replanning at all.
Yes, I don't think I can avoid it. I thought I'd double check for consistency. (The waymarks do appear in the itinerary, but I'll leave that as it is for now.) LiveRide works fine without me having to do anything, apart from the replan which crashes it at the moment because of the lack of waypoints :-)
Thanks!
OK, replan is working now. I'm back to the Circular route screen now to put in the distance. iPhone has 1-64km / 1-40 miles, but I'm finding it times out above 55km. Shall I keep it at 50km / 30 miles max?
Yes, in practice we’re not quite getting the right length and it invariably ends up more than it really should be. So I’d keep it not too long as you suggest.
Excited to see this in action soon, let me know when it’s in the beta channel!
Here's the Circular route screen with the Distance tab selected, depending whether you have km's or miles set in Preferences:
LiveRide - the last screenshot shows a replan after going off route:
This is in the emulator but I tried it for real on my phone as well.
Well done so far Hilary - very excited to see this coming together!
Let me know when it's in the Beta channel and I'll have a go :)
I saw a review saying this is available on iPhone: allow planning of a circular route from start point, entering number of miles you wish to cycle.