Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Missing TrackExtension (not TrackPointExtension) #7

Closed
delp14 opened this issue Feb 18, 2022 · 2 comments
Closed

Missing TrackExtension (not TrackPointExtension) #7

delp14 opened this issue Feb 18, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@delp14
Copy link

delp14 commented Feb 18, 2022

Hi, I'm using a Garmin navigator.
gpx contains a TrackExtension, but the data is lost after running the program.

In my example, the colour of the track I want to save is used.

sample gpx:

<?xml version="1.0" encoding="utf-8"?><gpx creator="Garmin Desktop" version="1.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd 

  <metadata>
    <link href="http://www.garmin.com">
      <text>Garmin International</text>
    </link>
    <time>2022-01-24T07:00:22Z</time>
    <bounds maxlat="54.878299031406641" maxlon="58.571017971262336" minlat="54.823138983920217" minlon="58.462714981287718" />
  </metadata>

  <trk>
    <name>Distance traveled</name>
    <extensions>
      <gpxx:TrackExtension>
        <gpxx:DisplayColor>Black</gpxx:DisplayColor>
      </gpxx:TrackExtension>
    </extensions>
    <trkseg>
      <trkpt lat="54.878299031406641" lon="58.571017971262336">
        <ele>632.07000700000003</ele>
        <time>2021-01-24T10:38:34Z</time>
      </trkpt>
      <trkpt lat="54.878269024193287" lon="58.570830971002579">
        <ele>633.14001399999995</ele>
        <time>2021-01-24T10:38:43Z</time>
      </trkpt>

output:


[{'ele': 632.070007,
  'extensions': '\n      ',
  'lat': 54.87829903140664,
  'lon': 58.571017971262336,
  'name': 'Distance traveled',
  'time': '2021-01-24T10:38:34Z'},
 {'ele': 633.140014,
  'extensions': '\n      ',
  'lat': 54.87826902419329,
  'lon': 58.57083097100258,
  'name': 'Distance traveled',
  'time': '2021-01-24T10:38:43Z'},

@astrowonk astrowonk self-assigned this Feb 18, 2022
@astrowonk astrowonk added the bug Something isn't working label Feb 18, 2022
@astrowonk
Copy link
Owner

Thanks for the bug report. Yeah I've never seen extension data encoded quite like this, usually I see:

<extensions>
					<gpxtpx:TrackPointExtension>
						<gpxtpx:hr>156</gpxtpx:hr>
						<gpxtpx:cad>71</gpxtpx:cad>
						<gpxtpx:speed>0.254569</gpxtpx:speed>
						<gpxtpx:course>289.910889</gpxtpx:course>
						<gpxtpx:hAcc>5.644999</gpxtpx:hAcc>
						<gpxtpx:vAcc>5.373536</gpxtpx:vAcc>
					</gpxtpx:TrackPointExtension>
				</extensions>

I'll see what I can do with this tonight / this weekend, should be possible to fix this quickly. It looks like trk level data so it'd be the same for the whole trk, which I think I already do with trk name.

@astrowonk
Copy link
Owner

Fixed via 9eb85ea.

Should be on pypi; I messed up the unit test coverage which I fixed subsequently but I've already pushed 0.2.15 to pypi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants