Menu

#12 gpx 1.1 export

open
nobody
None
5
2011-04-22
2011-04-22
No

ATM viking exports gpx version 1.0. I don't think there much changes. But enough that gpx exported from viking doesn't work with https://connect.garmin.com/.

Discussion

  • Bor Kraljič

    Bor Kraljič - 2011-04-22

    Forgot to post link to gpx specification and other information http://www.topografix.com/gpx.asp

     
  • Guilhem BONNEFILLE

    Can you give us more details? Is there any error reported?
    Perhaps can you share the exported GPX file? Perhaps is it wrong.

     
  • Bor Kraljič

    Bor Kraljič - 2011-04-26

    The files are here: http://www.pyrobor.si/temp/index.php?dir=gpx_problem .Anyway http://connect.garmin.com doesn't give any real feedback. Just that upload of the file filed. I played around with headers and seems that connect.garmin.com only checks the xmln in header and expects it to be "http://www.topografix.com/GPX/1/1" if it is "http://www.topografix.com/GPX/1/0" (like viking exports is) it rejects the file.

    PS: I also noticed that export has much more decimals than original. Not sure why. (this doesn't affect the upload. So it is completely different thing.)
    - <trkpt lat="46.0317278" lon="14.5169091">
    - <ele>298.6267090</ele>
    + <trkpt lat="46.031727799999999" lon="14.516909099999999">
    + <ele>298.62670900000001</ele>

     
  • Rob Norris

    Rob Norris - 2011-05-01

    Note that Viking simply uses GPSBabel's default (which is gpx 1.0).

    http://www.gpsbabel.org/htmldoc-1.4.2/fmt_gpx.html

    If you can / want to compile Viking, change the code - file.c line ~442
    from
    args[i++] = "gpx";
    to
    args[i++] = "gpx gpxver 1.1";

    And/or ask Garmin why they don't accept GPX vers 1.0. [It's doesn't seem to be mentioned on their website, however probably none of their devices generate 1.0 only 1.1]

    I may decide to make the change Viking, as there shouldn't be any drawbacks, although maybe it would be better to set the GPX export version in the preferences (and then default to 1.1).

     
  • Rob Norris

    Rob Norris - 2011-05-02

    Oops, I was wrong - GPS Babel is mostly used internally by Viking so the GPX version here shouldn't matter too much.

    In fact for exporting GPX files it's in the file gpx.c - function gpx_write_header, around lines 791-798.

    Here one can change the text as appropriate.

    NB for GPSbabel method it would probably need to have a comma in it too:
    args[i++] = "gpx,gpxver 1.1";

     
  • Bor Kraljič

    Bor Kraljič - 2011-05-02

    You are right. I searched for 'args[i++] = "gpx";' and found it in the babel.c but changing it to 'args[i++] = "gpx gpxver 1.1";' or 'args[i++] = "gpx,gpxver 1.1";' didn't made any difference.

    I could manually fix header in gpx.c but that doesn't feels right. Maybe the right way would be to add GPSbabel as dependency and than use that to export to all the format GPSbabel. But that would probably require a lot of coding. (And i don't how to do that)

    Anyway it is not that mayor problem now that I now what I have to edit at exported .gpx. I will manually fix when I will need it.

     
  • Guilhem BONNEFILLE

    IMHO, the most simple and convenient solution would be to offer the ability to select 1.0 or 1.1 in the "export" process. I'm thinking about a dialog or an option in the "save as" dialog. The idea is to copy a standard metaphor (see Gimp and many other program).

    Furthermore, I think we have to take a look at the differences between 1.0 and 1.1: there is certainly some differences and perhaps our writing code should be adapted.

     

Log in to post a comment.

MongoDB Logo MongoDB