Author Topic: GPX editor / route planner wish lists?  (Read 64249 times)

Panoramix

  • .--. .- -. --- .-. .- -- .. -..-
  • Suus cuique crepitus bene olet
    • Some routes
Re: GPX editor / route planner wish lists?
« Reply #50 on: 22 September, 2012, 10:14:37 am »
So the 'cost' attached to roads would have to be directional.
Anyhoo, I suspect we're reinventing the wheel here ...

Yes, at the end, these are just 3 methods of adding "cost" to a route. And the costs are directional so you need a routing engine that can deal with this. The cost calculation is probably just a small part of the equation.
Chief cat entertainer.

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #51 on: 22 September, 2012, 11:30:06 am »

I wasn't suggesting to make it complicated, for the calories thing to be workable, you would have to keep it as simple as possible, the easier would probably be a hash table that for each gradient give a number of calories per km.
But as far as the algorithm is concerned this hash table is equivalent to equating x metres of climbing to y extra distance. It's still the same input variables, you're just expressing it in different units.
I'm saying anything more is, by definition, too complicated.

Quote
I suppose you really want to, you could also say twistiness coefficient = travelled distance / (Node A to Node B distance as the crow flies) and then make up an empirical coefficient to guesstimate the extra effort.

Not quite sure what you mean here.
If you know the actual distance travelled given the twistiness, then you just use that for the cost.
You appear to be suggesting that there should be a greater cost per km for a twisty road, but if you are then I don't agree at all for cycling. Possibly for driving, yes, but when cycling it has to be very twisty indeed or a long steep descent for my average speed to be lower purely because of the bends.

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #52 on: 22 September, 2012, 11:47:12 am »
I know absolutely nothing about the technology of using the Google data, but these "solutions" to the gradient effect seem overly complex.  Could one not just adjust the distance for the gradient, so a 10% slope was deemed to be 10% further (or 10% slower if you are using times rather than distances)?  Would you be prepared to go 10% further to avoid a 10% slope; an extra 500m to avoid a 5km climb?  It might need a multiplier, but probably not as a rough and ready solution.  And I presume you would ignore the "benefit" of the downs.


Naismith can be applied to cycling. It's not as good as for walking but:

X minutes per km

Add Y minutes per metre climb

Subtract Z minutes per metre descent

Then allow rider to set flat speed and weight and choose X, Y, Z based on these. Each edge of the graph has length and climb and descent. If edges only know about height at nodes, consider adding nodes at significant summits or troughs.

I can estimate my moving time on Audax events reasonably well using Naismith.

Yes, I think both boil down to the same formula effectively, just different ways of expressing it.
The formula for cost is still
C = kxX + kyY + kzZ

Where X, Y and Z are distance forward, height climbed, and height descended, respectively, and kx, ky and kz are constants.


So the 'cost' attached to roads would have to be directional.
Anyhoo, I suspect we're reinventing the wheel here ...

The cost would never be directional unless you were taking into account wind, which is deep into the realms of 'too complicated'. Like I say twistiness is relevant for cars but I doubt for cyclists. Now junctions, on the other hand, may be - and it may be certainly possible and not overcomplicated to add a cost element for traffic lights, for example.

I don't think there's a routing service that can display a shortest road route on a google map (and/or download a gpx - viamichelin can do shortest road route, but annoyingly, you can't download a gpx).
Google walking gives the shortest route, but can't be relied upon not to include non-roads /uncycleable paths.
Anyhow, I'm not even starting this yet until I've got the gpxeditor up and working...

dasmoth

  • Techno-optimist
Re: GPX editor / route planner wish lists?
« Reply #53 on: 22 September, 2012, 11:53:13 am »
The last few posts remind me of an idea I was pondering back when I was thinking about writing one of these.

Suppose you can get a reasonable number of users to upload track-logs of their rides.  Over time, you'll be able to build up an idea of the typical speed of each rider (and discard outliers: the club TT, teaching your nephew to ride, whatever...).  Once you get enough riders, you'll be able to pick segments of road that many people have ridden, and ask whether people tend to go faster or slower than their average over that segment.  If you make some allowance for average gradient, you'll get a "road quality" measurement that factors in twistiness, the kind of "undulating" that's hard to infer from digital elevation models, and even the type of road surface.

Sure, different people respond to these factors slightly differently, but I bet you could make useful generalizations, and ultimately feed them into plotting "nice cycling routes".

The challenge is to get enough tracks uploaded, and I never came up with a totally convincing explanation for how I was going to do that.  On the other hand, Strava manages to do nearly the same thing (I don't know what they're doing analytics-wise).  So it seems that if you ship a nice smartphone app, there are a reasonable number of people who don't mind having their tracks send back to the mother-ship.  Hmmm....
Half term's when the traffic becomes mysteriously less bad for a week.

Re: GPX editor / route planner wish lists?
« Reply #54 on: 22 September, 2012, 09:12:03 pm »
Why can't you just use the Strava data ?

dasmoth

  • Techno-optimist
Re: GPX editor / route planner wish lists?
« Reply #55 on: 22 September, 2012, 09:20:11 pm »
Why can't you just use the Strava data ?

I haven't actually tried it myself yet, but thought that -- at least publicly -- it just timed you over defined segments.  Perhaps they do more analytics internally?
Half term's when the traffic becomes mysteriously less bad for a week.

Panoramix

  • .--. .- -. --- .-. .- -- .. -..-
  • Suus cuique crepitus bene olet
    • Some routes
Re: GPX editor / route planner wish lists?
« Reply #56 on: 22 September, 2012, 09:29:03 pm »

I wasn't suggesting to make it complicated, for the calories thing to be workable, you would have to keep it as simple as possible, the easier would probably be a hash table that for each gradient give a number of calories per km.
But as far as the algorithm is concerned this hash table is equivalent to equating x metres of climbing to y extra distance. It's still the same input variables, you're just expressing it in different units.
I'm saying anything more is, by definition, too complicated.

Not necessarily because your formula make the assumption that the relation is linear. That might well be true for small gradients, on a steep downhill probably not (at some point you will get negative time to go from A to B!)

Quote
I suppose you really want to, you could also say twistiness coefficient = travelled distance / (Node A to Node B distance as the crow flies) and then make up an empirical coefficient to guesstimate the extra effort.

Not quite sure what you mean here.
If you know the actual distance travelled given the twistiness, then you just use that for the cost.
You appear to be suggesting that there should be a greater cost per km for a twisty road, but if you are then I don't agree at all for cycling. Possibly for driving, yes, but when cycling it has to be very twisty indeed or a long steep descent for my average speed to be lower purely because of the bends.

It has to be fairly twisty to slow you down but I am sure that I am slower on twisty lanes! You waste a lot of time and energy once you start braking or even freewheeling.


The cost would never be directional unless you were taking into account wind, which is deep into the realms of 'too complicated'. Like I say twistiness is relevant for cars but I doubt for cyclists. Now junctions, on the other hand, may be - and it may be certainly possible and not overcomplicated to add a cost element for traffic lights, for example.

The cost would have to be directional. If you go from Node A @ 500m altitude to node B @ 700m altitude A to B has to be more onerous than B to A.

Chief cat entertainer.

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #57 on: 22 September, 2012, 10:49:58 pm »
Not necessarily because your formula make the assumption that the relation is linear. That might well be true for small gradients, on a steep downhill probably not (at some point you will get negative time to go from A to B!)
Ok, true I suppose.
I was actually thinking it would be fairly accurate if you made it linear but only take into account climbing - treat descending as flat. Some people may be slow climbers but fast descenders, but the time you spend descending at optimum descent speed I would guess is probably a fairly small proportion of the ride in the UK at least - in the alps or pyrenees or such like though it may be a high enough proportion to be more significant.
Remember this is simply about making a decision between whether to go over a hill or round it. Given that you've gone up it, the fact that you're going to come down the other side again is a tautology.


Quote
The cost would have to be directional. If you go from Node A @ 500m altitude to node B @ 700m altitude A to B has to be more onerous than B to A.

OK, I see - you mean directionality simply in terms of A->B being different from B->A. That's always going to be the case anyway since the existence of one doesn't even imply the existence of the other. I thought you meant east/west etc. 

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #58 on: 22 September, 2012, 10:51:29 pm »
Why can't you just use the Strava data ?
Strava's API doesn't actually enable you to get "the" data, only "your" data. It would be nice if you could ask it for all segments within a certain bounding box, but you can't, you have to pass it a user id to get the rides for a particular person.

Re: GPX editor / route planner wish lists?
« Reply #59 on: 23 September, 2012, 08:52:36 am »
Why can't you just use the Strava data ?
Strava's API doesn't actually enable you to get "the" data, only "your" data. It would be nice if you could ask it for all segments within a certain bounding box, but you can't, you have to pass it a user id to get the rides for a particular person.

Using websites like http://raceshape.com/ you seem to be able to obtain segment data for lots of people.

Phil W

Re: GPX editor / route planner wish lists?
« Reply #60 on: 27 September, 2012, 12:03:08 am »
I like to see it on OS mapping - API is fairly straight forward (if you know the Google API) and works off lat / long as well.  I like to be able to use Google routing or Cyclestreets API for routing; and be able to change the choice of routing or indeed to turn it off as I click along the map. Both are again easy to use if you're familiar with the Google APIs. Because I'm using OS Mapping I'd be able to see contours on the route and want to be able to drag the route to a flatter option if so desired. I'd like it to calculate the positions for Audax controls by using the distance API of Google. I'd like to be able to select others routes based on distance i.e. 100km 200km and distance from a location I choose.  I'd like it to highlight known cafe's using Google's own data plus anything else added by others.  I'd like it to be touch enabled and work on a tablet or mobile phone.  I'd like it to be location aware and work with a phones GPS when out on a route.  I'd like to be able to choose the next point on the route by address, postcode, lat long, grid reference, or clicking on the map.



Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #61 on: 27 September, 2012, 10:50:05 am »
I like to see it on OS mapping - API is fairly straight forward (if you know the Google API) and works off lat / long as well.  I like to be able to use Google routing or Cyclestreets API for routing; and be able to change the choice of routing or indeed to turn it off as I click along the map.
i'm having a travel mode menu (car, bike, walk, or as crow flies) as the 'default' for the track/route but the ability to override for individual points via the right click menu, as I often want to do mainly car routing, but the odd section as crow flies where it doesn't think you can go but I know you can, for instance.

Quote
Both are again easy to use if you're familiar with the Google APIs. Because I'm using OS Mapping I'd be able to see contours on the route and want to be able to drag the route to a flatter option if so desired.
my site will not be using true google style dragging, as in with the white dot hovering over the line, such as you get by setting the 'draggable' option on the DirectionsRenderer  (I've tried it but it sort of messes up other things I want to do in a way that I can't quite remember) but it should be possible to implement it in a custom way on a per-segment or per-track basis, much in the same way as bikehike does. However I think I will make per-segment the default, rather than per-track, and make it very clear where it thinks the hardpoints are, rather than having to insert them manually (I've been tripped up by the way bikehike does it on a per-track basis by default, I once found myself unnecessarily using about a 20 mile stretch of the A556 near manchester when I could have been on rural cheshire lanes, and it was because I'd dragged the track and it had re-routed the whole track rather than just, as I'd intended, the last bit.)

Quote
I'd like it to calculate the positions for Audax controls by using the distance API of Google.

I'm going to have a 'create a route based on this track' and then you'll be able to do things like insert a route point x km along the track, so you know where the points and controls on the routesheet actually are on the ground.

Quote
I'd like to be able to select others routes based on distance i.e. 100km 200km and distance from a location I choose.
I would very much like to be able to do this, however I am in two minds as to whether to do it or not due to the (very slight) possibility of the legal issues cited as the reason bikehike doesn't do it any more. I'm sceptical as to how much of a risk it is however as lots of other websites like bikely, bikeroutetoaster, mapmyride, ridewithgps etc all seem to do it.

Quote
I'd like it to highlight known cafe's using Google's own data plus anything else added by others. 
Yep, definitely. It relies on people putting them in in the first place though so initially it might only have ones I've ever been to.

Quote
I'd like it to be touch enabled and work on a tablet or mobile phone. 
It'll probably work on a tablet ok but am not going down the route of optimizing it for mobile. Can't see people planning routes on phones as being a very high percentage of its usage.

Quote
I'd like it to be location aware and work with a phones GPS when out on a route.  I'd like to be able to choose the next point on the route by address, postcode, lat long, grid reference, or clicking on the map.

my site's going to be purely a gpx editor / route planning tool, not an actual navigation aid when actually out on a ride. MOst of the target audience (primarily me ;) , but also audaxers/tourists) probably use garmins/dedicated GPSs actually on their bike rather than phones.

It will however have location awareness in the sense that the place-search box will be like the one on google maps itself rather than on bikehike - as in, its results are tailored for where the map is zoomed to, and it also offers a drop-down of likely matches as you start to type.


Thanks for the suggestions. It's making progress but isn't up to saving and loading a track yet, so you can't do much with it yet so probably not much point people trying to play with it but when it can at least 'round-trip' I'll post the URL here, with a list of what features i've got planned next.

Phil W

Re: GPX editor / route planner wish lists?
« Reply #62 on: 07 October, 2012, 10:07:47 pm »
Quote
my site's going to be purely a gpx editor / route planning tool, not an actual navigation aid when actually out on a ride. MOst of the target audience (primarily me , but also audaxers/tourists) probably use garmins/dedicated GPSs actually on their bike rather than phones.
[unquote]

I mean that when on my PC it uses location to centre the map on where I am.  The search box is purely to choose the next point to plot my route, not to navigate. So I want the route to go from St Ives to Cambridge. I usethe search box to centre the map on cambridge and then click the point I wish to navigate to next

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #63 on: 07 October, 2012, 11:12:30 pm »
I mean that when on my PC it uses location to centre the map on where I am.  The search box is purely to choose the next point to plot my route, not to navigate. So I want the route to go from St Ives to Cambridge. I usethe search box to centre the map on cambridge and then click the point I wish to navigate to next

Not quite sure what you mean by "uses location to centre the map on where I am", but yes, it will do essentially what I think you're saying: there will be a search box that will enable you to search for a location which will then centre the map on that location, then you will be able to click on (or near) that location to plot the next route/track point.

If by "where I am" you mean will it automatically know where your computer (and thus your house) is geographically located and automatically center it there without you having to search for it, then it might not do that - I think it's just starting to become possible as browsers can be location-aware but how well it works and whether I'll bother with it as one of the first features I don't know. If you just mean 'will there be a search box' yes absolutely.

Made pretty good progress today. I can upload multiple tracks at once and save one individually or them all, and fixed quite a few bugs. Just got a few more known issues to iron out and also put some stuff in to enable routes as well as tracks (they're subtly different as they don't have segments) and then i'll start letting other people use it.

Phil W

Re: GPX editor / route planner wish lists?
« Reply #64 on: 10 October, 2012, 12:49:52 pm »
I works well Ben.

It is supported by all the latest versions of IE, Firefox and Safari. The code couldn't be simpler either.  Just make sure you're coding your HTML to HTML5 standards. The location stuff is a HTML5 standard.

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #65 on: 10 October, 2012, 12:58:02 pm »
I works well Ben.

It is supported by all the latest versions of IE, Firefox and Safari. The code couldn't be simpler either.  Just make sure you're coding your HTML to HTML5 standards. The location stuff is a HTML5 standard.
Yeah. When I went on your site on IE it asked me permission to track my location, and I allowed it, and it got it reasonably correct, but chrome didn't even ask me, but that may be because I've previously told it it's not allowed to.

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #66 on: 18 October, 2012, 12:28:10 am »
This is what i've got so far: www.gpxeditor.com.
Currently done:
Draw track.
Save track.
Load track.
Streetview.
Hover over shows distance.
Undo last.

To use it, it is all accessed via the right click menu.
So to start off right click anywhere on the map and choose 'Draw Track'.
You then have a route mode in the bottom right. You can also override the current route mode one-time-only by right clicking and choosing 'route to here ...' e.g. if you mainly want car mode but the odd bit down a cycle path.
If you stop drawing, you can then create another track, and can then save each individually or save all to the same gpx file.
Right clicking on each track gives you options for that particular track.

NB:
Save track produces a gpx that loads ok in mapsource or bikehike.
Load track: for now it's best to say that it probably doesn't handle gpx files that it didn't create itself very well. However it loads ones that it created ok. If you load multiple files sequentially (or draw a track then load), it should simply add the tracks in the new file to the 'workspace' rather than wiping out what's already there.

Next on the list of features I am thinking about:
Search box
Routes and waypoints
Reducing number of points on a track
Split and join segments
Show profile of segment or whole track
Reroute segment
Send track to garmin
+ anything anybody suggests that I agree with

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: GPX editor / route planner wish lists?
« Reply #67 on: 18 October, 2012, 10:30:11 am »
The mode change is very smooth.  And the multiple tracks ability is unusual, and useful.
And the ability to drop in and out of Streetview without losing track (as it were).

Pretty good!
when you're dead you're done, so let the good times roll

Re: GPX editor / route planner wish lists?
« Reply #68 on: 18 October, 2012, 11:07:15 am »
The one thing I noticed (on very brief test) is that it produces a large number of trackpoints per km -much more than say bikehike.

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #69 on: 18 October, 2012, 12:15:31 pm »
The one thing I noticed (on very brief test) is that it produces a large number of trackpoints per km -much more than say bikehike.
yes, it does. It can be reduced by using the 'overview path' but that might reduce it too much. It shouldn't matter when the reduction facility is in there as you'll be able to reduce them down to what you want.

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: GPX editor / route planner wish lists?
« Reply #70 on: 18 October, 2012, 01:55:47 pm »
And (I'm sure there's a very good reason!) it seems to be writing lat/lon co-ords to 15 decimal places, with 10 of those being just low-level jitter.  5 places is sufficient, of course, 15 would tend to bloat the GPX file size a bit.
when you're dead you're done, so let the good times roll

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #71 on: 18 October, 2012, 02:47:43 pm »
And (I'm sure there's a very good reason!) it seems to be writing lat/lon co-ords to 15 decimal places, with 10 of those being just low-level jitter.  5 places is sufficient, of course, 15 would tend to bloat the GPX file size a bit.
ah yes, cheers, that's easy to sort

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #72 on: 23 October, 2012, 01:39:49 pm »
Update: put the point reduction on: HOWEVER there is a bug in it when the track has multiple segments (an intermediate 'clicked' point that you use to force it to go a certain way, will generate a new segment)
If it looks ok, it will be - however it might create gaps in the track... this is fixable however and I should be able to do it tomorrow

As an interim I have used the 'overview_path' rather than the full path so it doesn't generate a huge amounts of points in the first place, although it will probably be over 500 for a 200km, although a 200km will almost certainly now come under the 10k limit of a new etrex.

Have also lopped the decimals off to 4 d.p.

Should be able to at least start, hopefully finish, fixing the reduction to work with multi-segment tracks tomorrow...

Next on the cards is a 'segment view' where you'll be able to see what segments a track is made up of - and then join and split them for analysis and/or rerouting.

Toady

Re: GPX editor / route planner wish lists?
« Reply #73 on: 23 October, 2012, 02:40:43 pm »
Warning: The following post may make you bang your head on the wall a bit.  I've only just "got it".

I had a little play with the previous version, and now I understand what you are doing.  THe lightbulb came on.  THis is the creation of a track (rather than a route) for downloading to the GPSr.  The GPSr will then navigate along the track.

The way I use my Garmin at present is to generate a route, and let the GPSr navigate point to point.  In that case I'm relying on the routing algorithm in the GPSr.  In the case of your web service the algorithm is on the web, and the route is already calculated when you download the track. 

Am I right?

So - my question is: how does the GPSr behave when navigating a track?  Can it actually tell that you have a left turn coming up (and beep you a warning) or is it up to you to keep the location triangle over the track?

Euan Uzami

Re: GPX editor / route planner wish lists?
« Reply #74 on: 23 October, 2012, 03:25:01 pm »
Warning: The following post may make you bang your head on the wall a bit.  I've only just "got it".

I had a little play with the previous version, and now I understand what you are doing.  THe lightbulb came on.  THis is the creation of a track (rather than a route) for downloading to the GPSr.  The GPSr will then navigate along the track.

The way I use my Garmin at present is to generate a route, and let the GPSr navigate point to point.  In that case I'm relying on the routing algorithm in the GPSr.  In the case of your web service the algorithm is on the web, and the route is already calculated when you download the track. 

Am I right?

You're right, yes.
A "track" is basically just a pre-defined line that shows up on the GPS unit. It doesn't DO anything with  it, it just shows the line that you give it.
This is the way I prefer to navigate, as I'm not relying on the GPS unit's routing algorithm, this is because when I have planned a route, I normally decide exactly what roads I want to go down in advance and I can't really be sure the unit's routing is going to choose the same ones.

So - my question is: how does the GPSr behave when navigating a track?  Can it actually tell that you have a left turn coming up (and beep you a warning) or is it up to you to keep the location triangle over the track?


It doesn't "do" anything, other than just draws it as a line on the map, like an overlay. You have to look at it every so often to know of upcoming turns but I find I do anyway - and I find I can't always guarantee that I'll hear the beep.
An etrex 20/30 (new etrex) apparently can actually "navigate a track", but this is an alien concept to me and one that I haven't really bothered investigating.


My site will eventually (probably fairly soon) have the capability to create a route, as well as a track. You won't be restricted to using 'as-the-crow-flies', but it will be my recommendation that you do, in order to keep the routepoints sparse. Otherwise you can end up with a proliferation of flags obscuring road features, and the unit beeping every 10 seconds.

In contrast to the Schrodinger-like behaviour of bikehike, which only decides whether it's a route or a track when you download it, mine will distinguish between routes and tracks - routes will probably show up red or something. The reason I'm doing it like this is I want it to be as much of a WYSIWYG-editor as possible - what you've got on screen is as close as possible a representation of what you've actually got in a GPX file.