simple-trail 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a356f88eab11c5803bf0896ed044d6c19a1968e3150a3695d25cc2768ac61ec5
4
- data.tar.gz: 4ccb055143d1a205229bead38b230c72e98e0dcd4eb76f0be3bcd3322317db6e
3
+ metadata.gz: 459bc2473757a35abbd5659ecf848e89dfc31e09e6febd66bb730fa3c872fc6e
4
+ data.tar.gz: 2e28ca43a36e63de9fdf2ea295b1c4d3166544b4ec581f3daf9ae81ad74247bd
5
5
  SHA512:
6
- metadata.gz: 9289dafe44a05855959d5f3c05902bba234f9ade2978ddb524fe563620bfcb6dbf897e6b582818395d16b56ad362bd31770f27a27efe445171224355ef6785f9
7
- data.tar.gz: b9c3af1d741cc970ffefa67facc556bc5a5cb65293b968167bd2cd0a6dcf0953bc3895b6284d0fadffcd775e4c7de6eb2c2c1423f918cabbc074584914c65183
6
+ metadata.gz: ba4d5bd4951e88a62175e7c5c13520e0c3eaee7a662db893007a7568dd6e2c29a53a310a6f7e19c157afa00f993e6f491b11d397a49428114e5f8bda20eaf778
7
+ data.tar.gz: d4684d613afba62b5c2a0ca890566bdbb33d029b64f7e207e96157aa6985222ae78c5940c4d21e3d2d12327c20a5858dab192b4fd5d05ccdffbf97f4c276265e
@@ -32,7 +32,8 @@ module Manipulation
32
32
  offset = 0
33
33
  @gaps.each do |gap|
34
34
  middle_point = calculate_middle_point(@points[gap[:origin] + offset], @points[gap[:destination] + offset])
35
- @points = @points.insert(gap[:destination] + offset, {lat: middle_point.lat, lon: middle_point.lng })
35
+ est_elevation = (@points[gap[:origin] + offset][:ele].to_f + @points[gap[:destination] + offset][:ele].to_f) / 2.0
36
+ @points = @points.insert(gap[:destination] + offset, {lat: middle_point.lat, lon: middle_point.lng, ele: est_elevation })
36
37
 
37
38
  offset += 1
38
39
  end
data/simple-trail.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = 'simple-trail'
8
- s.version = '0.1.2'
8
+ s.version = '0.1.3'
9
9
  s.date = '2020-08-03'
10
10
  s.summary = 'Readind and manipulating GPX and other trail representation file'
11
11
  s.description = 'Optimazing and manipulating GPX file data. For my private purposes mostly'
@@ -34,5 +34,6 @@ RSpec.describe Manipulation::Enricher do
34
34
  enrichement_logic.enrich
35
35
 
36
36
  expect(enrichement_logic.enriched_points.count).not_to eq point_count
37
+ expect(enrichement_logic.enriched_points.all?{|point| !point[:ele].nil?}).to be(true)
37
38
  end
38
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-trail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Staszek Zawadzki
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubygems_version: 3.1.2
129
+ rubygems_version: 3.1.4
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Readind and manipulating GPX and other trail representation file