ffi-proj4 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deebc57c53d32d2674bcce2d97f2be749cc3d278
4
- data.tar.gz: 03a3889603c3d63ec455e92fa6c0acdeab7f3eda
3
+ metadata.gz: 8a76e46b36d0c93594d2debd6dd2844f2cbccd70
4
+ data.tar.gz: 8a2a0f64bae739c547b46eef24e163d4777a203c
5
5
  SHA512:
6
- metadata.gz: 28ea5707ede09f52e60c975948647395fd5562e7f983e3971ce4c1c54d585dcd92c5895be9b9fdb88232b754024e2b35e6b685acaa2fafc3da5fe7be3dfcb72b
7
- data.tar.gz: b491fc6b49eecd633c9424769dd12ef6319e7eb810014024190f46bda233aed263dee8132f058d83beaf328482ed7849739b8bee40672e3dcd1c52fd0e89a9a9
6
+ metadata.gz: 91683690b8900f24fc7fb1eac8e89c61bbfba6d6bcf1cf87ed0053ff266aa8086645c3905863511cdac201755cdf905991e16f38ad54ffe6dc063427c7a8f9b5
7
+ data.tar.gz: 546838a53a9ee8a40c0c455ea9e284932bb6fc4006ea655a41eca04826d7cc44253e2077433b0df271169a3720cb2d50c2f7fcdbfa4bbbc5a7f971c993e826f7
@@ -0,0 +1,14 @@
1
+ cache: bundler
2
+ sudo: false
3
+ language: ruby
4
+ rvm:
5
+ - 2.2.3
6
+ - 2.1.7
7
+ - 2.0.0
8
+ - 1.9.3
9
+ - rbx-2
10
+ - jruby-19mode
11
+ addons:
12
+ apt:
13
+ packages:
14
+ - libproj-dev
data/Gemfile CHANGED
@@ -6,10 +6,17 @@ gem "rdoc", "~> 3.12"
6
6
  gem "rake", "~> 10.0"
7
7
  gem "minitest"
8
8
  gem "minitest-reporters"
9
- gem "guard-minitest"
9
+
10
+ platforms :rbx do
11
+ gem 'rubysl', '~> 2.0'
12
+ gem 'rubinius-developer_tools'
13
+ end
14
+
10
15
 
11
16
  if RUBY_VERSION >= '1.9'
12
17
  gem "simplecov"
18
+ gem "guard"
19
+ gem 'guard-minitest'
13
20
  end
14
21
 
15
22
  if File.exists?('Gemfile.local')
@@ -1,22 +1,22 @@
1
- Copyright (c) 2012-2014 J Smith <dark.panda@gmail.com>
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2012-2015 J Smith <dark.panda@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -8,9 +8,9 @@
8
8
 
9
9
  Ruby versions known to work:
10
10
 
11
- * Ruby MRI 1.8.7, 1.9.2 and 1.9.3 x86_64, OSX
12
- * Ruby MRI 1.8.7, 1.9.2 and 1.9.3 x86_64, linux
13
- * JRuby 1.6.8 and 1.7.1
11
+ * Ruby MRI 1.9.3, 2.0+, 2.1+ and 2.2+
12
+ * JRuby 1.7.22+
13
+ * Rubinius 2
14
14
 
15
15
  == Features
16
16
 
data/Rakefile CHANGED
@@ -18,6 +18,8 @@ Rake::TestTask.new(:test) do |t|
18
18
  t.warning = !!ENV['WARNINGS']
19
19
  end
20
20
 
21
+ task :default => :test
22
+
21
23
  desc 'Build docs'
22
24
  Rake::RDocTask.new do |t|
23
25
  t.title ="ffi-proj4 #{version}"
@@ -17,7 +17,6 @@ module Proj4
17
17
  def to_deg!
18
18
  self.x = rad_to_deg(self.x)
19
19
  self.y = rad_to_deg(self.y)
20
- self.z = rad_to_deg(self.z) unless self.z.nil?
21
20
  self
22
21
  end
23
22
 
@@ -28,7 +27,6 @@ module Proj4
28
27
  def to_rad!
29
28
  self.x = deg_to_rad(self.x)
30
29
  self.y = deg_to_rad(self.y)
31
- self.z = deg_to_rad(self.z) unless self.z.nil?
32
30
  self
33
31
  end
34
32
 
@@ -185,7 +185,7 @@ module Proj4
185
185
  alias :transformRad :transform
186
186
 
187
187
  def transform_deg!(proj, *args)
188
- self.transform!(proj, *args).to_deg!
188
+ self.transform!(proj, *args_deg_to_rad(*args)).to_deg!
189
189
  end
190
190
 
191
191
  def transform_deg(proj, *args)
@@ -1,5 +1,5 @@
1
1
 
2
2
  module Proj4
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0".freeze
4
4
  end
5
5
 
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class PointTests < MiniTest::Unit::TestCase
5
+ class PointTests < Minitest::Test
6
6
  include TestHelper
7
7
 
8
8
  def rad_deg_tester(method, expected_x, expected_y, expected_z, x, y, z)
@@ -32,7 +32,7 @@ class PointTests < MiniTest::Unit::TestCase
32
32
  0.7853981633974483,
33
33
  60,
34
34
  90,
35
- 45
35
+ 0.7853981633974483
36
36
  )
37
37
  end
38
38
 
@@ -43,7 +43,7 @@ class PointTests < MiniTest::Unit::TestCase
43
43
  45,
44
44
  1.0471975511965976,
45
45
  1.5707963267948966,
46
- 0.7853981633974483
46
+ 45
47
47
  )
48
48
  end
49
49
 
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class ProjectionTests < MiniTest::Unit::TestCase
5
+ class ProjectionTests < Minitest::Test
6
6
  include TestHelper
7
7
 
8
8
  def definition_sorter(definition)
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class SimpleTransformationTests < MiniTest::Unit::TestCase
5
+ class SimpleTransformationTests < Minitest::Test
6
6
  include TestHelper
7
7
 
8
8
  LONG = 8.4302123334
@@ -2,7 +2,7 @@
2
2
  $: << File.dirname(__FILE__)
3
3
  require 'test_helper'
4
4
 
5
- class TransformationTests < MiniTest::Unit::TestCase
5
+ class TransformationTests < Minitest::Test
6
6
  include TestHelper
7
7
 
8
8
  def setup
@@ -26,6 +26,15 @@ class TransformationTests < MiniTest::Unit::TestCase
26
26
  assert_in_delta(0, to.z, TOLERANCE * (10 ** 3))
27
27
  end
28
28
 
29
+ def test_gk_to_wgs84_deg
30
+ from = Proj4::Point.new(@rw * Proj4::RAD_TO_DEG, @hw * Proj4::RAD_TO_DEG, @zw)
31
+ to = @proj_gk.transform_deg(@proj_wgs84, from)
32
+ refute_equal(from.object_id , to.object_id)
33
+ assert_in_delta(@lon, to.x, TOLERANCE)
34
+ assert_in_delta(@lat, to.y, TOLERANCE)
35
+ assert_in_delta(0, to.z, TOLERANCE * (10 ** 3))
36
+ end
37
+
29
38
  def test_gk_to_wgs84_inplace
30
39
  from = Proj4::Point.new(@rw, @hw, @zw)
31
40
  to = @proj_gk.transform!(@proj_wgs84, from)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-proj4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - J Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
11
+ date: 2015-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - ".gitignore"
34
+ - ".travis.yml"
34
35
  - Gemfile
35
36
  - Guardfile
36
37
  - MIT-LICENSE
@@ -96,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  version: 1.3.1
97
98
  requirements: []
98
99
  rubyforge_project:
99
- rubygems_version: 2.2.2
100
+ rubygems_version: 2.2.5
100
101
  signing_key:
101
102
  specification_version: 4
102
103
  summary: An ffi wrapper for the PROJ.4 Cartographic Projections library.