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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30f139ea0a7c21e9a99189ac7541c8b80c35377f40742823843dbcd5b2ce604a
4
- data.tar.gz: b554587d97956af6e3a532ab67b6eca755377005f82eec38c500414d7bd1c4c4
3
+ metadata.gz: 4b3579f7c261d30e4b352cfb55be41424e843627eb9e50e7d5136b57c49ce63e
4
+ data.tar.gz: 5d7727ed3abc50ff59469ce76dc4f37e07cbed1e73e0b245d026d15ce07861a7
5
5
  SHA512:
6
- metadata.gz: 5b23770d805a5c42fdbe3b4322e3557bd4938033e2e7e3094e934354d16fbc8c6bb7d7ed028ae5ffe9684b785d7e5fdca560e17480fd020713c1b96302795bb2
7
- data.tar.gz: 32dde756e5dc46d3f859a992779187ccf2e478e9de05b681f79184ba2c35838822f29586f9d4e9c79d26e1d8d767c1771d4ed80172fa6fd21ec9ff7851345720
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
- next unless pt['latitude'] && pt['longitude'] && pt['altitude']
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 { |pt| [pt['latitude'].to_f, pt['longitude'].to_f] }
93
- alts_raw = pts.map { |pt| pt['altitude'].to_f }
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitFit
4
- VERSION = '0.21.1'
4
+ VERSION = '0.21.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-fit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lax