Formatting of GPX for OpenStreetMap
mlasslo
Global Mapper UserTrusted User
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>
<?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
-
One more question/feature request...Is there anyway to export/include the table attribute data in the GPX file?
-
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 -
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
Categories
- 12.8K All Categories
- 5.7K Features Discussion
- 345 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 636 GM Script Language
- 54 User Scripts
- 114 GPS Features
- 417 Projection Questions
- 826 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 178 Announcement and News
- 913 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 569 Other Discussion
- 131 GIS Data Sources
- 27 Global Mapper Showcase
- 238 How I use Global Mapper
- 107 Global Mapper Forum Website