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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e159814e14a3d1aabbf8f092eb5dd8a507e1f4bd61d016a6e409f75db89ca961
4
- data.tar.gz: 2ee9e34d84e7a148770beb24d2dff0666c4be80722e602849ae277b084e39e0a
3
+ metadata.gz: ec1833a8b87e9d94521de30e1179f81f6cf04896c1200ce1949df372ed68b3c9
4
+ data.tar.gz: 192835632d10989b94df05a038c17595c4735787bb6a0d8dde7edb55a60e0948
5
5
  SHA512:
6
- metadata.gz: 27545786f9a350a0256a9191a2d15fc49843acffc2093b88d58f861bcbc15c2f95ab018e7625fdcf3f80fb8f077c02c24f82ccf7ee40232d976a4bad82593fc9
7
- data.tar.gz: 3f56592e59d06ff1a9e74a240e6502504c2899451d06603ae129775e254d669535e6a4b270c20737a348161dc253fbb1c503f4c8aa34a9434aba798367a7b1f8
6
+ metadata.gz: 8dd8fa60741b1db78714fd63c496d33ad07439c7bf248bdffee0ecbe96f299dcb6527dc22eb014c8ee3024ae91094ebad3cb39df293438a759e704aa818677dc
7
+ data.tar.gz: 252a6e5efd3fd85f136a281dc69d82f9993d630b0c5b7d4fbfe67739af1dd7cb19d4c863deb81dd8a5ec0a7c71c45cdcedfe8092feba267b85775eb77013bcae
data/ChangeLog CHANGED
@@ -1,62 +1,67 @@
1
- 2.2.1 (January 8, 2020)
2
- =========================
3
- * Move proj_as_projjson from version 6.0 to 6.2 api (Charlie Savage)
4
- * Improve search path generation code (Charlie Savage)
5
-
6
- 2.2.0 (January 7, 2020)
7
- =========================
8
- * Fix broken gem - was not including all api files (Jan Klimke)
9
- * Add paths on MacOS when using Brew (Jan Klimke)
10
- * Various code cleanups (Charlie Savage)
11
-
12
- 2.1.0 (January 5, 2020)
13
- =========================
14
- * Set Ruby 2.4.1 to be the minimum allowed version (Samuel Williams)
15
- * Fix incorrect use of context, reduce warnings when running tests (Samuel Williams)
16
- * Fix `bundle exec rake test` (Samuel Williams)
17
- * Add 2.4.1 to the travis test matrix (Samuel Williams)
18
-
19
- 2.0.0 (December 30, 2019)
20
- =========================
21
- - Full rewrite to support API changes in Proj versions 5 and 6 (Charlie Savage)
22
- - As part of rewrite switch bindings to use FFI versus a C extension (Charlie Savage)
23
- - Split Ruby code into multiple files based on classes (Charlie Savage)
24
- - Add in a bunch of new classes including Context, Crs, Coordinate, Ellipsoid, Prime Meridian and Transform (Charlie Savage)
25
- - Deprecate Projection and Point - these will stop working with Proj 7 since the use an older deprecated API (Charlie Savage)
26
-
27
- 1.0.0 (December 14, 2014)
28
- =========================
29
- - Calling this 1.0.0 since its a very stable gem (Charlie Savage)
30
-
31
- 0.4.3 (August 30, 2011)
32
- =========================
33
- - Remove reference to now private projects.h header
34
-
35
- 0.4.2 (August 15, 2011)
36
- =========================
37
- - Minor build tweak to support MSVC++
38
-
39
- 0.4.1 (July 30, 2011)
40
- =========================
41
- - Search first for binaries when using windows gems
42
- - Add # encoding to test files
43
- - Reformat tests files to use standard ruby 2 space indenting
44
-
45
- 0.4.0 (July 30, 2011)
46
- =========================
47
- - Update to compile on Ruby 1.9.* (Fabio Renzo Panettieri)
48
- - Add in gemspec file (Charlie Savage)
49
- - Add rake-compiler as development dependency, remove older MinGW build system (Charlie Savage)
50
- - Move to GitHub (Charlie Savage)
51
-
52
- 0.3.1 (December 23, 2009)
53
- =========================
54
- - Update extconf.conf file to be more flexible to make it easier to build
55
- on OS X when using MacPorts
56
- - Updated windows binary to link against proj4.7
57
-
58
- 0.3.0 (August 14, 2008)
59
- =========================
60
- - Removed Proj4::UV class which was previously deprecated
61
- - New build infrastructure for Windows (Charlie Savage)
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
@@ -1,84 +1,111 @@
1
- require 'ffi'
2
-
3
- module Proj
4
- module Api
5
- extend FFI::Library
6
-
7
- proj_library_versions = {'proj6' => 15,
8
- 'proj5' => 13,
9
- 'proj49' => 12}
10
-
11
- file_patterns = ["libproj-%d", # Mingw64
12
- "libproj.so.%d", # Linux
13
- "/opt/local/lib/%s/lib/libproj.%d.dylib", # Macports
14
- "/usr/local/lib/libproj.%d.dylib"] # Mac HomeBrew
15
-
16
- search_paths = file_patterns.map do |file_pattern|
17
- proj_library_versions.map do |proj_version, proj_library_version|
18
- formats = file_pattern.count("%") == 1 ? [proj_library_version] : [proj_version, proj_library_version]
19
- file_pattern % formats
20
- end
21
- end.flatten
22
-
23
- # Generates this array
24
- # [0] = "libproj-15"
25
- # [1] = "libproj-13"
26
- # [2] = "libproj-12"
27
- # [3] = "libproj.so.15"
28
- # [4] = "libproj.so.13"
29
- # [5] = "libproj.so.12"
30
- # [6] = "/opt/local/lib/proj6/lib/libproj.15.dylib"
31
- # [7] = "/opt/local/lib/proj5/lib/libproj.13.dylib"
32
- # [8] = "/opt/local/lib/proj49/lib/libproj.12.dylib"
33
- # [9] = "/usr/local/lib/libproj.15.dylib"
34
- # [10] = "/usr/local/lib/libproj.13.dylib"
35
- # [11] = "/usr/local/lib/libproj.12.dylib"
36
-
37
- ffi_lib search_paths
38
-
39
- # Load the old deprecated api - supported by all Proj versions (until Proj 7!)
40
- require_relative './api_4_9'
41
-
42
- library = ffi_libraries.first
43
-
44
- # proj_info was introduced in Proj 5
45
- if library.find_function('proj_info')
46
- require_relative './api_5_0'
47
- PROJ_VERSION = Gem::Version.new(self.proj_info[:version])
48
- else
49
- release = self.pj_get_release
50
- version = release.match(/\d\.\d\.\d/)
51
- PROJ_VERSION = Gem::Version.new(version)
52
- end
53
- end
54
-
55
- if Api::PROJ_VERSION < Gem::Version.new('5.0.0')
56
- def Api.proj_torad(value)
57
- value * 0.017453292519943296
58
- end
59
-
60
- def Api.proj_todeg(value)
61
- value * 57.295779513082321
62
- end
63
- end
64
-
65
- if Api::PROJ_VERSION >= Gem::Version.new('5.1.0')
66
- require_relative './api_5_1'
67
- end
68
-
69
- if Api::PROJ_VERSION >= Gem::Version.new('5.2.0')
70
- require_relative './api_5_2'
71
- end
72
-
73
- if Api::PROJ_VERSION >= Gem::Version.new('6.0.0')
74
- require_relative './api_6_0'
75
- end
76
-
77
- if Api::PROJ_VERSION >= Gem::Version.new('6.1.0')
78
- require_relative './api_6_1'
79
- end
80
-
81
- if Api::PROJ_VERSION >= Gem::Version.new('6.2.0')
82
- require_relative './api_6_2'
83
- end
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
@@ -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