Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support Garmin eTrex GPX format #115

Closed
jaaviercr opened this issue May 23, 2018 · 2 comments
Closed

Support Garmin eTrex GPX format #115

jaaviercr opened this issue May 23, 2018 · 2 comments

Comments

@jaaviercr
Copy link

It would be cool to support the Garmin eTrex GPX format, I have attached a file recored by a Garmin eTrex 30x. I have tried to read it with this library and I have seen that "extension" and its son "TrackPointExtension" are supported but not the grandson "hr" (HeartRate) inside of the extension itself.
Congratulations for this fantastic lib! :)

example.gpx.txt

@tkrajina
Copy link
Owner

There is a new version of the library in the dev branch. It supports extensions.

Unfortunately, it needs to small changes before I merge it in master and release a new version (updated README and a small problem with the order of attributes in the root <gpx> element).

@jedie
Copy link
Contributor

jedie commented May 29, 2018

Here is another variant that will not parse with v1.3.0:

<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="Garmin Connect" version="1.1"
  xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/11.xsd"
  xmlns:ns3="http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
  xmlns="http://www.topografix.com/GPX/1/1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://www.garmin.com/xmlschemas/GpxExtensions/v3">
  <metadata>
    <link href="connect.garmin.com">
      <text>Garmin Connect</text>
    </link>
    <time>2018-02-21T14:30:50.000Z</time>
  </metadata>
  <trk>
    <name>Foo Bar</name>
    <type>running</type>
    <trkseg>
      <trkpt lat="51.43788929097354412078857421875" lon="6.617012657225131988525390625">
        <ele>23.6000003814697265625</ele>
        <time>2018-02-21T14:30:50.000Z</time>
        <extensions>
          <ns3:TrackPointExtension>
            <ns3:hr>125</ns3:hr>
            <ns3:cad>75</ns3:cad>
          </ns3:TrackPointExtension>
        </extensions>
      </trkpt>
      <trkpt lat="51.43786800093948841094970703125" lon="6.6170061193406581878662109375">
        <ele>23.6000003814697265625</ele>
        <time>2018-02-21T14:30:51.000Z</time>
        <extensions>
          <ns3:TrackPointExtension>
            <ns3:hr>123</ns3:hr>
            <ns3:cad>75</ns3:cad>
          </ns3:TrackPointExtension>
        </extensions>
      </trkpt>
      <trkpt lat="51.4378472976386547088623046875" lon="6.61700570024549961090087890625">
        <ele>23.799999237060546875</ele>
        <time>2018-02-21T14:30:52.000Z</time>
        <extensions>
          <ns3:TrackPointExtension>
            <ns3:hr>124</ns3:hr>
            <ns3:cad>75</ns3:cad>
          </ns3:TrackPointExtension>
        </extensions>
      </trkpt>
    </trkseg>
  </trk>
</gpx>

I get this:

Traceback (most recent call last):
  File "test.py", line 19, in <module>
    gpx_parser.parse()
  File "gpxpy/gpxpy/parser.py", line 97, in parse
    mod_etree.register_namespace(prefix, URI.strip('"'))
  File "src/lxml/etree.pyx", line 184, in lxml.etree.register_namespace
ValueError: Prefix format reserved for internal use

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants