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

Error while loading .../.gpx: Something went wrong when loading GPX #102

Open
parthdesai97 opened this issue Apr 29, 2022 · 6 comments
Open

Comments

@parthdesai97
Copy link

Getting an error when I run the following command:

create_poster --type grid --title "Strava Routes" --athlete "NAME"

I am running the command from a directory that contains all my .gpx files. Any idea why this is happening?

This is the error (it prints one time in terminal for each .gpx file):

Error while loading /Users/../Downloads/export_54211749/activities/5138491472.gpx: Something went wrong when loading GPX.

@joetimmerman
Copy link
Contributor

Hi @parthdesai97 -- if you're still have this problem, it might be worth running with verbose logging enabled to see if that tells you anything interesting. You could also try parsing one of those files via gpxpy directly.

@sikmir
Copy link
Contributor

sikmir commented Jan 5, 2023

I have the same problem. --verbose says nothing more. Parsing with gpxpy is OK.

@sikmir
Copy link
Contributor

sikmir commented Jan 5, 2023

Looks like it's caused by:

assert cls._timezonefinder

@sikmir
Copy link
Contributor

sikmir commented Jan 5, 2023

Here is the fix:

diff --git i/gpxtrackposter/timezone_adjuster.py w/gpxtrackposter/timezone_adjuster.py
index 9dde750..f49e4c6 100644
--- i/gpxtrackposter/timezone_adjuster.py
+++ w/gpxtrackposter/timezone_adjuster.py
@@ -14,9 +14,9 @@ import timezonefinder  # type: ignore
 class TimezoneAdjuster:
     _timezonefinder: typing.Optional[timezonefinder.TimezoneFinder] = None

-    def __init__(self) -> None:
-        if not TimezoneAdjuster._timezonefinder:
-            TimezoneAdjuster._timezonefinder = timezonefinder.TimezoneFinder()
+    def __new__(cls) -> None:
+        if not cls._timezonefinder:
+            cls._timezonefinder = timezonefinder.TimezoneFinder()

     @classmethod
     def adjust(cls, time: datetime.datetime, latlng: s2sphere.LatLng) -> datetime.datetime:

@jhavens12
Copy link

I'm having this issue as well, was this supposed to be fixed?

@qdsang
Copy link

qdsang commented Jun 1, 2023

gpx file add timezone

  <trkpt lat="" lon="">
    <time>2023-06-01T18:46:28+0800</time>
  </trkpt>

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

Successfully merging a pull request may close this issue.

5 participants