danielalvsaaker / tf-viewer

Selfhosted web dashboard for activity tracking - written in Rust!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPX parser

danielalvsaaker opened this issue · comments

Implement a parser for the GPX file format.

Should be written as a separate crate, and implemented in a similar way to the FIT parser.

Hey, I'm having a look at this. Is it really a matter of simply having a sister module to fit.rs that relies on the gpx crate or should I expect more issues (like some assumption is used all over the place and it won't hold with gpx data) ?

I have something working, I still need to do more test and probably try to handle different variant of GPX... But I see you are rewriting everything... So should I switch to your -rewrite branches instead of trying to work on master?

Hey, first of all, thank you for implementing this! The best thing would be to do this branched off from the rewrite branch. A sister module to fit.rs is what I had in mind, yep. The only thing I can see on first glance that is assumed everywhere, which the gpx crate does not do, is that timestamps are stored in DateTime<Local> instead of DateTime<Utc>.

Ok ! Yes I've seen that the time must be converted. There's also some computation needed (Record.distance is needed or the plot will not work :).

I've tried to switch to backend-rewrite but then I'm stuck. I see that server is hardcoded on 8777 now, but I only get a blank page when accessing it. Is there something I should do ?

That branch is pretty useless until frontend is rewritten as well. Actually, just test and request a pull to main, and then I can pull your changes back into the rewrite branch.

Ok, will do that, thanks!

Any updates on this? Would love to get support for gpx files!

It's still alive but on pause, but haven't touched it for some time. Probably because it's winter so have no tracks to play with :)
It is working, but some things should be added in the UI where the info are not in the GPX, for example the kind of activity (running, hiking, skiing, ...). I can already open a draft PR if you want to test it :)

Understandable ;). I am not sure how workable your changes are without the UI options you mention, but I can try it out with some of my tracks, why not.

I've hardcoded some activity (can't remember which one). So basically, everything ends up as "hike" for example. And of course, GPX has some variation depending on vendor/soft, so maybe that will break somehow.

@WetenSchaap here's the code :)