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

GPX 1.1 - wrong header #1200

Closed
sgapps-de opened this issue Feb 10, 2025 · 2 comments
Closed

GPX 1.1 - wrong header #1200

sgapps-de opened this issue Feb 10, 2025 · 2 comments

Comments

@sgapps-de
Copy link

Congratualtions for your great little tool!

But with activating GPX 1.1 logging the header for version 1.0 is written to the GPX file. Therefore some programs (e.g. RouteConverter) can't read the file due to the missing "gpxtpx" namespace.

As I understand your code (I do not really know Java) the problem is the private definition of "getBeginningXml" which is therefore not virtual. The addition of "public" or "protected" (the better option?) should do the trick.

@mendhak
Copy link
Owner

mendhak commented Feb 11, 2025

I just did a quick test and I can see the version 1.1 header as well as the gpxtpx namespace.

If the file already existed when GPX 1.1 was selected then the header wouldn't be written. Are you trying with a new file?

Sample:

<?xml version="1.0" encoding="UTF-8" ?><gpx version="1.1" creator="GPSLogger 133 - http://gpslogger.mendhak.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v2" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v2 https://www8.garmin.com/xmlschemas/TrackPointExtensionv2.xsd "><metadata><time>2025-02-11T20:18:48.381Z</time></metadata><trk><name>20250211</name><trkseg><trkpt lat="42.8509" lon="-2.8970183333333335"><ele>534.4</ele><time>2025-02-11T20:18:48.381Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:bearing>51.99</gpxtpx:bearing><gpxtpx:speed>0.0</gpxtpx:speed></gpxtpx:TrackPointExtension></extensions><geoidheight>0.</geoidheight><src>gps</src><sat>6</sat></trkpt>
<trkpt lat="42.8509" lon="-2.8970183333333335"><ele>534.4</ele><time>2025-02-11T20:19:38.393Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:bearing>51.99</gpxtpx:bearing><gpxtpx:speed>0.0</gpxtpx:speed></gpxtpx:TrackPointExtension></extensions><geoidheight>0.</geoidheight><src>gps</src><sat>6</sat></trkpt>
<trkpt lat="42.8509" lon="-2.8970183333333335"><ele>534.4</ele><time>2025-02-11T20:20:28.402Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:bearing>51.99</gpxtpx:bearing><gpxtpx:speed>0.0</gpxtpx:speed></gpxtpx:TrackPointExtension></extensions><geoidheight>0.</geoidheight><src>gps</src><sat>6</sat></trkpt>
<trkpt lat="42.8509" lon="-2.8970183333333335"><ele>534.4</ele><time>2025-02-11T20:21:18.412Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:bearing>51.99</gpxtpx:bearing><gpxtpx:speed>0.0</gpxtpx:speed></gpxtpx:TrackPointExtension></extensions><geoidheight>0.</geoidheight><src>gps</src><sat>6</sat></trkpt>
<trkpt lat="42.8509" lon="-2.8970183333333335"><ele>534.4</ele><time>2025-02-11T20:22:08.421Z</time><extensions><gpxtpx:TrackPointExtension><gpxtpx:bearing>51.99</gpxtpx:bearing><gpxtpx:speed>0.0</gpxtpx:speed></gpxtpx:TrackPointExtension></extensions><geoidheight>0.</geoidheight><src>gps</src><sat>6</sat></trkpt>
</trkseg></trk></gpx>

@sgapps-de
Copy link
Author

I am sorry! You are of course right. I did miss the fact that the new points are appended to the file. So I must delete the existing GPX file when changing the format.
Thank you for your advice.

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

No branches or pull requests

2 participants