geo_magic 0.2.1.2 → 0.2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/geo_magic.gemspec +1 -1
- data/lib/geo_magic/rectangle.rb +1 -1
- data/spec/geo_magic/within_rect_spec.rb +15 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.1.
|
1
|
+
0.2.1.3
|
data/geo_magic.gemspec
CHANGED
data/lib/geo_magic/rectangle.rb
CHANGED
@@ -7,7 +7,7 @@ module GeoMagic
|
|
7
7
|
@bottom_right_point = GeoMagic::Point.new right_lat(point_a, point_b), top_long(point_a, point_b)
|
8
8
|
end
|
9
9
|
|
10
|
-
def create_from_coords lat1, long1, lat2, long2
|
10
|
+
def self.create_from_coords lat1, long1, lat2, long2
|
11
11
|
self.new GeoMagic::Point.new(lat1, long1), GeoMagic::Point.new(lat2, long2)
|
12
12
|
end
|
13
13
|
|
@@ -32,9 +32,23 @@ describe "GeoMagic within rectangle - negative longitude" do
|
|
32
32
|
@radius = @center_point.within(10.km)
|
33
33
|
@points = @radius.create_points_in_square 10
|
34
34
|
end
|
35
|
+
|
36
|
+
it "should create a rectangle from points" do
|
37
|
+
rectangle = GeoMagic::Rectangle.new(GeoMagic::Point.new(-115, 50), GeoMagic::Point.new(-100, 20))
|
38
|
+
rectangle.top_left_point.should_not be_nil
|
39
|
+
rectangle.bottom_right_point.should_not be_nil
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should create a rectangle from coords" do
|
43
|
+
rectangle = GeoMagic::Rectangle.create_from_coords -115, 50, -100, 20
|
44
|
+
rectangle.top_left_point.should_not be_nil
|
45
|
+
rectangle.bottom_right_point.should_not be_nil
|
46
|
+
end
|
35
47
|
|
36
48
|
it "should select all points in rectangle" do
|
37
|
-
|
49
|
+
|
50
|
+
rectangle = GeoMagic::Rectangle.create_from_coords -115, 50, -100, 20
|
51
|
+
|
38
52
|
points_in_rectangle = @points.as_map_points.within_rectangle rectangle
|
39
53
|
puts "points: #{@points}"
|
40
54
|
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.2.1.
|
9
|
+
- 3
|
10
|
+
version: 0.2.1.3
|
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:
|
196
|
+
hash: 3873006806852711396
|
197
197
|
segments:
|
198
198
|
- 0
|
199
199
|
version: "0"
|