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

Import error with GPX (and KML) files from "Zeopoxa cycling" #249

Closed
benjif opened this issue Jun 6, 2020 · 5 comments
Closed

Import error with GPX (and KML) files from "Zeopoxa cycling" #249

benjif opened this issue Jun 6, 2020 · 5 comments
Labels
potential bug A bug that could not (yet) be reproduced

Comments

@benjif
Copy link

benjif commented Jun 6, 2020

Describe the bug
An error occurs when I try to import a GPX (or KML) file from the Zeopoxa Cycling app.

Presumably the KML import error is related to #245 (Zeopoxa's KML exports use LineString). I'm not sure what element causes the error with GPX files.

To Reproduce

  1. Export your track from Zeopoxa Cycling (I've included samples).
  2. Import the track with OpenTracks.
  3. OpenTracks shows an error.

Here is a sample GPX file
Here is a sample KML file

Technical information

  • Device: [e.g. Samsung Galaxy S8 (SM-G950U)]
  • OS: [e.g. Android 9]
  • Version [e.g. v3.7.4]
@benjif benjif added the potential bug A bug that could not (yet) be reproduced label Jun 6, 2020
@benjif benjif changed the title Import error with GPX and KML files from "Zeopoxa cycling" Import error with GPX (and KML) files from "Zeopoxa cycling" Jun 6, 2020
@rgmf
Copy link
Member

rgmf commented Jun 6, 2020

The datetimes in the GPX file don't have time zone information or Z if they use UTC. If you add Z to all datetime in the file the it's imported correctly.

OpenTracks expect datetime as defined at https://www.w3.org/TR/xmlschema-2/#dateTime

@dennisguse
Copy link
Member

@rgmf Thanks for the quick analysis.

I introduced this behavior in 32070a0.
For API26+, I use ISO_DATE_FORMAT to parse dates, but this requires the Z.
On older platforms the original parsing code is still used (does not require a Z).
It was an attempt to cleanup a pretty nasty manual parsing function.

But I did not check what the actual KML/GPX specification says about this....
So, we can either revert this or figure out how to use the API26+ for an optional Z.

@rgmf
Copy link
Member

rgmf commented Jun 6, 2020

But I did not check what the actual KML/GPX specification says about this....

According to https://www.topografix.com/gpx_manual.asp#time "Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs."

In OpenTracks, parseTime in StringUtils expect a ISO 8601 time, at least in API26+.

I think it's okay or Am I missing something?

@benjif
Copy link
Author

benjif commented Jun 6, 2020

According to https://www.topografix.com/gpx_manual.asp#time "Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs."

It appears that GPX files correctly require the "Z" suffix for UTC (which Zeopoxa Cycling erroneously excluded). Closing this, but feel free to reopen if you want to be lenient with this parsing case.

@dennisguse
Copy link
Member

@benjif You are right, we really can be lenient in this case.
Thanks for reporting this issue :)
Fix will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential bug A bug that could not (yet) be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants