erik / derive

Generate personal heatmap from GPX/TCX/FIT/IGC data
https://erik.github.io/derive
MIT License
490 stars 62 forks source link

Support FIT files #19

Closed erik closed 5 years ago

erik commented 6 years ago

(gzipped or not)

My data dump from strava since the GDPR change (#17) contains .fit.gz files. Should look into parsing these.

c-harding commented 6 years ago

Would you be able to post an example of such a file?

c-harding commented 6 years ago

As it’s a binary file, the logic with unzipping will may need to be altered a bit, as I’m not sure how safe it will be to read binary data into a 16-bit JavaScript string. This could be done by unzipping to a closure (isBinary: boolean) => string | UInt8Array. Once it’s been read, easy-fit looks like the best candidate package for parsing it, but it’s not exactly stable.

erik commented 6 years ago

Here's a zipped up FIT file: 2365640155.fit.zip

cedricdelpoux commented 6 years ago

It's strange because when I try to load .fit.gz files to derive, Some of them are imported and the other ones failed: Loaded 87, 1206 failures

erik commented 6 years ago

That is weird! Maybe the extension is lying about the type of file it is...

@xuopled if you're comfortable with it, would you be able to share an example of a .fit.gz file that succeeds?

cedricdelpoux commented 6 years ago

In fact, I selected all my exported activities and drap and drop to derive. So I did not check all the files before. But now I understand what appened. Some of my activities are .tcx.gz and some other are fit.gz. So that is why some of my exported activities can be imported by Derive. The .tcx.gz does work and the fit.gz does not work

cedricdelpoux commented 6 years ago

When I extract and open a .tcx file, it looks like an XML file. But if I open a .fit file, it contains encoded characters. I can't understand it. It is not XML