geoptima 0.1.20 → 0.1.21

Sign up to get free protection for your applications and to get access to all the features.
data/bin/show_geoptima CHANGED
@@ -517,7 +517,7 @@ $datasets.keys.sort.each do |imei|
517
517
  dataset.timer('export.event.write').start
518
518
  export.puts_to "#{b_fields.join("\t")}\t#{fields.join("\t")}", name
519
519
  dataset.timer('export.event.write').stop
520
- if_le{puts "#{b_fields.join("\t")}\t#{event.fields.inspect}\t(GPS:#{event.previous_gps && event.previous_gps.fields.inspect})"}
520
+ if_le{puts "#{b_fields.join("\t")}\t#{event.fields.inspect}\t(GPS:#{[event.previous_gps,event.next_gps].compact.map{|gps| gps.fields.inspect}})"}
521
521
  dataset.timer('export.event').stop
522
522
  end
523
523
  end
@@ -517,7 +517,7 @@ $datasets.keys.sort.each do |imei|
517
517
  dataset.timer('export.event.write').start
518
518
  export.puts_to "#{b_fields.join("\t")}\t#{fields.join("\t")}", name
519
519
  dataset.timer('export.event.write').stop
520
- if_le{puts "#{b_fields.join("\t")}\t#{event.fields.inspect}\t(GPS:#{event.previous_gps && event.previous_gps.fields.inspect})"}
520
+ if_le{puts "#{b_fields.join("\t")}\t#{event.fields.inspect}\t(GPS:#{[event.previous_gps,event.next_gps].compact.map{|gps| gps.fields.inspect}})"}
521
521
  dataset.timer('export.event').stop
522
522
  end
523
523
  end
@@ -61,7 +61,7 @@ module Geoptima
61
61
  end
62
62
  end
63
63
  module Locatable
64
- attr_accessor :previous_gps, :previous_point, :next_point, :previous_point_gap, :next_point_gap, :location
64
+ attr_accessor :previous_gps, :next_gps, :previous_point, :next_point, :previous_point_gap, :next_point_gap, :location
65
65
  def closer_than(gps,window=0.0)
66
66
  if $debug && gps && window > 0
67
67
  puts "Comparing times:"
@@ -73,9 +73,12 @@ module Geoptima
73
73
  gps && (window <= 0.0 || (self - gps).abs < window)
74
74
  end
75
75
  def set_next_if(gps,time_window=0.0)
76
- if closer_than(gps,time_window)
77
- self.next_point = gps.location
78
- self.next_point_gap = (self - gps).abs
76
+ if gps
77
+ self.next_gps = gps
78
+ if closer_than(gps,time_window)
79
+ self.next_point = gps.location
80
+ self.next_point_gap = (self - gps).abs
81
+ end
79
82
  end
80
83
  end
81
84
  def set_previous_if(gps,time_window=0.0)
@@ -1,6 +1,6 @@
1
1
  module Geoptima
2
2
 
3
- VERSION = "0.1.20"
3
+ VERSION = "0.1.21"
4
4
 
5
5
  class Version
6
6
  attr_reader :comparator, :version, :major, :minor, :patch
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoptima
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.20
4
+ version: 0.1.21
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-13 00:00:00.000000000 Z
12
+ date: 2013-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_json
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: 609685665
152
+ hash: 722716957
153
153
  requirements: []
154
154
  rubyforge_project: geoptima
155
155
  rubygems_version: 1.8.25