proj4rb 2.2.2 → 3.0.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/ChangeLog +71 -66
- data/Gemfile +4 -4
- data/README.rdoc +5 -6
- data/Rakefile +27 -27
- data/lib/api/api.rb +11 -4
- data/lib/api/api_6_0.rb +1 -1
- data/lib/{area.rb → proj/area.rb} +0 -0
- data/lib/{config.rb → proj/config.rb} +0 -0
- data/lib/{context.rb → proj/context.rb} +0 -0
- data/lib/{coordinate.rb → proj/coordinate.rb} +0 -0
- data/lib/{crs.rb → proj/crs.rb} +0 -0
- data/lib/{ellipsoid.rb → proj/ellipsoid.rb} +0 -0
- data/lib/{error.rb → proj/error.rb} +0 -0
- data/lib/{operation.rb → proj/operation.rb} +0 -0
- data/lib/{pj_object.rb → proj/pj_object.rb} +0 -0
- data/lib/{point.rb → proj/point.rb} +0 -0
- data/lib/{prime_meridian.rb → proj/prime_meridian.rb} +0 -0
- data/lib/{projection.rb → proj/projection.rb} +0 -0
- data/lib/{transformation.rb → proj/transformation.rb} +0 -0
- data/lib/{unit.rb → proj/unit.rb} +0 -0
- data/lib/proj.rb +15 -15
- data/proj4rb.gemspec +32 -32
- data/test/abstract_test.rb +7 -7
- 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 +225 -223
- data/test/transformation_test.rb +67 -67
- data/test/unit_test.rb +47 -47
- metadata +21 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d2946731ccd3cf4e96e214fce1e8e3c7fc46313f5f1d1fcc119c84e9b88f26f
|
4
|
+
data.tar.gz: 17ca8b08ed1b03be5d910ba77013b7028d88e45160b352764619799f7f156887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a23e8938aa5d6289dabe4b1f0e5ad2aa204281f6ff2f0073fcbc20b6d404bc6b265120cb0c22561ad68338248a16959fd36873777cdbe7ebae4cbf86258ad2f
|
7
|
+
data.tar.gz: 78b42798c55214f7d73df85575b5d6a4a64283ab51583656a9441a725c369fde5a7b12c36944a8dd0a66c67bdf9ef6b48e189e34a3c6d280f11e0adca4116835
|
data/ChangeLog
CHANGED
@@ -1,67 +1,72 @@
|
|
1
|
-
|
2
|
-
=========================
|
3
|
-
*
|
4
|
-
*
|
5
|
-
|
6
|
-
2.2.
|
7
|
-
=========================
|
8
|
-
* Move
|
9
|
-
* Improve search path generation code (Charlie Savage)
|
10
|
-
|
11
|
-
2.2.
|
12
|
-
=========================
|
13
|
-
*
|
14
|
-
*
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
*
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
2.
|
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
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
-
|
1
|
+
3.0.0 (September 26, 2021)
|
2
|
+
=========================
|
3
|
+
* Support Proj 8 which removes the old Proj API (Charlie Savage)
|
4
|
+
* Support newer versions of FFI which remove support for returning strings from callbacks (Charlie Savage)
|
5
|
+
|
6
|
+
2.2.2 (January 10, 2020)
|
7
|
+
=========================
|
8
|
+
* Move proj_context_set_autoclose_database to api 6.2 (Jan Klimke)
|
9
|
+
* Improve search path generation code (Charlie Savage)
|
10
|
+
|
11
|
+
2.2.1 (January 8, 2020)
|
12
|
+
=========================
|
13
|
+
* Move proj_as_projjson from version 6.0 to 6.2 api (Charlie Savage)
|
14
|
+
* Improve search path generation code (Charlie Savage)
|
15
|
+
|
16
|
+
2.2.0 (January 7, 2020)
|
17
|
+
=========================
|
18
|
+
* Fix broken gem - was not including all api files (Jan Klimke)
|
19
|
+
* Add paths on MacOS when using Brew (Jan Klimke)
|
20
|
+
* Various code cleanups (Charlie Savage)
|
21
|
+
|
22
|
+
2.1.0 (January 5, 2020)
|
23
|
+
=========================
|
24
|
+
* Set Ruby 2.4.1 to be the minimum allowed version (Samuel Williams)
|
25
|
+
* Fix incorrect use of context, reduce warnings when running tests (Samuel Williams)
|
26
|
+
* Fix `bundle exec rake test` (Samuel Williams)
|
27
|
+
* Add 2.4.1 to the travis test matrix (Samuel Williams)
|
28
|
+
|
29
|
+
2.0.0 (December 30, 2019)
|
30
|
+
=========================
|
31
|
+
- Full rewrite to support API changes in Proj versions 5 and 6 (Charlie Savage)
|
32
|
+
- As part of rewrite switch bindings to use FFI versus a C extension (Charlie Savage)
|
33
|
+
- Split Ruby code into multiple files based on classes (Charlie Savage)
|
34
|
+
- Add in a bunch of new classes including Context, Crs, Coordinate, Ellipsoid, Prime Meridian and Transform (Charlie Savage)
|
35
|
+
- Deprecate Projection and Point - these will stop working with Proj 7 since the use an older deprecated API (Charlie Savage)
|
36
|
+
|
37
|
+
1.0.0 (December 14, 2014)
|
38
|
+
=========================
|
39
|
+
- Calling this 1.0.0 since its a very stable gem (Charlie Savage)
|
40
|
+
|
41
|
+
0.4.3 (August 30, 2011)
|
42
|
+
=========================
|
43
|
+
- Remove reference to now private projects.h header
|
44
|
+
|
45
|
+
0.4.2 (August 15, 2011)
|
46
|
+
=========================
|
47
|
+
- Minor build tweak to support MSVC++
|
48
|
+
|
49
|
+
0.4.1 (July 30, 2011)
|
50
|
+
=========================
|
51
|
+
- Search first for binaries when using windows gems
|
52
|
+
- Add # encoding to test files
|
53
|
+
- Reformat tests files to use standard ruby 2 space indenting
|
54
|
+
|
55
|
+
0.4.0 (July 30, 2011)
|
56
|
+
=========================
|
57
|
+
- Update to compile on Ruby 1.9.* (Fabio Renzo Panettieri)
|
58
|
+
- Add in gemspec file (Charlie Savage)
|
59
|
+
- Add rake-compiler as development dependency, remove older MinGW build system (Charlie Savage)
|
60
|
+
- Move to GitHub (Charlie Savage)
|
61
|
+
|
62
|
+
0.3.1 (December 23, 2009)
|
63
|
+
=========================
|
64
|
+
- Update extconf.conf file to be more flexible to make it easier to build
|
65
|
+
on OS X when using MacPorts
|
66
|
+
- Updated windows binary to link against proj4.7
|
67
|
+
|
68
|
+
0.3.0 (August 14, 2008)
|
69
|
+
=========================
|
70
|
+
- Removed Proj4::UV class which was previously deprecated
|
71
|
+
- New build infrastructure for Windows (Charlie Savage)
|
67
72
|
- 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/README.rdoc
CHANGED
@@ -24,8 +24,8 @@ If you are using the old Proj4 namespace, then you can do this:
|
|
24
24
|
require 'proj4'
|
25
25
|
|
26
26
|
=== Crs
|
27
|
-
If you are using Proj 6 create a coordinate system. To create a coordinate system, you can use CRS codes,
|
28
|
-
or old-style Proj4 strings (which are deprecated).
|
27
|
+
If you are using Proj 6, or newer, create a coordinate system. To create a coordinate system, you can use CRS codes,
|
28
|
+
well-known text (WKT) strings or old-style Proj4 strings (which are deprecated).
|
29
29
|
|
30
30
|
crs1 = Proj::Crs.new('EPSG:4326')
|
31
31
|
|
@@ -114,7 +114,7 @@ to using Context.current
|
|
114
114
|
|
115
115
|
=== Projection
|
116
116
|
If you are using Proj 4, then instead of using Coordinates, Crses and Tranformations you need to us Points and Projections.
|
117
|
-
Those are deprecated classes but will continue to work
|
117
|
+
Those are deprecated classes but will continue to work with Proj version 7 and older. Please refer to the documentation
|
118
118
|
for more information.
|
119
119
|
|
120
120
|
== Error handling
|
@@ -136,9 +136,8 @@ https://proj.org/development/migration.html. Note that the gem should gracefully
|
|
136
136
|
the version of Proj you are using.
|
137
137
|
|
138
138
|
To ensure backwards compatiblity, the Ruby bindings still include the older Point and Projection
|
139
|
-
classes. However, these classes are no longer documented in this Readme because
|
140
|
-
|
141
|
-
So please port your code! But take note of the changes in Proj 6 described below.
|
139
|
+
classes. However, these classes are no longer documented in this Readme because the underlying API
|
140
|
+
they rely on was removed in Proj 8. So please port your code! But take note of the changes in Proj 6 described below.
|
142
141
|
|
143
142
|
Proj 5 introduced the Coordinate, Crs and Tranformation APIs. However, it wasn't until Proj 6 that additional
|
144
143
|
metadata APIs were added, so the amount of information about each object is somewhat limited in Proj 5.
|
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
@@ -6,7 +6,9 @@ module Proj
|
|
6
6
|
extend FFI::Library
|
7
7
|
|
8
8
|
def self.library_versions
|
9
|
-
[
|
9
|
+
[22, # 8.0 and 8.1
|
10
|
+
19, # 7.x
|
11
|
+
17, # 6.2 *and* 6.1
|
10
12
|
15, # 6.0
|
11
13
|
14, # 5.2
|
12
14
|
13, # 5.0
|
@@ -63,9 +65,6 @@ module Proj
|
|
63
65
|
|
64
66
|
ffi_lib self.search_paths
|
65
67
|
|
66
|
-
# Load the old deprecated api - supported by all Proj versions (until Proj 7!)
|
67
|
-
require_relative './api_4_9'
|
68
|
-
|
69
68
|
library = ffi_libraries.first
|
70
69
|
|
71
70
|
# proj_info was introduced in Proj 5
|
@@ -73,6 +72,9 @@ module Proj
|
|
73
72
|
require_relative './api_5_0'
|
74
73
|
PROJ_VERSION = Gem::Version.new(self.proj_info[:version])
|
75
74
|
else
|
75
|
+
# Load the old deprecated api
|
76
|
+
require_relative './api_4_9'
|
77
|
+
|
76
78
|
release = self.pj_get_release
|
77
79
|
version = release.match(/\d\.\d\.\d/)
|
78
80
|
PROJ_VERSION = Gem::Version.new(version)
|
@@ -89,6 +91,11 @@ module Proj
|
|
89
91
|
end
|
90
92
|
end
|
91
93
|
|
94
|
+
# Load the old deprecated API for versions before version 8
|
95
|
+
if Api::PROJ_VERSION < Gem::Version.new('8.0.0')
|
96
|
+
require_relative './api_4_9'
|
97
|
+
end
|
98
|
+
|
92
99
|
if Api::PROJ_VERSION >= Gem::Version.new('5.1.0')
|
93
100
|
require_relative './api_5_1'
|
94
101
|
end
|
data/lib/api/api_6_0.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Proj
|
2
2
|
module Api
|
3
|
-
callback :proj_file_finder, [:PJ_CONTEXT, :string, :pointer], :
|
3
|
+
callback :proj_file_finder, [:PJ_CONTEXT, :string, :pointer], :pointer
|
4
4
|
attach_function :proj_context_set_file_finder, [:PJ_CONTEXT, :proj_file_finder, :pointer], :void
|
5
5
|
attach_function :proj_context_set_search_paths, [:PJ_CONTEXT, :int, :pointer], :void
|
6
6
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/{crs.rb → proj/crs.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/proj.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
3
|
require_relative 'api/api'
|
4
|
-
require_relative '
|
4
|
+
require_relative 'proj/config'
|
5
5
|
|
6
|
-
require_relative '
|
7
|
-
require_relative '
|
8
|
-
require_relative '
|
9
|
-
require_relative '
|
10
|
-
require_relative '
|
11
|
-
require_relative '
|
12
|
-
require_relative '
|
13
|
-
require_relative '
|
6
|
+
require_relative 'proj/area'
|
7
|
+
require_relative 'proj/context'
|
8
|
+
require_relative 'proj/coordinate'
|
9
|
+
require_relative 'proj/ellipsoid'
|
10
|
+
require_relative 'proj/error'
|
11
|
+
require_relative 'proj/point'
|
12
|
+
require_relative 'proj/prime_meridian'
|
13
|
+
require_relative 'proj/unit'
|
14
14
|
|
15
|
-
require_relative '
|
16
|
-
require_relative '
|
17
|
-
require_relative '
|
18
|
-
require_relative '
|
19
|
-
require_relative '
|
15
|
+
require_relative 'proj/pj_object'
|
16
|
+
require_relative 'proj/operation'
|
17
|
+
require_relative 'proj/crs'
|
18
|
+
require_relative 'proj/projection'
|
19
|
+
require_relative 'proj/transformation'
|
20
20
|
|
21
21
|
module Proj
|
22
22
|
def self.info
|
@@ -28,4 +28,4 @@ module Proj
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
Proj::Config.instance.set_search_paths
|
31
|
+
Proj::Config.instance.set_search_paths
|
data/proj4rb.gemspec
CHANGED
@@ -1,33 +1,33 @@
|
|
1
|
-
Gem::Specification.new do |spec|
|
2
|
-
spec.name = 'proj4rb'
|
3
|
-
spec.version = '
|
4
|
-
spec.summary = 'Ruby bindings for the Proj.4 Carthographic Projection library'
|
5
|
-
spec.description = <<-EOF
|
6
|
-
Proj4rb is a ruby binding for the Proj.4 Carthographic Projection library, that supports conversions between a very large number of geographic coordinate systems and datumspec.
|
7
|
-
EOF
|
8
|
-
spec.platform = Gem::Platform::RUBY
|
9
|
-
spec.authors = ['Guilhem Vellut', 'Jochen Topf', 'Charlie Savage']
|
10
|
-
spec.homepage = 'https://github.com/cfis/proj4rb'
|
11
|
-
spec.required_ruby_version = '>= 2.4.1'
|
12
|
-
spec.license = 'MIT'
|
13
|
-
|
14
|
-
spec.requirements << 'Proj (Proj4) Library'
|
15
|
-
spec.require_path = 'lib'
|
16
|
-
spec.files = Dir['ChangeLog',
|
17
|
-
'Gemfile',
|
18
|
-
'MIT-LICENSE',
|
19
|
-
'proj4rb.gemspec',
|
20
|
-
'Rakefile',
|
21
|
-
'README.rdoc',
|
22
|
-
'lib/**/*.rb',
|
23
|
-
'test/*.rb']
|
24
|
-
|
25
|
-
spec.test_files = Dir["test/test_*.rb"]
|
26
|
-
|
27
|
-
spec.add_dependency "ffi"
|
28
|
-
|
29
|
-
spec.add_development_dependency('bundler')
|
30
|
-
spec.add_development_dependency('rake')
|
31
|
-
spec.add_development_dependency('minitest')
|
32
|
-
spec.add_development_dependency('yard')
|
1
|
+
Gem::Specification.new do |spec|
|
2
|
+
spec.name = 'proj4rb'
|
3
|
+
spec.version = '3.0.0'
|
4
|
+
spec.summary = 'Ruby bindings for the Proj.4 Carthographic Projection library'
|
5
|
+
spec.description = <<-EOF
|
6
|
+
Proj4rb is a ruby binding for the Proj.4 Carthographic Projection library, that supports conversions between a very large number of geographic coordinate systems and datumspec.
|
7
|
+
EOF
|
8
|
+
spec.platform = Gem::Platform::RUBY
|
9
|
+
spec.authors = ['Guilhem Vellut', 'Jochen Topf', 'Charlie Savage']
|
10
|
+
spec.homepage = 'https://github.com/cfis/proj4rb'
|
11
|
+
spec.required_ruby_version = '>= 2.4.1'
|
12
|
+
spec.license = 'MIT'
|
13
|
+
|
14
|
+
spec.requirements << 'Proj (Proj4) Library'
|
15
|
+
spec.require_path = 'lib'
|
16
|
+
spec.files = Dir['ChangeLog',
|
17
|
+
'Gemfile',
|
18
|
+
'MIT-LICENSE',
|
19
|
+
'proj4rb.gemspec',
|
20
|
+
'Rakefile',
|
21
|
+
'README.rdoc',
|
22
|
+
'lib/**/*.rb',
|
23
|
+
'test/*.rb']
|
24
|
+
|
25
|
+
spec.test_files = Dir["test/test_*.rb"]
|
26
|
+
|
27
|
+
spec.add_dependency "ffi"
|
28
|
+
|
29
|
+
spec.add_development_dependency('bundler')
|
30
|
+
spec.add_development_dependency('rake')
|
31
|
+
spec.add_development_dependency('minitest')
|
32
|
+
spec.add_development_dependency('yard')
|
33
33
|
end
|
data/test/abstract_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
require 'proj'
|
4
|
-
|
5
|
-
class AbstractTest < Minitest::Test
|
6
|
-
end
|
7
|
-
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'minitest/autorun'
|
3
|
+
require 'proj'
|
4
|
+
|
5
|
+
class AbstractTest < Minitest::Test
|
6
|
+
end
|
7
|
+
|
data/test/coordinate_test.rb
CHANGED
@@ -1,35 +1,35 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
require_relative './abstract_test'
|
4
|
-
|
5
|
-
class CoordinateTest < AbstractTest
|
6
|
-
def test_create_xyzt
|
7
|
-
coord = Proj::Coordinate.new(:x => 1, :y => 2, :z => 3, :t => 4)
|
8
|
-
assert_equal('v0: 1.0, v1: 2.0, v2: 3.0, v3: 4.0', coord.to_s)
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_create_uvwt
|
12
|
-
coord = Proj::Coordinate.new(:u => 5, :v => 6, :w => 7, :t => 8)
|
13
|
-
assert_equal('v0: 5.0, v1: 6.0, v2: 7.0, v3: 8.0', coord.to_s)
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_create_lpzt
|
17
|
-
coord = Proj::Coordinate.new(:lam => 9, :phi => 10, :z => 11, :t => 12)
|
18
|
-
assert_equal('v0: 9.0, v1: 10.0, v2: 11.0, v3: 12.0', coord.to_s)
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_create_geod
|
22
|
-
coord = Proj::Coordinate.new(:s => 13, :a1 => 14, :a2 => 15)
|
23
|
-
assert_equal('v0: 13.0, v1: 14.0, v2: 15.0, v3: 0.0', coord.to_s)
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_create_opk
|
27
|
-
coord = Proj::Coordinate.new(:o => 16, :p => 17, :k => 18)
|
28
|
-
assert_equal('v0: 16.0, v1: 17.0, v2: 18.0, v3: 0.0', coord.to_s)
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_create_enu
|
32
|
-
coord = Proj::Coordinate.new(:e => 19, :n => 20, :u => 21)
|
33
|
-
assert_equal('v0: 19.0, v1: 20.0, v2: 21.0, v3: 0.0', coord.to_s)
|
34
|
-
end
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative './abstract_test'
|
4
|
+
|
5
|
+
class CoordinateTest < AbstractTest
|
6
|
+
def test_create_xyzt
|
7
|
+
coord = Proj::Coordinate.new(:x => 1, :y => 2, :z => 3, :t => 4)
|
8
|
+
assert_equal('v0: 1.0, v1: 2.0, v2: 3.0, v3: 4.0', coord.to_s)
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_create_uvwt
|
12
|
+
coord = Proj::Coordinate.new(:u => 5, :v => 6, :w => 7, :t => 8)
|
13
|
+
assert_equal('v0: 5.0, v1: 6.0, v2: 7.0, v3: 8.0', coord.to_s)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_create_lpzt
|
17
|
+
coord = Proj::Coordinate.new(:lam => 9, :phi => 10, :z => 11, :t => 12)
|
18
|
+
assert_equal('v0: 9.0, v1: 10.0, v2: 11.0, v3: 12.0', coord.to_s)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_create_geod
|
22
|
+
coord = Proj::Coordinate.new(:s => 13, :a1 => 14, :a2 => 15)
|
23
|
+
assert_equal('v0: 13.0, v1: 14.0, v2: 15.0, v3: 0.0', coord.to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_create_opk
|
27
|
+
coord = Proj::Coordinate.new(:o => 16, :p => 17, :k => 18)
|
28
|
+
assert_equal('v0: 16.0, v1: 17.0, v2: 18.0, v3: 0.0', coord.to_s)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_create_enu
|
32
|
+
coord = Proj::Coordinate.new(:e => 19, :n => 20, :u => 21)
|
33
|
+
assert_equal('v0: 19.0, v1: 20.0, v2: 21.0, v3: 0.0', coord.to_s)
|
34
|
+
end
|
35
35
|
end
|