Note
A friend asked for help putting a gpx file onto a Garmin. I said, "Sure, no problem." Here are some notes from the "Sure, no problem" task, which ended up taking about four hours.
I loaded the ...v2-4.gpx and it wasn't recognized by my Garmin Oregon 600. I did literally everything I could think of to get it to load. This is what worked:
After every "easy" method I could think of, I resigned myself to this: I opened the gpx file in Notepad and compared it to a gpx that worked.
The gps that worked had this progression of xml tags, with a ton of extraneous metadata and URLs that can probably be deleted without worry. This is what I recognize as a "normal looking gpx file". The notes in parentheses here are not in the gpx file:
<gpx> (start of gpx)
<trk> (start of track)
<trkseg> (start of track segment)
<trkpt lat="34.919202" lon="-83.168527"><ele>482.000000</ele>
(start of track point, one of about 8000 points in the file)
Next, there is a series of "end tags" with a /, like this:
</trkpt> (Each of the ~8000 points has a <trkpt lat= long=><ele></ele> and then the end tag </trkpt>
At the end is:
</trkseg> (This gpx has only one track segment. Some gpx's have a lot---I think each segment shows up on the gpx as a different track, but I'm not certain.)
</trk> (end of track)
</gpx> (end of gpx)
The file I received originally didn't have "trk" points. It had "rte" points, which I think are "route" definitions. When I loaded it on my Garmin as a route, it was non-responsive for about ten minutes. On old old Garmins, you could have routes with about 20 points. This one has about 8000. I've never seen a gpx file with "rte" tags. Like this:
<gpx>
<rte>
<rtept lat="34.919202" lon="-83.168527"> <time>2015-04-23T01:47:46Z</time> (route point)
(note no <rteseg>: I'm not sure if a trk gpx needs even a single <trkseg>. I added it, but I'm not sure I needed it.)
(Also, note this has a time, and no elevation.)
Then it has the closing tags.
</rtept>
</rte>
<gpx>
So first, I used "replace" in notepad to replace:
<rte with <trk and
</rte with </trk
This fixes every start and end tag in the entire file. It took a blink of an eye for all ~8000 points.
I loaded that to the Garmin and...it didn't work. It did load to Topofusion, though.
In Topofusion, you can right-click the file and select "properties". This lets you look at the entire list of points and other things. In the left-most tab, there are three buttons. I used one of them to strip out <time><heart rate>and <cadence> tags. Since the gpx had only <time>, it just removed that.
That gpx would not load on the Garmin.
So I used another button in the "Properties" dialog box to add elevation tags from Topofusion's DEM (Digital Elevation Model). When I loaded that file, it worked! The Garmin recognized it.
Also, I noticed through this process that the xml tags in the gpx have a <name="XXXX 2015"></name> tag set, usually after the <trk> or <trkseg> tag and before the first <trkpt> tag. I changed the name in the attached file (_rev3) to be "XXXX 2015 trk" (or maybe XXXX_2015_trk).Anyway, that's how you get the Garmin to display a name for the file other than "Track" or the date/time filename the Garmin creates. Also, if you have several <trkseg> tags, they seem to be numbered and have multiple <name> tags to name the individual track segments.
I recommend Topofusion. I paid $60 for the Pro license, but the free version works pretty well for GPX manipulations like this, if my memory serves me right.
When I met my friend and loaded the new gpx file onto the Garmin, it was like putting a file on the thumbdrive. Zero drama. It rebooted, and the track was there.