Not a valid Mapsource file etc ......

I tried to open a tracklog made on my 60Csx today and got the message "Not a valid Mapsource file" when trying to open it in Mapsource or "Unknown error opening import file" in Basecamp - I hardly ever get this with tracks form this unit.
All of the other tracks recorded on the unit work 100%, both before and after the day of this particular track.

Is there a way of finding out what the error is? Software solution?

I would greatly appreciate it if anyone could offer some assistance in saving / recovering this file, it was a hike I will probably not repeat but may want to share with others.
I would also like to learn how to fix this issue in future (if it is possible), this is not something that I have had to do before.
  • Former Member
    0 Former Member over 12 years ago
    Is there a way of finding out what the error is?

    You have an invalid (truncated or corrupted) GPX file. The only solution is to manually open and fix (as far as possible) the file. GPX files are just XML formatted so you can use any text editor to do this but it does require some expertise. I've done it quite a bit myself.
  • Thanks, your response got me started...

    I went to this site (googled it, which I suppose I should have done in the first place ...) http://www.validome.org/xml/validate/
    Sent the file, got the response

    LineFile name:20121028.gpx82534Column:2 Error:Content is not allowed in trailing section. Error Position:4255">

    Then I opened it in Notepad ++ and scrolled down to:

    </trkpt>
    <trkpt lat="-32.396490" lon="19.129860">
    <ele>1255.968</ele>
    <time>2012-10-28T10:46:04Z</time>
    </trkpt>
    </trkseg>
    </trk>
    </gpx>
    4255">
    <ele>125.774</ele>
    <time>2009-05-02T13:18:37Z</time>
    </trkpt>
    <trkpt lat="-34.350982" lon="18.484255">
    <ele>125.558</ele>
    <time>2009-05-02T13:18:38Z</time>
    </trkpt>

    Can I now just delete the bit that appears to be in the incorrect format and then save the file?
    If so in what format - Notepad ++ does not offer gpx as a format .....
  • Former Member
    0 Former Member over 12 years ago
    Well XML uses "tags" to encapsulate data. Each opening tag must have a corresponding closing tag. For example the top level starts with <gpx> so the file must have a </gpx> at the end.

    In your case, from what I can see, everything below the 4255"> is junk. That said there maybe data there that is recoverable.

    BTW keep a copy of the original file. Edit and test a copy.
  • Cool, thanks for the assistance.

    A few lines down the coordinates appear to be correct as does the date, but the timestamp is a few hours out.
    Here is some more ..... there is around 1.5 km of missing data. I did not stop hiking over this period.

    </trkpt>
    <trkpt lat="-32.396490" lon="19.129860">
    <ele>1255.968</ele>
    <time>2012-10-28T10:46:04Z</time>
    </trkpt>
    </trkseg>
    </trk>
    </gpx>
    4255">
    <ele>125.774</ele>
    <time>2009-05-02T13:18:37Z</time>
    </trkpt>
    <trkpt lat="-34.350982" lon="18.484255">
    <ele>125.558</ele>
    <time>2009-05-02T13:18:38Z</time>
    </trkpt>
    <trkpt lat="-32.404901" lon="19.142421">
    <ele>1027.040</ele>
    <time>2012-10-28T11:13:13Z</time>
    </trkpt>
    <trkpt lat="-32.404910" lon="19.142433">
    <ele>1027.196</ele>
    <time>2012-10-28T11:13:14Z</time>
    </trkpt>
    <trkpt lat="-32.404918" lon="19.142444">
    <ele>1027.035</ele>
    <time>2012-10-28T11:13:15Z</time>
    </trkpt>
    <trkpt lat="-32.404926" lon="19.142455">
    <ele>1027.117</ele>
    <time>2012-10-28T11:13:16Z</time>
    </trkpt>
    <trkpt lat="-32.404933" lon="19.142468">
    <ele>1026.790</ele>
    <time>2012-10-28T11:13:17Z</time>
    </trkpt>
    <trkpt lat="-32.404940" lon="19.142482">
    <ele>1026.481</ele>
    <time>2012-10-28T11:13:18Z</time>
    </trkpt>
  • Former Member
    0 Former Member over 12 years ago
    Well if you wish you can recover data, by manually (re)creating XML tags etc, creating multiple GPX files and importing the whole lot into MapSource/BaseCamp etc. In the case of tracks you can either preserve track segments that should be one or join them together and have straight line sections where data was lost. Doing this can be very tedious and time consuming. Up to you as to whether it's worth it or not.
  • As STUARTMW said work on a copy of the file, not on the original and this can be time consuming. It this is the only error, you can delete:

    </trkseg>
    </trk>
    </gpx>
    4255">
    <ele>125.774</ele>
    <time>2009-05-02T13:18:37Z</time>
    </trkpt>
    <trkpt lat="-34.350982" lon="18.484255">
    <ele>125.558</ele>
    <time>2009-05-02T13:18:38Z</time>
    </trkpt>

    and you should have a valid file. I prefer WordPad to NotePad. If it saves with a .txt extenstion, just change it to .gpx.
  • Former Member
    0 Former Member over 12 years ago
    I prefer WordPad to NotePad.

    I use a professional grade text editor (UltraEdit) which has built-in XML tools and that makes things a lot easier.
  • Many thanks, got it working now !!!
    Your help is very much appreciated.
    I finally have a bit of an understanding as to what a gpx file is composed of, so some education recieved as well !

    Fortunately that was the only error in the file so all is good now !

    Just wondering why the gps threw a wobbly in the first place ......
  • Former Member
    0 Former Member over 12 years ago
    Just wondering why the gps threw a wobbly in the first place ......

    All my units (76CSx, Oregon 450 and nuvi 1490T) have created corrupted GPX files at one time or another. It's annoying but I don't know of a solution. There's a better way to create tracks on the 1490T than the documented way and that seems very stable.