Skip to content

Max & Min altitude #5

Merged
vkurup merged 2 commits intovkurup:masterfrom
firefly-cpp:master
Jan 23, 2016
Merged

Max & Min altitude #5
vkurup merged 2 commits intovkurup:masterfrom
firefly-cpp:master

Conversation

@firefly-cpp
Copy link
Contributor

Max and Min altitude were missing.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a question that I don't know the answer to... Is every TCX file guaranteed to have ns:AltitudeMeters? If not, or if the list can possibly be empty, then taking the max of an empty list will fail (and dividing by len(altitude) in altitude_avg will also fail).

Do you know what the spec says? It might be best to just assume that altitude_points can be empty, in which case we should check for that and return zero in these 2 methods and altitude_avg.

@firefly-cpp
Copy link
Contributor Author

I have not seen a TCX file without altitude yet. In fact, I do not see any special problem here.
Nevertheless, I am going to add exceptions handling in the future. Moreover, there is a huge problem with heart rate values. Approximately 50% of athletes do not use heart rate monitor. We must add exception handling in that case.

@vkurup
Copy link
Owner

vkurup commented Jan 20, 2016

Here's an example: https://forums.garmin.com/showthread.php?220362-Export-to-TCX-Where-s-the-Elevation-Data&s=df7adbf1a3b64d568435d93c0967b1d0

My original files had altitude data, but when I exported them from that service, it had been stripped, so it would be nice not to break in those cases.

In any case, I agree with doing it as a separate PR. This one looks good. 👍

@firefly-cpp
Copy link
Contributor Author

👍

vkurup added a commit that referenced this pull request Jan 23, 2016
@vkurup vkurup merged commit aa435e0 into vkurup:master Jan 23, 2016
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 this pull request may close these issues.

2 participants