geo_magic 0.2.1.3 → 0.2.1.4

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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1.3
1
+ 0.2.1.4
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{geo_magic}
8
- s.version = "0.2.1.3"
8
+ s.version = "0.2.1.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
@@ -60,7 +60,7 @@ module GeoMagic
60
60
 
61
61
  def within_rectangle rectangle
62
62
  self.select do |point|
63
- rectangle.overlaps? point
63
+ rectangle.overlaps? get_dist_obj(point)
64
64
  end
65
65
  end
66
66
 
@@ -75,6 +75,20 @@ describe "GeoMagic closest" do
75
75
  center_person = Person.new 'Man in the center', @center_point
76
76
 
77
77
  people_within = persons.as_map_points.within_distance 5.km, :from => center_person
78
- puts "Persons within 4 km of Man in the center: #{people_within.inspect}"
78
+ puts "People within 4 km of Man in the center: #{people_within.inspect}"
79
+ end
80
+
81
+ it "should select all people in rectangle" do
82
+
83
+ points = @radius.create_points_in_square 4
84
+ persons = Person.random_at points
85
+
86
+ center_person = Person.new 'Man in the center', @center_point
87
+
88
+ rectangle = GeoMagic::Rectangle.create_from_coords -115, 50, -100, 20
89
+
90
+ people_in_rectangle = persons.as_map_points.within_rectangle rectangle
91
+ puts "People in the rectangular area: #{people_in_rectangle.inspect}"
79
92
  end
93
+
80
94
  end
metadata CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 2
8
8
  - 1
9
- - 3
10
- version: 0.2.1.3
9
+ - 4
10
+ version: 0.2.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kristian Mandrup
@@ -193,7 +193,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
193
  requirements:
194
194
  - - ">="
195
195
  - !ruby/object:Gem::Version
196
- hash: 3873006806852711396
196
+ hash: 1418808152282982370
197
197
  segments:
198
198
  - 0
199
199
  version: "0"