Old heart rate data lost after upgrading to recent version

Started by pikimin_tom, June 25, 2020, 08:40:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pikimin_tom

Hello,

I've discovered a bug which causes potential loss of some heart rate data when upgrading to a recent version. I'm currently using V7.4.22, I can't remember the previous version but it was probably ~6 months old.

I noticed that in older versions the HR data was stored in the "heart" table in the oruxmapstracks.db with a time index separate to the GPS data, and it kept recording for the whole duration of a track. In more recent versions HR data is stored in the trkptsen column of the trackpoints table, which means HR data is only recorded at the same time as a GPS point is recorded. I can imagine this is a cleaner way of storing HR data, but it causes 2 problems:

Firstly, when recording new tracks, if there is a gap in GPS data during a trip, then HR data isn't recorded during this gap. This is a problem with the default settings of minimum distance = 20m because if you stop moving there is no HR data, but it is very useful to see how the heart rate recovers during rests, and the average heart rate is not correct if data is missing. This can be "fixed" by setting minimum distance = 0 (always) which is what I've done, but maybe you should add a warning if a HR sensor is being used and minimum distance is not zero?

The second issue is a bigger problem though: if, in the recent version, I view a track or the statistics for a track made with an older version, it will convert the HR data from the heart table to the trkptsen column. As my older tracks didn't record GPS points when I stopped (because minimum distance wasn't zero), the HR data during these stationary periods is lost after the conversion! Hopefully I don't need to say that losing data is not a good thing!

My suggested solution is that during this conversion from the heart table to trkptsen, the app creates additional GPS points at the timestamp of the old heart data and interpolates the GPS data so it can fill in the gaps when there wasn't GPS data and allow it to use all of the HR data.

Alternatively, assuming Oruxmaps is to maintain backwards compatibility with old tracks with HR data in the heart table, does this conversion for old tracks need to happen at all?


-Tom

orux

Quote from: pikimin_tom on June 25, 2020, 08:40:10 PM
Hello,

I've discovered a bug which causes potential loss of some heart rate data when upgrading to a recent version. I'm currently using V7.4.22, I can't remember the previous version but it was probably ~6 months old.

I noticed that in older versions the HR data was stored in the "heart" table in the oruxmapstracks.db with a time index separate to the GPS data, and it kept recording for the whole duration of a track. In more recent versions HR data is stored in the trkptsen column of the trackpoints table, which means HR data is only recorded at the same time as a GPS point is recorded. I can imagine this is a cleaner way of storing HR data, but it causes 2 problems:

Firstly, when recording new tracks, if there is a gap in GPS data during a trip, then HR data isn't recorded during this gap. This is a problem with the default settings of minimum distance = 20m because if you stop moving there is no HR data, but it is very useful to see how the heart rate recovers during rests, and the average heart rate is not correct if data is missing. This can be "fixed" by setting minimum distance = 0 (always) which is what I've done, but maybe you should add a warning if a HR sensor is being used and minimum distance is not zero?

The second issue is a bigger problem though: if, in the recent version, I view a track or the statistics for a track made with an older version, it will convert the HR data from the heart table to the trkptsen column. As my older tracks didn't record GPS points when I stopped (because minimum distance wasn't zero), the HR data during these stationary periods is lost after the conversion! Hopefully I don't need to say that losing data is not a good thing!

My suggested solution is that during this conversion from the heart table to trkptsen, the app creates additional GPS points at the timestamp of the old heart data and interpolates the GPS data so it can fill in the gaps when there wasn't GPS data and allow it to use all of the HR data.

Alternatively, assuming Oruxmaps is to maintain backwards compatibility with old tracks with HR data in the heart table, does this conversion for old tracks need to happen at all?


-Tom
Hi.

I made that change because in the end the pulse data is always used linked to Track points. If the Track is exported as GPX, the data is linked to each Track point. The same when drawing a graph.

Only when directly accessing the database can those values ​​be useful.

The truth is that the conversion was made a long time ago, I don't remember which version.

orux

arrigoni

Hi Tom,
I'm very interesting in this issue. How can one extract the heart rate data from the trkptsen. I mean, how do I translate that database entry into heart rate values?
Thanks in advance
Enrico