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 CHANGED
@@ -1 +1 @@
1
- 0.2.1.2
1
+ 0.2.1.3
data/geo_magic.gemspec CHANGED
@@ -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.2"
8
+ s.version = "0.2.1.3"
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"]
@@ -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
- rectangle = GeoMagic::Rectangle.new(GeoMagic::Point.new(-115, 50), GeoMagic::Point.new(-100, 20))
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
- - 2
10
- version: 0.2.1.2
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: -1865177309588779558
196
+ hash: 3873006806852711396
197
197
  segments:
198
198
  - 0
199
199
  version: "0"