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 +4 -4
- data/.travis.yml +14 -0
- data/Gemfile +8 -1
- data/MIT-LICENSE +22 -22
- data/README.rdoc +3 -3
- data/Rakefile +2 -0
- data/lib/ffi-proj4/point.rb +0 -2
- data/lib/ffi-proj4/projection.rb +1 -1
- data/lib/ffi-proj4/version.rb +1 -1
- data/test/point_tests.rb +3 -3
- data/test/projection_tests.rb +1 -1
- data/test/simple_transformation_tests.rb +1 -1
- data/test/transformation_tests.rb +10 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a76e46b36d0c93594d2debd6dd2844f2cbccd70
|
4
|
+
data.tar.gz: 8a2a0f64bae739c547b46eef24e163d4777a203c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91683690b8900f24fc7fb1eac8e89c61bbfba6d6bcf1cf87ed0053ff266aa8086645c3905863511cdac201755cdf905991e16f38ad54ffe6dc063427c7a8f9b5
|
7
|
+
data.tar.gz: 546838a53a9ee8a40c0c455ea9e284932bb6fc4006ea655a41eca04826d7cc44253e2077433b0df271169a3720cb2d50c2f7fcdbfa4bbbc5a7f971c993e826f7
|
data/.travis.yml
ADDED
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
|
-
|
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')
|
data/MIT-LICENSE
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
Copyright (c) 2012-
|
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.
|
data/README.rdoc
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
|
9
9
|
Ruby versions known to work:
|
10
10
|
|
11
|
-
* Ruby MRI 1.
|
12
|
-
*
|
13
|
-
*
|
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
data/lib/ffi-proj4/point.rb
CHANGED
@@ -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
|
|
data/lib/ffi-proj4/projection.rb
CHANGED
data/lib/ffi-proj4/version.rb
CHANGED
data/test/point_tests.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
$: << File.dirname(__FILE__)
|
3
3
|
require 'test_helper'
|
4
4
|
|
5
|
-
class PointTests <
|
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
|
-
|
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
|
-
|
46
|
+
45
|
47
47
|
)
|
48
48
|
end
|
49
49
|
|
data/test/projection_tests.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
$: << File.dirname(__FILE__)
|
3
3
|
require 'test_helper'
|
4
4
|
|
5
|
-
class TransformationTests <
|
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.
|
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:
|
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.
|
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.
|