Subscribe to this thread
Home - General / All posts - Handling GPX Extensions
joebocop
348 post(s)
#07-Nov-18 17:38

I have been given some GPX files having these first two lines:

<?xml version="1.0"?>

<gpx version="1.1" creator="GDAL 2.2.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogr="http://osgeo.org/gdal" 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">

Point features within these GPX files are described as

<wpt lat="54.1" lon="-60.1">

  <extensions>

    <ogr:id>11.0</ogr:id>

    <ogr:WP>QB_11</ogr:WP>

  </extensions>

</wpt>

Release 9 successfully imports the geometry, but the data table fields are otherwise all null owing, I presume, to the lack of support for gpx "extensions".

It would be handy if Release 9 could

  • create a field in the new table component on import for each of the unique fields defined within a GPX file's <extensions>
  • automatically add mfd_id field and mfd_id_x btree index on tables created by the GPX import process

Now that I've written all this, it's probably more appropriate to be sent in as a suggestion, but I can hardly bare the thought of trashing the post now.

joebocop
348 post(s)
#08-Nov-18 00:53

To be clear, the GDAL dataport adds columns for the extensions, it's just not as easy to mass-import-and-merge hundreds of GPX files using "Data Source" rather than "import"

adamw


8,259 post(s)
#08-Nov-18 14:16

Thanks for the post. Be sure to send it in as a suggestion.

You can mass-import using GDAL, just in case. File - Import, set file filter to GDAL ('. Files (GDAL/OGR)'), then select multiple files and click Import.

joebocop
348 post(s)
#08-Nov-18 18:37

Deadly, thank you!

The GDAL import doesn't retain the file name in the component names, however, so we lose that bit of metadata, and the hundreds of layers can't then be merged.

I'll synthesize all of this into another suggestion. Thanks.

philw
96 post(s)
#15-Nov-18 03:23

Not sure if this helps but I tried M9 for GPX import for the first time this week and it worked flawlessly.

The GPX files were generated by a Garmin eTrex 10 GPS as the native track storage format.

The files came into M9 with the data columns (date time, elevation etc.) correctly populated.

I have pasted the first few lines of the GPX file below for reference (could not work out how to paste as HTML code).

There might be a clue in there as to why the GDAL versions are not working:

<?xml version="1.0" encoding="UTF-8"?>

-<gpx xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www8.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/WaypointExtension/v1 http://www8.garmin.com/xmlschemas/WaypointExtensionv1.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1" creator="eTrex 10" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:wptx1="http://www.garmin.com/xmlschemas/WaypointExtension/v1" xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns="http://www.topografix.com/GPX/1/1">

-<metadata>

-<link href="http://www.garmin.com">

<text>Garmin International</text>

</link>

<time>2018-11-12T05:45:28Z</time>

</metadata>

-<trk>

<name>Current Track: 04 NOV 2018 08:16</name>

-<extensions>

-<gpxx:TrackExtension>

<gpxx:DisplayColor>Cyan</gpxx:DisplayColor>

</gpxx:TrackExtension>

</extensions>

-<trkseg>

-<trkpt lon="117.1839804947" lat="-20.5966687761">

<ele>4.46</ele>

<time>2018-11-04T00:16:38Z</time>

-<extensions>

-<gpxtpx:TrackPointExtension>

<gpxtpx:cad>0</gpxtpx:cad>

</gpxtpx:TrackPointExtension>

</extensions>

</trkpt>

-<trkpt lon="117.1837121900" lat="-20.5968271103">

<ele>4.94</ele>

<time>2018-11-04T00:16:55Z</time>

-<extensions>

-<gpxtpx:TrackPointExtension>

<gpxtpx:cad>0</gpxtpx:cad>

</gpxtpx:TrackPointExtension>

</extensions>

</trkpt>

Manifold User Community Use Agreement Copyright (C) 2007-2017 Manifold Software Limited. All rights reserved.