git-fit 0.21.1 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/git_fit/elevation/correct.rb +9 -4
- data/lib/git_fit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b3579f7c261d30e4b352cfb55be41424e843627eb9e50e7d5136b57c49ce63e
|
|
4
|
+
data.tar.gz: 5d7727ed3abc50ff59469ce76dc4f37e07cbed1e73e0b245d026d15ce07861a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7cd22ebbc16e55b34d832be0466b44d58bc90bea98a164870fdbf1121a6262e4570d1e4060d6b091ba44254986ffa7377131f4ff171590c806a103de658ea1f
|
|
7
|
+
data.tar.gz: 5b87898f84b621126b475eb5c9a922d3aa8b58125040a954346169bcc542dd77dc66fd95493144026e345bfc283d39d40b1547146f113171af5bdfbcb7ef0f91
|
|
@@ -81,16 +81,21 @@ module GitFit
|
|
|
81
81
|
l2 = JSON.parse(File.read(l2_path))
|
|
82
82
|
return nil unless l2.is_a?(Array)
|
|
83
83
|
|
|
84
|
+
# L2 std has two coordinate key styles: keep/2bulu/apple_health/xingzhe
|
|
85
|
+
# write latitude/longitude, FIT-derived sources write positionLat/
|
|
86
|
+
# positionLong (same convention as Dedup::Trajectory and export/gpx).
|
|
84
87
|
pts = l2.filter_map do |pt|
|
|
85
88
|
next unless pt.is_a?(Hash)
|
|
86
|
-
|
|
89
|
+
lat = pt['latitude'] || pt['positionLat']
|
|
90
|
+
lng = pt['longitude'] || pt['positionLong']
|
|
91
|
+
next unless lat && lng && pt['altitude']
|
|
87
92
|
|
|
88
|
-
pt
|
|
93
|
+
[lat.to_f, lng.to_f, pt['altitude'].to_f]
|
|
89
94
|
end
|
|
90
95
|
return nil if pts.size < 2
|
|
91
96
|
|
|
92
|
-
locations = pts.map { |
|
|
93
|
-
alts_raw = pts.map { |
|
|
97
|
+
locations = pts.map { |lat, lng, _alt| [lat, lng] }
|
|
98
|
+
alts_raw = pts.map { |_lat, _lng, alt| alt }
|
|
94
99
|
|
|
95
100
|
dem_alts = dem_corrected_altitudes(locations, alts_raw)
|
|
96
101
|
h = hysteresis_threshold(source, locations, alts_raw)
|
data/lib/git_fit/version.rb
CHANGED