Formatting of GPX for OpenStreetMap

mlasslomlasslo Global Mapper UserPosts: 11Trusted User
edited June 2010 in Suggestion Box
I have been trying to export a GPX file that I can upload to OpenStreetMap, but the format that is exported from Global Mapper is missing a key field. Global Mapper exports the GPX without the <time> tag. I tested this by bringing in a GPX file that had the <time> tag from DNR Garmin (it worked in OpenStreetMap) and exporting a GPX out of Global Mapper. Also the </trk> tag needs a <trk> added right after it. One more thing that stops it from working is the "/" in the </gpx> tag needs to be taken out. Here is a sample code that I exported out of Global Mapper that does not work:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<gpx
version="1.1"
creator="Global Mapper - http://www.globalmapper.com";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns="http://www.topografix.com/GPX/1/1";
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">;
<metadata>
</metadata>
<trk>
<name>25-JUN-10</name>
<desc>Tracklog</desc>
<trkseg>
<trkpt lat="39.598417" lon="-110.808921">
</trkpt>
</trkseg>
</trk>
<extensions>
</extensions>
</gpx>

Here is a sample code that works that was exported out of Global Mapper and edited:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<gpx
version="1.1"
creator="Global Mapper - http://www.globalmapper.com";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns="http://www.topografix.com/GPX/1/1";
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">;
<trk>
<trkseg>
<trkpt lat="39.617951" lon="-110.790293">
<time>1989-12-30T23:59:59Z</time>
</trkpt>
</trkseg>
</trk><trk>
<gpx>

Comments

  • mlasslomlasslo Global Mapper User Posts: 11Trusted User
    edited June 2010
    One more question/feature request...Is there anyway to export/include the table attribute data in the GPX file?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2010
    What version of Global Mapper are you using? If a feature has a per-vertex time list, then a <time> attribute should be included for each <trkpt> element in the generated GPX file. However this was not the case for older Global Mapper releases.

    Your other suggestions would result in an invalid GPX file. You can't have an opening <trk> segment without a </trk> element to close it. Likewise the last </gpx> has to retain the slash to indicate that it is closing the opening <gpx> element. Without the slash it would start at new <gpx> element, resulting in 2 opened and not closed <gpx> elements.

    There is not a way to include generic attributes in the GPX file without building the display label from the attributes as some software won't handle a GPX file with fields that it doesn't know about.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mlasslomlasslo Global Mapper User Posts: 11Trusted User
    edited June 2010
    I've using version 11.02 64 bit. I also have the 32 bit version. It does have a per-vertex time list, but when I export it out of Global Mapper it doesn't include the <time> attribute.

    I understand it would result in an invalid GPX. I was just pointing out that I had to change it (to the wrong syntax) to make it work. I suppose I should contact OpenStreetMap about this and not you...sorry.

    Thanks,

    Mellissa
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2010
    Can you post a sample GPX file that isn't maintaining the <time> field or email it to support@globalmapper.com so that I can try and reproduce your issue?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mlasslomlasslo Global Mapper User Posts: 11Trusted User
    edited June 2010
    Mike,
    I will email you the GPX file. If it doesn't come through let me know and I will post the code.

    Thanks,
    Mellissa
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2010
    When I load the file and export it the <time> values come through just fine. I think perhaps you just need an updated build. Can you visit the Download Trial link at http://www.globalmapper.com and get the latest installer to see if that fixes the issue?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • mlasslomlasslo Global Mapper User Posts: 11Trusted User
    edited June 2010
    Mike,
    I have the latest version of Global Mapper. However, I tried it again this morning and it exported the <time> values just fine. I did not shut down my computer lastnight so I have no clue why it didn't work yesterday and it does today. I have the file it exported yesterday that does not have the <time> value. Do you want me to email it to you?

    Thanks,
    Mellissa
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2010
    I'm not sure why it would behave any differently last night than today with the same version. It wouldn't do me any good to see the file without the <time> values, just let me know if you see it again.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
Sign In or Register to comment.