Author Topic: Reducing number of points in a GPX route  (Read 12158 times)

Reducing number of points in a GPX route
« on: 06 February, 2014, 01:57:47 pm »
I'm going to use my old garmin etrex legend for the first time on the Radway audax later this month.

The legend can only store 125 points per route and I have been trying reduce the number of points in the GPX files supplied but with little success using gpsies.com.

Well, I have been successful in reducing the number of points, just not in maintaining an adequate resolution that the route is still sensible and mostly follows the path of the road, T junctions stay as T-junctions etc.

The other options I am currently considering are:

* Split the audax into multiple routes
* Re-plot the route manually (not sure what tool would be best for that though)

Can anyone offer advice on what the best way to reduce the number of track points would be?
Up the hills and round the bends

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Reducing number of points in a GPX route
« Reply #1 on: 06 February, 2014, 02:41:16 pm »
Can anyone offer advice on what the best way to reduce the number of track points would be?

Ah well, none of that made much sense until the last line, because you were talking 'route' which is a bit confusin'.  A Route (my uppercase) with 125 points will take you a very long way, even in laney areas - I would suggest at least 100km.

[edit] - I've had a look at the file.  So it's the provider of the file who is doing the confusing here, not you - sorry!
The file is already split into 2 - 'out' and 'back' - which is generally good.  However just looking at the 'out' half, what has been provided is a Route of 939 pointsTrust me, this will not work on ANY GPS. 

My suggestion would be - upload this GPX to BikHike, and download it again as a Track downsampled to 500 points.  (I'm assuming 500 is the Track point limit on your GPS - check the specs, it may only be 250).  Downsampling is managed in a separate dialog under 'Options'.  Be sure to rename it ('course title') before you download.
Repeat for the 2nd file. naming it differently of course.
[end of edit - the remainder was written before I took a look at the provided file]

Even so, I would suggest you try re-plotting manually.  It really doesn't take long.  Try using BikeHike.  On the mapping page, start by UNticking the 'Follow Road' tickbox.  You can now just click round the map from turn (ie at a junction) to turn. 
When done, pick 'Save Route' and choose the option 'GPX Route' and change the 'course title' from the default offering.  Save as a GPX file.
If you're doing it in 2 halves, repeat for the second half, being sure to name the 'course title' differently, and of course save to a different GPX file.

These will give 'direct' turn by turn routes on the GPS.  The line will of course depart from the road in between turns, but I don't see that as a problem really. If you can, have the 'distance to next' data field always visible.  Reload to the 2nd Route at lunchtime. 

If you want a line that hugs the roads, then do as I suggest in the [edited] section above. 
I think you should be able to display all the Tracks at once on your GPS, so that 2, 3 or 4 Tracks can look just like one continuous line.   But without colour it won't be very clear, IMHO.  I think the Route(s) is a better option.
when you're dead you're done, so let the good times roll

Re: Reducing number of points in a GPX route
« Reply #2 on: 06 February, 2014, 02:56:27 pm »
I'm still getting used to the terminology, apologies for the confusion!  Is a track what the gps would create as the path you have taken and a route a path that you would create to follow?

I think the plotting manually option is a good one, I like the idea of only needing to pay attention when you see '200m to next point'.  I will try that and see how I get on.  Having out and back routes also sounds a good idea, I will do that too.

Many thanks for your input, most helpful!
Up the hills and round the bends

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Reducing number of points in a GPX route
« Reply #3 on: 06 February, 2014, 03:01:47 pm »
I'm still getting used to the terminology, apologies for the confusion!  Is a track what the gps would create as the path you have taken and a route a path that you would create to follow?

It is, but the various online Planners have contributed to the confusion because they offer the option to 'plan' a Track.
And as it happens a lot of people have come to like the 'planned Track' option - mainly because it is relatively trouble-free and simple to use.

I hope you see my edited insert in my first reply - the whole problem really starts because the file you have acquired is not really fit for purpose.  (ie, it's unusable as is, and needs work, regardless of what model of GPS you run.)
when you're dead you're done, so let the good times roll

PaulF

  • "World's Scariest Barman"
  • It's only impossible if you stop to think about it
Re: Reducing number of points in a GPX route
« Reply #4 on: 06 February, 2014, 03:05:21 pm »
A track is what the gps would produce and basically records your position every few seconds. A route is a list of points that join up to follow the route.

The method I use for creating routes (which I picked up from here so can't claim as my own :-) ) is to make a route by putting each route point on the track after the junction, ignoring any twists and turns in the road. This gives a countdown to the junction (more or less) and as you approach the junction the arrow swings to point in the direction you need to turn.

T42

  • Apprentice geezer
Re: Reducing number of points in a GPX route
« Reply #5 on: 06 February, 2014, 04:07:25 pm »
To my feeble understanding, a route is a set of relatively far apart points you want to travel through, and the device finds its own way between them.  A track is a set of much more closely spaced points which will be displayed as a line on the device without any calculation.

You can record a track and export it in the form of a GPX file, or you can create a track using a routing program and load it into the device.

An extreme example of a route would be one point at John O'Groats and the other at Land's End, and get on with it Mr. Garmin.  An extreme example of a track would be the same journey with a point every 20 metres.

ETA in my experience, the total distance given for a track is a few percent less than the true total distance as measured by an accurate cycle computer.  The computer measures distance directly like a surveyor's wheel, whereas the GPS sums all the straight lines between the track points.  I have had a 30-km difference over a 1000-km ride.
I've dusted off all those old bottles and set them up straight

Re: Reducing number of points in a GPX route
« Reply #6 on: 06 February, 2014, 08:47:11 pm »
Jhob  don't worry the confusion is contagious in regards to the nomenclature (naming conventions) in GPS routing and track making:)

Question for Frances

Here is a 'route' from Richards excellent 'route' planner http://cycle.travel/



Here is the 'route' shown as a track in basecamp

 

Questions

 what the points on the track (where I have marked them red) are these 'track points'?


Are the points on a route 'waypoints' if so the fog is beginning to lift?

T42

  • Apprentice geezer
Re: Reducing number of points in a GPX route
« Reply #7 on: 06 February, 2014, 09:20:24 pm »
^^^ All the wee white ones embedded in the blue trace are track points.  The blobs at the beginning and end points ware waypoints. You can usually attach comments to them.

If you wanted the track to pass through, say, Alfreton, you would plonk another waypoint on it and restart track calculation.
I've dusted off all those old bottles and set them up straight

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Reducing number of points in a GPX route
« Reply #8 on: 07 February, 2014, 11:03:46 am »
Well a Route is an ordered list of Routepoints and a Track is an ordered list of Trackpoints, and that's about the top and bottom of it really.  (Or it was until Garmin introduced Courses, which is probably what the majority of cyclists now actually use even if unwittingly.  And these obviously are just an ordered list of Coursepoints.)

Confusion arises because we all refer to 'routes' as a generic term for the roads we plan to cycle on.
And thus the otherwise excellent BikeHike planner only offers the option to 'Save Route' - even though in actual fact if you do save out as a Route what you usually get is unusable rubbish (as in the file linked in the OP, which according to the headers was generated by BikeHike) whereas it does do you a perfectly good Track or Course.  If you have enough knowledge to choose the right options.

A GPS puts some work into processing a Route - which is why some of us have the perception that the Route is 'calculated' between points - most modern Garmins/maps have that ability.  But even ones that don't, or if (like me) you choose to turn that functionality off so you just get straight lines from point to point - will still generate instructions at each point and bleep to warn you a turn is coming up.  A Route on a GPS is thus more or less like a paper routesheet - but more convenient and works in the dark and it doesn't go soggy in the rain.
It's because there is processing going on, that the number of points a Route can have is rather limited.

By contrast a GPS 'traditionally' doesn't do anything with a Track - other than display it, along with a pointer showing 'you are here'.  You can follow the Track or not - if you choose to leave it, the GPS won't complain.  So a Track is more or less like a map that's been gone over with a highlighter pen - that scrolls with you wherever you go and works in the dark and doesn't go soggy in the rain.
Because there's no work going on, GPSs can display several Tracks at the same time, which can sometimes be very useful, if you want to make choices during the day.

Modern GPSs with more processing power have blurred the boundaries to a large extent, Routes tend to look a lot like Tracks and Tracks can generate some Route-like prompts.  And Courses on a modern Edge are basically Tracks that the GPS can follow in a Route-like way.
when you're dead you're done, so let the good times roll

Re: Reducing number of points in a GPX route
« Reply #9 on: 07 February, 2014, 11:26:16 am »
f**k me this is a lot more complicated than I thought!

Anyway what I have now done, taking advice from here, is create a downsampled to < 500 points track in bikehike and uploaded this as a track to the etrex legend. 

The legend has a 'trackback' mode where you can follow this track. 

I think I will have the gps set to show the map at all times and just 'follow the line'.  I will play with the detail options until I come up with a good balance between map features and clarity.

I did think about plotting my own track with points only at (or just after) junctions.  However I think I need to see how it works for me in practice before going to that level.  Actually would someone be able to send me a gps track plotted in this way so I can see in practical terms how one would best lay this out?  This is quite an attractive option.

I will ignore routes for now.  It seems to me that routes rely on some sort of processing by the GPS, processing I don't fully understand nor trust so best left alone.

Keeping things as simple as possible, especially with something new, usually provides the best chance of success.

Thanks again for all the great & illuminating advice.  It has been a massive help.
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #10 on: 08 February, 2014, 07:13:09 am »
Now you've got a Track of <500 points from BikeHike, it might be worth converting it to a GPX and importing it to Tyre toTravel.
Then you will be able to see the position of ALL the points.

Chances are there might be some of the <500 which are misplaced off your intended route and need shifting back onto the desired route so your Garmin doesn't take you for a 'trip round the houses' in search of a stray point which is on the other side of a fence somewhere.

Tips.
Always use GPXs. They are Global Position eXchange files and are the internationally recognised format for GPS systems.
Learn how they work so you will be able to talk to owners of GPS units of ANY manufacturer.

If you only know Garmin 'Tracks', you will only be able to speak Garminese.

A GPS system that cannot handle a GPX is not worth buying ( which happens to include most motorcar application units  ;) ), and GPS manufacturers who concoct their own file types SHOULD supply firmware onboard to convert to-and-fro.

An internet mapping package that cannot Import / Export or Load / Save a GPX should be ignored.
An internet mapping package that does not display the position of every point on a GPX is dubious.
An internet mapping package that gives the opportunity to create / move / delete points is preferred.

Re: Reducing number of points in a GPX route
« Reply #11 on: 08 February, 2014, 08:34:16 am »
I did check the track and the points were pretty good really. I will take a look at that tyre to travel, sounds useful. Knowing the right tool to use is often half the battle!

I've found easy GPS good for transferring tracks to the legend.
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #12 on: 08 February, 2014, 01:15:14 pm »
Currently in the process of making a reduced trackpoints version of the route with markers set just after junctions in TyreToTravel.  I will take both with me on the audax and see which method I prefer.

Tyre to Travel has a lot of nice features, it is a little annoyingly sluggish though and your flow interrupted by too many popups (confirm this action, name this point etc....)
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #13 on: 08 February, 2014, 11:05:46 pm »
If I do want a route/track with only points at or just after junctions would I want that as a route or a track?  I'm thinking route so I get the distance countdown to next point. It's that right?
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #14 on: 09 February, 2014, 08:13:08 am »
If I do want a route/track with only points at or just after junctions would I want that as a route or a track?  I'm thinking route so I get the distance countdown to next point. It's that right?

IIRC, The unit displays the entire trip length by adding up the lengths of the straight lines between points. This is why in the old days, we put as many points on the route as possible to get the distance closer to reality. The unit tots up the straight lines because the unit does not Autoroute.

I cannot remember how 'time to next point' is calculated. Its probably based on a straight line from present position to the next point using Great Circle Nav and a Firmware Speed constant. I don't think its based on 'average speed'. It could be??? I'm not sure.





Re: Reducing number of points in a GPX route
« Reply #15 on: 09 February, 2014, 08:16:55 am »
It's more when I get down to 100m before a junction, not really worried about the distance before then. Is a route or a track better for this?
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #16 on: 09 February, 2014, 09:12:38 am »
After experimenting with the Etrex 20 routing between hopefully cleverly placed points for a while I also now generally use direct lines between points as recommended by Frankie. Far less hassle and the "distance to next point" thing generally allows you to relax for a fair while even if the road is weaving this way and that, you are passing possible turn-offs, and the "line" is no longer visible on the screen. As long as you are getting closer to that point, which could be some fair distance, generally no need to worry. And as you get closer the line reappears.

I put the points ON the junction and just ensure that the coloured line to the next point then points clearly the way to go - so this sometimes means I put a quasi shaping point some distance after the junction as well if the line direction to the next point wouldn't otherwise be clear.

I used to put them some short distance AFTER the point/junction but found that putting them ON the junction worked better whenever I reversed the route. If the junction is on the crest of a hill I also like to know exactly how many more metres  have to struggle for.   

Re: Reducing number of points in a GPX route
« Reply #17 on: 09 February, 2014, 10:08:21 am »
I starting to think that would be the best way to go, although with points after junction, I'm unlikely to reverse most routes.

So fhills, do you create that as a route or track?
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #18 on: 09 February, 2014, 10:13:41 am »


So fhills, do you create that as a route or track?

After having the thing for ages I remain somewhat puzzled by routes and tracks.

I have stumbled on maybe an odd way of doing things.

It's slightly complicated.

When I have a mo I'll try to tap it all in here.

Frankie* will maybe tell me I'm mad/making it all too complicated.


* His guide heartily recommended to anyone trying to get to grips with the Etrexs.

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Reducing number of points in a GPX route
« Reply #19 on: 09 February, 2014, 11:05:14 am »
So fhills, do you create that as a route or track?

On your unit, I'd do it as a Route, in order to get proper 'distance to next' (which would be crow-flies distance of course, but that doesn't really matter).
Also get the habit of using as few points as possible - you really don't need to 'shape ' the route in between junctions and doing so throws a spanner in the 'distance to next' works.  The fewer the points, the better (within reason).  I certainly wouldn't expect to use more than 1 point per km overall on average - and in remoter areas like mid-Wales this can easily go out to 1 per 4 or 5km on average - so 125 points can get you a long way.

See also Waypoint naming though this is a bit problematic using most online planners, but can work well with desktop software.  So that you see not only 'distance to next' but also a hint as to what the instruction at next will be.
when you're dead you're done, so let the good times roll

Re: Reducing number of points in a GPX route
« Reply #20 on: 09 February, 2014, 11:49:35 am »
Quote
I did think about plotting my own track with points only at (or just afterbefore!) junctions.  However I think I need to see how it works for me in practice before going to that level.  Actually would someone be able to send me a gps track plotted in this way so I can see in practical terms how one would best lay this out?  This is quite an attractive option.

I used  a  old garmin edge  - You  get 100 points.
Yes waypoints only  at the  turns and  allow  the route  to  rubber-band  from them. I occasionally  put  another waypoint in after a  turn  to make the  direction from it sensible.
Works  very  well, and  the GPS  bleeps  at  me with information such as 'turn left Sp xx'  which I have  added  to the waypoint .
I use  MS  auto-route for  the  planning* and  GPS babel  to  process  - I think way point naming could  be  done  with  bike-hike ..work in OS Map off road mode to get  straight  lines
* Yes desktop, not  free, useful for giving the route distance though.   

Re: Reducing number of points in a GPX route
« Reply #21 on: 09 February, 2014, 12:00:58 pm »
Easy  in bike-hike, adds  course-points with  instructions -You do know  you  can edit GPX files?
Quote

  </metadata>
  <wpt lat="54.542032" lon="-1.923403">
    <ele>0</ele>
    <name>Right Turn</name>
    <sym>Waypoint</sym>
    <type>Right</type>
 

frankly frankie

  • I kid you not
    • Fuchsiaphile
Re: Reducing number of points in a GPX route
« Reply #22 on: 09 February, 2014, 12:09:23 pm »
I think the problem with the BikeHike 'add Coursepoint' feature (the added points download as Waypoints in a GPX file) is that the added points are not integral with the Route.  Older GPSs would simply count down to the next Routepoint (which is not named) and not the co-incident named Waypoint.

On newer cleverer GPSs, if BikeHike is your planner of choice, a Track GPX (points not downsampled) with added (named) Coursepoints, works rather well.

(By 'new' GPS I mean any Garmin model introduced since mid-2008 which was when the Oregon first appeared.  Most subsequent models have a very similar UI and feature set.)
when you're dead you're done, so let the good times roll

Re: Reducing number of points in a GPX route
« Reply #23 on: 09 February, 2014, 12:49:53 pm »
You know what, I think I'm finally beginning to get it!

I have decided I'm going to use routes with waypoints (correct terminology?) at junctions and then name the waypoints to give the navigation instruction. 

A little labour intensive up-front but I can see the benefits in being able to enjoy the ride - you only need to concentrate on directions when 'dist to waypoint' gets small.  The rest of time you can let your mind be elsewhere.

Is there any software/website where you can see a track/route that follows the roads and then as a separate layer you can plot a separate route with waypoints just at the junctions?
Up the hills and round the bends

Re: Reducing number of points in a GPX route
« Reply #24 on: 09 February, 2014, 12:50:49 pm »
Easy  in bike-hike, adds  course-points with  instructions -You do know  you  can edit GPX files?
Quote

  </metadata>
  <wpt lat="54.542032" lon="-1.923403">
    <ele>0</ele>
    <name>Right Turn</name>
    <sym>Waypoint</sym>
    <type>Right</type>
 

Yes I have done a bit of manual tinkering in the XML, being a web developer, this is second nature for me!
Up the hills and round the bends