tf-viewer icon indicating copy to clipboard operation
tf-viewer copied to clipboard

GPX parser

Open danielalvsaaker opened this issue 4 years ago • 11 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.

danielalvsaaker avatar Jan 06 '21 11:01 danielalvsaaker

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) ?

dkm avatar Nov 10 '21 07:11 dkm

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?

dkm avatar Nov 11 '21 18:11 dkm

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>.

danielalvsaaker avatar Nov 11 '21 18:11 danielalvsaaker

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 ?

dkm avatar Nov 11 '21 19:11 dkm

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.

danielalvsaaker avatar Nov 11 '21 19:11 danielalvsaaker

Ok, will do that, thanks!

dkm avatar Nov 11 '21 20:11 dkm

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

WetenSchaap avatar Jan 12 '22 20:01 WetenSchaap

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 :)

dkm avatar Jan 12 '22 20:01 dkm

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.

WetenSchaap avatar Jan 14 '22 11:01 WetenSchaap

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.

dkm avatar Jan 14 '22 12:01 dkm

@WetenSchaap here's the code :)

dkm avatar Jan 16 '22 07:01 dkm