Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polar_training2tcx fixes and improvements #39

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions polar_training2tcx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def output_tcx(parsed)
break
end

break if i >= samples_count && i >= route_samples_count
break if i >= samples_count && route_i >= route_samples_count

if !alt_offline || i > alt_offline.stop_index
alt_offline = samples.altitude_offline.find { |off| off.start_index == i } || false
Expand Down Expand Up @@ -173,14 +173,13 @@ def output_tcx(parsed)
}
}
end
first_sample_with_gps = false if first_sample_with_gps
}.xmlns = 'http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2'
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like Polar Flow excludes the XML namespace of the first Trackpoint of each Track only. Strange!

}

i += 1
elapsed += recording_interval
elapsed_with_pauses += recording_interval
end
}.xmlns = 'http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2'
Copy link
Owner

Choose a reason for hiding this comment

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

Same here, Polar Flow does include the namespace for all , except the first one. Not sure why, maybe to please Strava too?
Those namespaces may not be needed for usual use cases, we can try to remove them and see if someone needs them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it depends on the version and/or the platform of the PolarFlow app. I used their Windows applicaiton to load the trainings, and then downloaded the results via a browser.

}
end
if (avg_speed && avg_speed > 0) || (avg_watts && avg_watts > 0)
xml.Extensions {
Expand Down