proj4rb 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +66 -61
- data/Gemfile +4 -4
- data/Rakefile +27 -27
- data/lib/api/api.rb +110 -83
- data/lib/api/api_4_9.rb +30 -30
- data/lib/api/api_5_0.rb +300 -300
- data/lib/api/api_5_1.rb +6 -6
- data/lib/api/api_5_2.rb +4 -4
- data/lib/api/api_6_0.rb +41 -42
- data/lib/api/api_6_1.rb +4 -4
- data/lib/api/api_6_2.rb +6 -5
- data/lib/area.rb +32 -32
- data/lib/config.rb +69 -69
- data/lib/context.rb +102 -102
- data/lib/coordinate.rb +197 -197
- data/lib/crs.rb +204 -204
- data/lib/ellipsoid.rb +41 -41
- data/lib/error.rb +17 -17
- data/lib/operation.rb +42 -42
- data/lib/pj_object.rb +80 -80
- data/lib/point.rb +72 -72
- data/lib/prime_meridian.rb +39 -39
- data/lib/proj.rb +30 -30
- data/lib/projection.rb +206 -206
- data/lib/transformation.rb +60 -60
- data/lib/unit.rb +53 -53
- data/proj4rb.gemspec +32 -32
- data/test/abstract_test.rb +7 -7
- data/test/context_test.rb +81 -81
- data/test/coordinate_test.rb +34 -34
- data/test/crs_test.rb +372 -372
- data/test/ellipsoid_test.rb +34 -34
- data/test/operation_test.rb +29 -29
- data/test/prime_meridians_test.rb +33 -33
- data/test/proj_test.rb +16 -16
- data/test/projection_test.rb +223 -223
- data/test/transformation_test.rb +67 -67
- data/test/unit_test.rb +47 -47
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec1833a8b87e9d94521de30e1179f81f6cf04896c1200ce1949df372ed68b3c9
|
4
|
+
data.tar.gz: 192835632d10989b94df05a038c17595c4735787bb6a0d8dde7edb55a60e0948
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dd8fa60741b1db78714fd63c496d33ad07439c7bf248bdffee0ecbe96f299dcb6527dc22eb014c8ee3024ae91094ebad3cb39df293438a759e704aa818677dc
|
7
|
+
data.tar.gz: 252a6e5efd3fd85f136a281dc69d82f9993d630b0c5b7d4fbfe67739af1dd7cb19d4c863deb81dd8a5ec0a7c71c45cdcedfe8092feba267b85775eb77013bcae
|
data/ChangeLog
CHANGED
@@ -1,62 +1,67 @@
|
|
1
|
-
2.2.
|
2
|
-
=========================
|
3
|
-
* Move
|
4
|
-
* Improve search path generation code (Charlie Savage)
|
5
|
-
|
6
|
-
2.2.
|
7
|
-
=========================
|
8
|
-
*
|
9
|
-
*
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
*
|
15
|
-
*
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
2.
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
-
|
48
|
-
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
-
|
1
|
+
2.2.2 (January 10, 2020)
|
2
|
+
=========================
|
3
|
+
* Move proj_context_set_autoclose_database to api 6.2 (Jan Klimke)
|
4
|
+
* Improve search path generation code (Charlie Savage)
|
5
|
+
|
6
|
+
2.2.1 (January 8, 2020)
|
7
|
+
=========================
|
8
|
+
* Move proj_as_projjson from version 6.0 to 6.2 api (Charlie Savage)
|
9
|
+
* Improve search path generation code (Charlie Savage)
|
10
|
+
|
11
|
+
2.2.0 (January 7, 2020)
|
12
|
+
=========================
|
13
|
+
* Fix broken gem - was not including all api files (Jan Klimke)
|
14
|
+
* Add paths on MacOS when using Brew (Jan Klimke)
|
15
|
+
* Various code cleanups (Charlie Savage)
|
16
|
+
|
17
|
+
2.1.0 (January 5, 2020)
|
18
|
+
=========================
|
19
|
+
* Set Ruby 2.4.1 to be the minimum allowed version (Samuel Williams)
|
20
|
+
* Fix incorrect use of context, reduce warnings when running tests (Samuel Williams)
|
21
|
+
* Fix `bundle exec rake test` (Samuel Williams)
|
22
|
+
* Add 2.4.1 to the travis test matrix (Samuel Williams)
|
23
|
+
|
24
|
+
2.0.0 (December 30, 2019)
|
25
|
+
=========================
|
26
|
+
- Full rewrite to support API changes in Proj versions 5 and 6 (Charlie Savage)
|
27
|
+
- As part of rewrite switch bindings to use FFI versus a C extension (Charlie Savage)
|
28
|
+
- Split Ruby code into multiple files based on classes (Charlie Savage)
|
29
|
+
- Add in a bunch of new classes including Context, Crs, Coordinate, Ellipsoid, Prime Meridian and Transform (Charlie Savage)
|
30
|
+
- Deprecate Projection and Point - these will stop working with Proj 7 since the use an older deprecated API (Charlie Savage)
|
31
|
+
|
32
|
+
1.0.0 (December 14, 2014)
|
33
|
+
=========================
|
34
|
+
- Calling this 1.0.0 since its a very stable gem (Charlie Savage)
|
35
|
+
|
36
|
+
0.4.3 (August 30, 2011)
|
37
|
+
=========================
|
38
|
+
- Remove reference to now private projects.h header
|
39
|
+
|
40
|
+
0.4.2 (August 15, 2011)
|
41
|
+
=========================
|
42
|
+
- Minor build tweak to support MSVC++
|
43
|
+
|
44
|
+
0.4.1 (July 30, 2011)
|
45
|
+
=========================
|
46
|
+
- Search first for binaries when using windows gems
|
47
|
+
- Add # encoding to test files
|
48
|
+
- Reformat tests files to use standard ruby 2 space indenting
|
49
|
+
|
50
|
+
0.4.0 (July 30, 2011)
|
51
|
+
=========================
|
52
|
+
- Update to compile on Ruby 1.9.* (Fabio Renzo Panettieri)
|
53
|
+
- Add in gemspec file (Charlie Savage)
|
54
|
+
- Add rake-compiler as development dependency, remove older MinGW build system (Charlie Savage)
|
55
|
+
- Move to GitHub (Charlie Savage)
|
56
|
+
|
57
|
+
0.3.1 (December 23, 2009)
|
58
|
+
=========================
|
59
|
+
- Update extconf.conf file to be more flexible to make it easier to build
|
60
|
+
on OS X when using MacPorts
|
61
|
+
- Updated windows binary to link against proj4.7
|
62
|
+
|
63
|
+
0.3.0 (August 14, 2008)
|
64
|
+
=========================
|
65
|
+
- Removed Proj4::UV class which was previously deprecated
|
66
|
+
- New build infrastructure for Windows (Charlie Savage)
|
62
67
|
- Fixed memory leaks in forward() and inverse() methods (Charlie Savage)
|
data/Gemfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
source "https://rubygems.org"
|
2
|
-
|
3
|
-
# Specify your gem's dependencies in tensorflow-ruby.gemspec
|
4
|
-
gemspec
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in tensorflow-ruby.gemspec
|
4
|
+
gemspec
|
data/Rakefile
CHANGED
@@ -1,28 +1,28 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "rubygems"
|
4
|
-
require "rake/testtask"
|
5
|
-
require "rubygems/package_task"
|
6
|
-
require "yard"
|
7
|
-
require "yaml"
|
8
|
-
|
9
|
-
# Read the spec file
|
10
|
-
GEM_NAME = "proj4rb"
|
11
|
-
spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
|
12
|
-
|
13
|
-
# Setup generic gem
|
14
|
-
Gem::PackageTask.new(spec) do |pkg|
|
15
|
-
pkg.package_dir = 'pkg'
|
16
|
-
pkg.need_tar = false
|
17
|
-
end
|
18
|
-
|
19
|
-
# Yard Task
|
20
|
-
desc "Generate documentation"
|
21
|
-
YARD::Rake::YardocTask.new
|
22
|
-
|
23
|
-
# Test Task
|
24
|
-
Rake::TestTask.new do |t|
|
25
|
-
t.libs << "test"
|
26
|
-
t.test_files = FileList['test/*_test.rb']
|
27
|
-
t.verbose = true
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubygems"
|
4
|
+
require "rake/testtask"
|
5
|
+
require "rubygems/package_task"
|
6
|
+
require "yard"
|
7
|
+
require "yaml"
|
8
|
+
|
9
|
+
# Read the spec file
|
10
|
+
GEM_NAME = "proj4rb"
|
11
|
+
spec = Gem::Specification.load("#{GEM_NAME}.gemspec")
|
12
|
+
|
13
|
+
# Setup generic gem
|
14
|
+
Gem::PackageTask.new(spec) do |pkg|
|
15
|
+
pkg.package_dir = 'pkg'
|
16
|
+
pkg.need_tar = false
|
17
|
+
end
|
18
|
+
|
19
|
+
# Yard Task
|
20
|
+
desc "Generate documentation"
|
21
|
+
YARD::Rake::YardocTask.new
|
22
|
+
|
23
|
+
# Test Task
|
24
|
+
Rake::TestTask.new do |t|
|
25
|
+
t.libs << "test"
|
26
|
+
t.test_files = FileList['test/*_test.rb']
|
27
|
+
t.verbose = true
|
28
28
|
end
|
data/lib/api/api.rb
CHANGED
@@ -1,84 +1,111 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
1
|
+
require 'rbconfig'
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
module Proj
|
5
|
+
module Api
|
6
|
+
extend FFI::Library
|
7
|
+
|
8
|
+
def self.library_versions
|
9
|
+
[17, # 6.2 *and* 6.1
|
10
|
+
15, # 6.0
|
11
|
+
14, # 5.2
|
12
|
+
13, # 5.0
|
13
|
+
12, # 4.9
|
14
|
+
11] # 4.9
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.search_paths
|
18
|
+
result = case RbConfig::CONFIG['host_os']
|
19
|
+
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
20
|
+
self.windows_search_paths
|
21
|
+
when /darwin|mac os/
|
22
|
+
self.macos_search_paths
|
23
|
+
else
|
24
|
+
self.linux_search_paths
|
25
|
+
end
|
26
|
+
|
27
|
+
result << 'libproj'
|
28
|
+
result
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.windows_search_paths
|
32
|
+
self.library_versions.map do |version|
|
33
|
+
"libproj-#{version}"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.linux_search_paths
|
38
|
+
self.library_versions.map do |version|
|
39
|
+
"libproj.so.#{version}"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.macos_search_paths
|
44
|
+
# Mac Ports
|
45
|
+
paths1 = self.library_versions.map do |version|
|
46
|
+
case version
|
47
|
+
when 15..17
|
48
|
+
"/opt/local/lib/proj6/lib/libproj.#{version}.dylib"
|
49
|
+
when 13..14
|
50
|
+
"/opt/local/lib/proj5/lib/libproj.#{version}.dylib"
|
51
|
+
when 11..12
|
52
|
+
"/opt/local/lib/proj49/lib/libproj.#{version}.dylib"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Mac HomeBrew
|
57
|
+
paths2 = self.library_versions.map do |version|
|
58
|
+
"/usr/local/lib/libproj.#{version}.dylib"
|
59
|
+
end
|
60
|
+
|
61
|
+
paths1 + paths2
|
62
|
+
end
|
63
|
+
|
64
|
+
ffi_lib self.search_paths
|
65
|
+
|
66
|
+
# Load the old deprecated api - supported by all Proj versions (until Proj 7!)
|
67
|
+
require_relative './api_4_9'
|
68
|
+
|
69
|
+
library = ffi_libraries.first
|
70
|
+
|
71
|
+
# proj_info was introduced in Proj 5
|
72
|
+
if library.find_function('proj_info')
|
73
|
+
require_relative './api_5_0'
|
74
|
+
PROJ_VERSION = Gem::Version.new(self.proj_info[:version])
|
75
|
+
else
|
76
|
+
release = self.pj_get_release
|
77
|
+
version = release.match(/\d\.\d\.\d/)
|
78
|
+
PROJ_VERSION = Gem::Version.new(version)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
if Api::PROJ_VERSION < Gem::Version.new('5.0.0')
|
83
|
+
def Api.proj_torad(value)
|
84
|
+
value * 0.017453292519943296
|
85
|
+
end
|
86
|
+
|
87
|
+
def Api.proj_todeg(value)
|
88
|
+
value * 57.295779513082321
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
if Api::PROJ_VERSION >= Gem::Version.new('5.1.0')
|
93
|
+
require_relative './api_5_1'
|
94
|
+
end
|
95
|
+
|
96
|
+
if Api::PROJ_VERSION >= Gem::Version.new('5.2.0')
|
97
|
+
require_relative './api_5_2'
|
98
|
+
end
|
99
|
+
|
100
|
+
if Api::PROJ_VERSION >= Gem::Version.new('6.0.0')
|
101
|
+
require_relative './api_6_0'
|
102
|
+
end
|
103
|
+
|
104
|
+
if Api::PROJ_VERSION >= Gem::Version.new('6.1.0')
|
105
|
+
require_relative './api_6_1'
|
106
|
+
end
|
107
|
+
|
108
|
+
if Api::PROJ_VERSION >= Gem::Version.new('6.2.0')
|
109
|
+
require_relative './api_6_2'
|
110
|
+
end
|
84
111
|
end
|
data/lib/api/api_4_9.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
|
-
module Proj
|
2
|
-
module Api
|
3
|
-
######### Deprecated API from proj_api.h. Don't use these anymore! ##############
|
4
|
-
typedef :pointer, :projPJ
|
5
|
-
|
6
|
-
class ProjUV < FFI::Struct
|
7
|
-
layout :u, :double,
|
8
|
-
:v, :double
|
9
|
-
end
|
10
|
-
|
11
|
-
ProjXY = ProjUV
|
12
|
-
ProjLP = ProjUV
|
13
|
-
|
14
|
-
attach_function :pj_init, [:int, :pointer], :projPJ
|
15
|
-
attach_function :pj_free, [:projPJ], :void
|
16
|
-
|
17
|
-
attach_function :pj_get_release, [], :string
|
18
|
-
attach_function :pj_set_searchpath, [:int, :pointer], :void
|
19
|
-
|
20
|
-
attach_function :pj_get_errno_ref, [], :pointer
|
21
|
-
attach_function :pj_strerrno, [:int], :string
|
22
|
-
|
23
|
-
attach_function :pj_get_def, [:projPJ, :int], :string
|
24
|
-
attach_function :pj_is_latlong, [:projPJ], :bool
|
25
|
-
attach_function :pj_is_geocent, [:projPJ], :bool
|
26
|
-
|
27
|
-
attach_function :pj_fwd, [ProjLP.by_value, :projPJ], ProjXY.by_value
|
28
|
-
attach_function :pj_inv, [ProjXY.by_value, :projPJ], ProjLP.by_value
|
29
|
-
attach_function :pj_transform, [:projPJ, :projPJ, :long, :int, :pointer, :pointer, :pointer], :bool
|
30
|
-
end
|
1
|
+
module Proj
|
2
|
+
module Api
|
3
|
+
######### Deprecated API from proj_api.h. Don't use these anymore! ##############
|
4
|
+
typedef :pointer, :projPJ
|
5
|
+
|
6
|
+
class ProjUV < FFI::Struct
|
7
|
+
layout :u, :double,
|
8
|
+
:v, :double
|
9
|
+
end
|
10
|
+
|
11
|
+
ProjXY = ProjUV
|
12
|
+
ProjLP = ProjUV
|
13
|
+
|
14
|
+
attach_function :pj_init, [:int, :pointer], :projPJ
|
15
|
+
attach_function :pj_free, [:projPJ], :void
|
16
|
+
|
17
|
+
attach_function :pj_get_release, [], :string
|
18
|
+
attach_function :pj_set_searchpath, [:int, :pointer], :void
|
19
|
+
|
20
|
+
attach_function :pj_get_errno_ref, [], :pointer
|
21
|
+
attach_function :pj_strerrno, [:int], :string
|
22
|
+
|
23
|
+
attach_function :pj_get_def, [:projPJ, :int], :string
|
24
|
+
attach_function :pj_is_latlong, [:projPJ], :bool
|
25
|
+
attach_function :pj_is_geocent, [:projPJ], :bool
|
26
|
+
|
27
|
+
attach_function :pj_fwd, [ProjLP.by_value, :projPJ], ProjXY.by_value
|
28
|
+
attach_function :pj_inv, [ProjXY.by_value, :projPJ], ProjLP.by_value
|
29
|
+
attach_function :pj_transform, [:projPJ, :projPJ, :long, :int, :pointer, :pointer, :pointer], :bool
|
30
|
+
end
|
31
31
|
end
|