Forum
Buying gear? Please use these links to help 14ers.com:

More info...

Other ways to help...

Several "bugs" with GPX files

If you run into any problems using 14ers.com, please post a topic thread here.
User avatar
Posts: 1213
Joined: Wed Jun 16, 2010 2:33 pm
Location: Crestone, CO and/or Chapel Hill, NC

Several "bugs" with GPX files

Postby jdorje » Wed Sep 05, 2012 6:26 pm

Until recently, I knew almost nothing about the GPX format. And it's possible I'm wrong about some things, in which case I'd like to learn.

http://www.topografix.com/gpx.asp
http://www.topografix.com/GPX/1/1/gpx.xsd

But it appears to me that the 14ers.com GPX files are quite wrong in several ways.

1. Elevations. "For more information on GPX and this schema, visit http://www.topografix.com/gpx.asp GPX uses the following conventions: all coordinates are relative to the WGS84 datum. All measurements are in metric units." This is from the XSD file. You can see where I'm going with this: all of the 14ers.com GPX files (that I have looked at) use above-sea-level (aka geoidal or EGM2008/EGM96/EGM84 coordinates). This means an inaccuracy of something like 50 feet in all the elevations. As far as I can tell there is no correct way to set a GPX file to be above-sea-level coordinates; it all has to be WGS84 (gps/ellipsoidal) coordinates. Of course, most programs using a GPX file ignore the elevations.

2. Routes. The GPX files I have looked at do routes by adding 200 waypoints into the waypoint section of the file, numbered 001 to 200 and containing the route. This isn't all that hard to parse, and maybe this is what badly-written GPS programs are used to, but it seems quite incorrect technically. The exact same data should instead go into the routes (<rte>) section. Correctly written GPX parsers would interpret the current files as 200 different unrelated waypoints with names like "055".

3. Times. All the waypoint entries have timestamps, which seems harmless but unnecessary.

This link doesn't explain anything but does give examples: http://cycleseven.org/gps-waypoints-routes-and-tracks-the-difference .

The correct way, I think, would be to have two or more waypoint entries in each file (Trailhead, Summit, etc - preferably correctly named), and the actual route in the routes section. This doesn't seem too hard to fix by hand, though it might be easier to have a program to parse and output the new data. I guess the only downside would be if there are bad GPX parsers out there that don't read the routes section properly?
-Jason Dorje Short

Site Administrator
User avatar
Posts: 6612
Joined: Sun Jul 25, 2004 7:34 pm
Location: Breckenridge, CO

Re: Several "bugs" with GPX files

Postby BillMiddlebrook » Wed Sep 05, 2012 6:42 pm

jdorje wrote:But it appears to me that the 14ers.com GPX files are quite wrong in several ways.

They simply include a batch of waypoints which were auto generated from NatGeo TOPO! sofware using the "GPS Route" option and saved as a .GPX file. Someday, I'd like to write my own program to generate the GPX files real-time when they are requested so I can just keep a database of waypoint info for each route. Until then, I guess they will remain quite wrong. Feel free to blame NatGeo for the .GPX output layout.
Only SNOW will end the madness

User avatar
Posts: 277
Joined: Tue Nov 16, 2010 8:32 pm
Location: Peyton, CO

Re: Several "bugs" with GPX files

Postby Waggs » Wed Sep 05, 2012 7:03 pm

Don't know that I would call the GPX files "wrong". Bill beat me to the answer that what you are seeing is most likely artifacts of an/the export/import process.

It is in most cases though "good enough".

Edit: and as an after thought, if you change the format, I may not be able to import the file into my device. So you may also be witnessing a "lowest common denominator" situation.

Waggs
Gloves are optional. Mittens mandatory - S. Gladbach

User avatar
Posts: 1213
Joined: Wed Jun 16, 2010 2:33 pm
Location: Crestone, CO and/or Chapel Hill, NC

Re: Several "bugs" with GPX files

Postby jdorje » Wed Sep 05, 2012 7:18 pm

Waggs wrote:Edit: and as an after thought, if you change the format, I may not be able to import the file into my device. So you may also be witnessing a "lowest common denominator" situation


Indeed, that is a concern. Let me work up a way to convert them and see if they work. I wouldn't think devices would be the problem though - more likely crappy external programs would have the issue.

P.S. No disrespect was intended, Bill. I'm well aware you do your best to make your data as high-quality as possible.
-Jason Dorje Short

Posts: 3862
Joined: Wed Jul 02, 2008 8:56 pm

Re: Several "bugs" with GPX files

Postby tmathews » Wed Sep 05, 2012 7:28 pm

BillMiddlebrook wrote:
jdorje wrote:But it appears to me that the 14ers.com GPX files are quite wrong in several ways.

They simply include a batch of waypoints which were auto generated from NatGeo TOPO! sofware using the "GPS Route" option and saved as a .GPX file. Someday, I'd like to write my own program to generate the GPX files real-time when they are requested so I can just keep a database of waypoint info for each route. Until then, I guess they will remain quite wrong. Feel free to blame NatGeo for the .GPX output layout.


I've used your GPX points for nearly every route on this site, Bill. Most people won't notice these things. The files I have used have let me out of lost situations in winter and spring -- for which I am thankful.
Last edited by tmathews on Wed Sep 05, 2012 7:59 pm, edited 1 time in total.

User avatar
Posts: 277
Joined: Tue Nov 16, 2010 8:32 pm
Location: Peyton, CO

Re: Several "bugs" with GPX files

Postby Waggs » Wed Sep 05, 2012 7:35 pm

jdorje wrote:
Indeed, that is a concern. Let me work up a way to convert them and see if they work. I wouldn't think devices would be the problem though - more likely crappy external programs would have the issue.



Yeah, that's a truer statement than what I said. But the least/lowest common thing still applies.

Waggs
Gloves are optional. Mittens mandatory - S. Gladbach

User avatar
Posts: 1213
Joined: Wed Jun 16, 2010 2:33 pm
Location: Crestone, CO and/or Chapel Hill, NC

Re: Several "bugs" with GPX files

Postby jdorje » Wed Sep 05, 2012 9:40 pm

Logically I would think most devices would do better with the route being actually listed as a route, not a collection of points. I guess this is something I need to test out myself as well though. In writing parsing code it actually takes a fair amount of effort to interpret waypoints 1-200 as a series rather than an independent sequence.

http://www.qfpost.com/file/d?g=ML9o7c6Tn

^ this is a hand-converted GPX of the kit carson route (kitc2.gpx), with the 200 waypoints changed to routepoints in a single route. Not that hand-converting is the way to go, but it'd be nice to know if this works better or worse than the current format.

One other thing I noticed: the GPX files are all missing author and copyright information. Those should be pretty easy to add in, if you (Bill) care about em.

About the elevations, I'm even less sure how this can be solved. Any GPS program worth its salt would read those and display above-sea-level elevations that are 80 feet lower. But a GPS program not worth its salt would perform equally badly given WGS84 elevations. It's quite annoying that there is no way to set the coordinate type in the GPX file itself.
-Jason Dorje Short

User avatar
Posts: 105
Joined: Mon Aug 10, 2009 8:18 am
Location: Littleton, CO

Re: Several "bugs" with GPX files

Postby flintster » Wed Sep 05, 2012 10:58 pm

jdorje wrote:But it appears to me that the 14ers.com GPX files are quite wrong in several ways.


are you having an issue using the .gpx files as is? They load just fine into my Garmin Vista and Garmin 60CSX using Garmin Map Source. They also show up just fine on Google Earth.

Don't know if you work with XSDs much, but that one is wide open. Lots of optional elements, even a "plug in your own schema here" element. And what that means is zero standardization and zero consistency, everyone does it just a little different. But if Garmin and Google can read what you put together, you've hit the majority of the market. You're basically asking why 100,000 people do something different.

User avatar
Posts: 170
Joined: Wed Sep 29, 2010 12:52 pm

Re: Several "bugs" with GPX files

Postby Rarefied » Thu Sep 06, 2012 1:53 pm

Okay … ‘took a look into this. Naturally, just as Bill said the gpx files from his site are simply collections of waypoints. And as Terry pointed out, most users find that form to be useful as-is.

But I also saw what jdorje described – although I’ll reinforce that laying blame on Bill is unfair. [-X Some of the byproducts you noticed come from how MapSource converts the waypoints into a route. I’ll skip most of the boring technical details but will say the biggest annoyance I see (and what I think you were voicing) is that uploading the newly created route to your unit will also instantly add all the original waypoints (maybe hundreds!) to your existing waypoint list! :shock:

As jdorje went on to demonstrate, the file can be edited by hand to yield a clean, pure route for your GPS without adding a single new waypoint to your existing list at upload. Of course, hand-editing isn’t much fun and prone to error. But I can offer him (and anyone else so inclined) an idea on how to automate that process.

If my sense is right, jdorje, you have programming skills and could make use of that standard “household item”, Excel. Namely, through the use of Visual Basic which is part of Excel you could open a file downloaded from Bill’s site, loop through it line-by-line and have your code make any desired changes (mostly the tags), and then write each line out to a new file as it is processed. Conversion would take mere seconds per file. (Many other programming apps could do the same job – Excel just comes to mind because it is readily found on many PCs.) So there’s one suggestion for a way forward if you wish to pursue the matter.

R

Re: Several "bugs" with GPX files

Postby Bean » Thu Sep 06, 2012 2:35 pm

I never realized the power of using this with my forerunner as backup navigation until now. Unfortunately the format doesn't import to Garmin Training Center without errors. #-o
gdthomas wrote:Bean, you're an idiot.

http://throughpolarizedeyes.com

Site Administrator
User avatar
Posts: 6612
Joined: Sun Jul 25, 2004 7:34 pm
Location: Breckenridge, CO

Re: Several "bugs" with GPX files

Postby BillMiddlebrook » Thu Sep 06, 2012 3:14 pm

I started designing a process to automatically generate the route .GPX files and the following is a new file (Bierstadt, standard route) where the waypoints are part of an overall route.

Comments welcome as to whether or not this is more useful and more acceptable.

<file removed>
Only SNOW will end the madness

Re: Several "bugs" with GPX files

Postby Bean » Thu Sep 06, 2012 3:32 pm

That still doesn't import to GTC properly. I'm going to play around with a couple programs over the next day or two and see if I can come up with any conversions that work and will report back. MapSource might like it a bit better..

Edit: MapSource accepts that just fine. Hope to have this figured out in a day or two.
gdthomas wrote:Bean, you're an idiot.

http://throughpolarizedeyes.com

Next

Who is online

Users browsing this forum: No registered users and 3 guests