geoptima 0.1.19 → 0.1.20
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.
- data/bin/show_geoptima +2 -2
- data/examples/show_geoptima.rb +2 -2
- data/lib/geoptima/locator.rb +7 -4
- data/lib/geoptima/version.rb +1 -1
- metadata +3 -3
data/bin/show_geoptima
CHANGED
@@ -8,7 +8,7 @@ require 'date'
|
|
8
8
|
require 'geoptima'
|
9
9
|
require 'geoptima/options'
|
10
10
|
|
11
|
-
Geoptima::assert_version(">=0.1.
|
11
|
+
Geoptima::assert_version(">=0.1.20")
|
12
12
|
|
13
13
|
$debug=false
|
14
14
|
|
@@ -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}"}
|
520
|
+
if_le{puts "#{b_fields.join("\t")}\t#{event.fields.inspect}\t(GPS:#{event.previous_gps && event.previous_gps.fields.inspect})"}
|
521
521
|
dataset.timer('export.event').stop
|
522
522
|
end
|
523
523
|
end
|
data/examples/show_geoptima.rb
CHANGED
@@ -8,7 +8,7 @@ require 'date'
|
|
8
8
|
require 'geoptima'
|
9
9
|
require 'geoptima/options'
|
10
10
|
|
11
|
-
Geoptima::assert_version(">=0.1.
|
11
|
+
Geoptima::assert_version(">=0.1.20")
|
12
12
|
|
13
13
|
$debug=false
|
14
14
|
|
@@ -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}"}
|
520
|
+
if_le{puts "#{b_fields.join("\t")}\t#{event.fields.inspect}\t(GPS:#{event.previous_gps && event.previous_gps.fields.inspect})"}
|
521
521
|
dataset.timer('export.event').stop
|
522
522
|
end
|
523
523
|
end
|
data/lib/geoptima/locator.rb
CHANGED
@@ -61,7 +61,7 @@ module Geoptima
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
module Locatable
|
64
|
-
attr_accessor :previous_point, :next_point, :previous_point_gap, :next_point_gap, :location
|
64
|
+
attr_accessor :previous_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:"
|
@@ -79,9 +79,12 @@ module Geoptima
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
def set_previous_if(gps,time_window=0.0)
|
82
|
-
if
|
83
|
-
self.
|
84
|
-
|
82
|
+
if gps
|
83
|
+
self.previous_gps = gps
|
84
|
+
if closer_than(gps,time_window)
|
85
|
+
self.previous_point = gps.location
|
86
|
+
self.previous_point_gap = (self - gps).abs
|
87
|
+
end
|
85
88
|
end
|
86
89
|
end
|
87
90
|
end
|
data/lib/geoptima/version.rb
CHANGED
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.
|
4
|
+
version: 0.1.20
|
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-
|
12
|
+
date: 2013-06-13 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:
|
152
|
+
hash: 609685665
|
153
153
|
requirements: []
|
154
154
|
rubyforge_project: geoptima
|
155
155
|
rubygems_version: 1.8.25
|