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

Invalid GPX created #137

Closed
daniel-molina opened this issue Sep 8, 2021 · 4 comments
Closed

Invalid GPX created #137

daniel-molina opened this issue Sep 8, 2021 · 4 comments

Comments

@daniel-molina
Copy link

daniel-molina commented Sep 8, 2021

I am using viking 1.9. Exporting certain imported GPX tracks (even full ones) as GPX creates an invalid XML file according to a XML validator. Uploading the track to OSM fails too (probably because of the same reason).

I reproduce this issue importing GPX files generated by FitoTrack 12.1, but not with some others from different sources. I attach one example. For this one the validator just report a warning (not an error) and viking exports a GPX with an error. Note that I changed the extension from gpx to txt so that github would allow me to attach it.

gpx_input.txt

@rnorris
Copy link
Collaborator

rnorris commented Sep 9, 2021

@daniel-molina The input file is an invalid GPX file see:

https://codeberg.org/jannis/FitoTrack/issues/321

Maybe Viking could be more robust against such input

@daniel-molina
Copy link
Author

I have not much experience on GPX, but xmlvalidation.com firstly reports for my previously attached FitoTrack GPX to have a warning. However, later it refers to it as an error. In any case, it is just what is referred in the FitoTrack issue that you mentioned.

A warning has been found!
[...]
Errors in the XML document:
	2:	304	schema_reference.4: Failed to read schema document 'http://www.topografix.com/GPX/1/1/gpx.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.

I can also say that OSM accepts FitoTrack GPX files as input (it is not possible to do it from viking but directly from OSM web interface). Personally, it would be nice for me if viking could manage those files :D, but I understand that is FitoTrack issue after all.

@daniel-molina
Copy link
Author

I tried an alternative to FitoTrack, the Trip Recording plugin of OsmAnd~. After exporting the GPX with viking new errors appear. The original GPX is attached in a OsmAnd issue I reported, currently being discussed there if the trace is invalid or not. Output from viking for that input is attached here.

BusGranadaZubia_viking.txt

@rnorris
Copy link
Collaborator

rnorris commented Sep 19, 2021

I think ATM if one uses the Track-->Export Track as GPX..., then Viking writes it's own GPX header - which may not be consistent with the trackpoint extensions being used (which in the the above case has osmand:speed value extensions).
And so may fail 'external schema' validation.

NB When one uses the Layer-->Export Layer-->Export as GPX... then the input GPX headers are retained properly and the so the exported file should be consistent.

rnorris added a commit that referenced this issue Sep 28, 2021
…d input

Improved checks in order to not mix GPX v1.0 and v1.1 output on export.
@rnorris rnorris closed this as completed Sep 28, 2021
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