proj4rb 3.0.0 → 4.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.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +26 -15
  3. data/README.rdoc +82 -44
  4. data/Rakefile +27 -27
  5. data/lib/api/api.rb +96 -118
  6. data/lib/api/api_5_0.rb +331 -300
  7. data/lib/api/api_5_1.rb +6 -6
  8. data/lib/api/api_5_2.rb +4 -4
  9. data/lib/api/api_6_0.rb +116 -14
  10. data/lib/api/api_6_1.rb +4 -4
  11. data/lib/api/api_6_2.rb +9 -6
  12. data/lib/api/api_6_3.rb +6 -0
  13. data/lib/api/api_7_0.rb +68 -0
  14. data/lib/api/api_7_1.rb +73 -0
  15. data/lib/api/api_7_2.rb +14 -0
  16. data/lib/api/api_8_0.rb +6 -0
  17. data/lib/api/api_8_1.rb +24 -0
  18. data/lib/api/api_8_2.rb +6 -0
  19. data/lib/api/api_9_1.rb +7 -0
  20. data/lib/api/api_9_2.rb +9 -0
  21. data/lib/api/api_experimental.rb +196 -0
  22. data/lib/proj/area.rb +73 -32
  23. data/lib/proj/axis_info.rb +44 -0
  24. data/lib/proj/bounds.rb +13 -0
  25. data/lib/proj/context.rb +174 -28
  26. data/lib/proj/conversion.rb +92 -0
  27. data/lib/proj/coordinate.rb +281 -197
  28. data/lib/proj/coordinate_operation_mixin.rb +381 -0
  29. data/lib/proj/coordinate_system.rb +137 -0
  30. data/lib/proj/crs.rb +672 -204
  31. data/lib/proj/crs_info.rb +47 -0
  32. data/lib/proj/database.rb +305 -0
  33. data/lib/proj/datum.rb +32 -0
  34. data/lib/proj/datum_ensemble.rb +34 -0
  35. data/lib/proj/ellipsoid.rb +77 -41
  36. data/lib/proj/error.rb +62 -9
  37. data/lib/proj/file_api.rb +166 -0
  38. data/lib/proj/grid.rb +121 -0
  39. data/lib/proj/grid_cache.rb +64 -0
  40. data/lib/proj/grid_info.rb +19 -0
  41. data/lib/proj/network_api.rb +92 -0
  42. data/lib/proj/operation.rb +42 -42
  43. data/lib/proj/operation_factory_context.rb +136 -0
  44. data/lib/proj/parameter.rb +38 -0
  45. data/lib/proj/parameters.rb +106 -0
  46. data/lib/proj/pj_object.rb +670 -80
  47. data/lib/proj/pj_objects.rb +44 -0
  48. data/lib/proj/prime_meridian.rb +65 -39
  49. data/lib/proj/projection.rb +698 -207
  50. data/lib/proj/session.rb +46 -0
  51. data/lib/proj/strings.rb +32 -0
  52. data/lib/proj/transformation.rb +101 -60
  53. data/lib/proj/unit.rb +108 -53
  54. data/lib/proj.rb +110 -9
  55. data/proj4rb.gemspec +5 -5
  56. data/test/abstract_test.rb +23 -1
  57. data/test/context_test.rb +172 -82
  58. data/test/conversion_test.rb +368 -0
  59. data/test/coordinate_system_test.rb +144 -0
  60. data/test/crs_test.rb +770 -71
  61. data/test/database_test.rb +360 -0
  62. data/test/datum_ensemble_test.rb +65 -0
  63. data/test/datum_test.rb +55 -0
  64. data/test/ellipsoid_test.rb +64 -18
  65. data/test/file_api_test.rb +66 -0
  66. data/test/grid_cache_test.rb +72 -0
  67. data/test/grid_test.rb +141 -0
  68. data/test/network_api_test.rb +45 -0
  69. data/test/operation_factory_context_test.rb +201 -0
  70. data/test/parameters_test.rb +40 -0
  71. data/test/pj_object_test.rb +179 -0
  72. data/test/prime_meridian_test.rb +76 -0
  73. data/test/proj_test.rb +46 -4
  74. data/test/projection_test.rb +646 -222
  75. data/test/session_test.rb +78 -0
  76. data/test/transformation_test.rb +149 -7
  77. data/test/unit_test.rb +57 -28
  78. metadata +51 -13
  79. data/lib/api/api_4_9.rb +0 -31
  80. data/lib/proj/config.rb +0 -70
  81. data/lib/proj/point.rb +0 -72
  82. data/test/prime_meridians_test.rb +0 -33
@@ -2,225 +2,649 @@
2
2
 
3
3
  require_relative './abstract_test'
4
4
 
5
- if Proj::Api::PROJ_VERSION < Gem::Version.new('8.0.0')
6
- class ProjectionTest < AbstractTest
7
- PRECISION = 0.1 ** 4
8
-
9
- def setup
10
- @proj_wgs84 = Proj::Projection.new(["init=epsg:4326"]) # WGS84
11
- @proj_gk = Proj::Projection.new(["+init=epsg:31467"]) # Gauss-Kruger Zone 3
12
- @proj_merc = Proj::Projection.new(["proj=merc"])
13
- @proj_conakry = Proj::Projection.new(["+init=epsg:31528"]) # Conakry 1905 / UTM zone 28N
14
- @proj_ortel = Proj::Projection.new(["+proj=ortel", "+lon_0=90w"]) # Ortelius Oval Projection
15
- @epsg2029i = ['+init=epsg:2029']
16
- @epsg2029_args = ['+proj=utm', '+zone=17', '+ellps=clrk66', '+units=m', '+no_defs']
17
- end
18
-
19
- def test_arg_fail
20
- assert_raises ArgumentError do
21
- Proj::Projection.parse()
22
- end
23
- assert_raises ArgumentError do
24
- Proj::Projection.parse(nil)
25
- end
26
- assert_raises ArgumentError do
27
- Proj::Projection.parse(1)
28
- end
29
- end
30
-
31
- def test_arg_string
32
- args = Proj::Projection.parse('+init=epsg:2029')
33
- assert_equal(@epsg2029i, args)
34
- args = Proj::Projection.parse(' +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs ')
35
- assert_equal(@epsg2029_args, args)
36
- end
37
-
38
- def test_arg_string_with_plus
39
- args = Proj::Projection.parse('+init=epsg:2029')
40
- assert_equal(@epsg2029i, args)
41
- args = Proj::Projection.parse('+proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs')
42
- assert_equal(@epsg2029_args, args)
43
- end
44
-
45
- def test_arg_array
46
- args = Proj::Projection.parse(['+init=epsg:2029'])
47
- assert_equal(@epsg2029i, args)
48
- args = Proj::Projection.parse(['+proj=utm', '+zone=17', '+ellps=clrk66', '+units=m', '+no_defs'])
49
- assert_equal(@epsg2029_args, args)
50
- end
51
-
52
- def test_arg_array_with_plus
53
- args = Proj::Projection.parse(['+init=epsg:2029'])
54
- assert_equal(@epsg2029i, args)
55
- args = Proj::Projection.parse(['+proj=utm', '+zone=17', '+ellps=clrk66', '+units=m', '+no_defs'])
56
- assert_equal(@epsg2029_args, args)
57
- end
58
-
59
- def test_arg_hash_with_string
60
- args = Proj::Projection.parse('init' => 'epsg:2029')
61
- assert_equal(@epsg2029i, args)
62
- args = Proj::Projection.parse('proj' => 'utm', 'zone' => '17', 'ellps' => 'clrk66', 'units' => 'm', 'no_defs' => nil)
63
- assert_equal(@epsg2029_args, args)
64
- end
65
-
66
- def test_arg_hash_with_symbol
67
- args = Proj::Projection.parse(:init => 'epsg:2029')
68
- assert_equal(@epsg2029i, args)
69
- args = Proj::Projection.parse(:proj => 'utm', :zone => '17', :ellps => 'clrk66', :units => 'm', :no_defs => nil)
70
- assert_equal(@epsg2029_args, args)
71
- end
72
-
73
- def test_arg_hash_with_symbol_simple
74
- args = Proj::Projection.parse(:init => 'epsg:2029')
75
- assert_equal(@epsg2029i, args)
76
- args = Proj::Projection.parse(:proj => 'utm', :zone => '17', :ellps => 'clrk66', :units => 'm', :no_defs => nil)
77
- assert_equal(@epsg2029_args, args)
78
- end
79
-
80
- def test_arg_projection
81
- proj = Proj::Projection.new(['+init=epsg:2029'])
82
- args = Proj::Projection.parse(proj)
83
- assert_equal(["+init=epsg:2029", "+proj=utm", "+zone=17", "+ellps=clrk66", "+units=m", "+no_defs"], args)
84
- end
85
-
86
- def test_init_arg_string
87
- proj = Proj::Projection.new('+init=epsg:2029')
88
- assert_equal(' +init=epsg:2029 +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs', proj.getDef)
89
- end
90
-
91
- def test_init_arg_array
92
- proj = Proj::Projection.new(['+init=epsg:2029'])
93
- assert_equal(' +init=epsg:2029 +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs', proj.getDef)
94
- end
95
-
96
- def test_init_arg_hash
97
- proj = Proj::Projection.new(:proj => 'utm', 'zone' => '17', 'ellps' => 'clrk66', :units => 'm', :no_defs => nil)
98
- assert_equal(' +proj=utm +zone=17 +ellps=clrk66 +units=m +no_defs', proj.getDef)
99
- end
100
-
101
- def test_init_arg_fail
102
- assert_raises Proj::Error do
103
- Proj::Projection.new(:proj => 'xxxx')
104
- end
105
-
106
- assert_raises Proj::Error do
107
- Proj::Projection.new(:foo => 'xxxx')
108
- end
109
- end
110
-
111
- def test_is_latlong
112
- assert(@proj_wgs84.isLatLong?)
113
- refute(@proj_gk.isLatLong?)
114
- refute(@proj_conakry.isLatLong?)
115
- refute(@proj_ortel.isLatLong?)
116
- end
117
-
118
- def test_is_geocent
119
- assert_equal(@proj_gk.isGeocent?, @proj_gk.isGeocentric?) # two names for same method
120
- refute(@proj_wgs84.isGeocent?)
121
- refute(@proj_gk.isGeocent?)
122
- refute(@proj_conakry.isGeocent?)
123
- refute(@proj_ortel.isGeocent?)
124
- end
125
-
126
- def test_get_def
127
- assert_equal(' +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0', @proj_wgs84.getDef)
128
- assert_equal(' +init=epsg:31467 +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +no_defs', @proj_gk.getDef)
129
- assert_equal('+proj=ortel +lon_0=90w +ellps=GRS80', @proj_ortel.getDef.strip)
130
- end
131
-
132
- def test_to_s
133
- assert_equal('#<Proj::Projection +init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0>', @proj_wgs84.to_s)
134
- end
135
-
136
- def test_projection
137
- assert_equal('longlat', @proj_wgs84.projection)
138
- assert_equal('tmerc', @proj_gk.projection)
139
- assert_equal('utm', @proj_conakry.projection)
140
- assert_equal('ortel', @proj_ortel.projection)
141
- end
142
-
143
- def test_datum
144
- assert_equal('WGS84', @proj_wgs84.datum)
145
- assert_nil(@proj_gk.datum)
146
- assert_nil(@proj_conakry.datum)
147
- end
148
-
149
- # echo "8.4302123334 48.9906726079" | proj +init=epsg:31467 -
150
- def test_forward_gk
151
- point = Proj::Point.new(8.4302123334, 48.9906726079)
152
- result = @proj_gk.forward(point.to_radians)
153
- assert_in_delta(3458305.0, result.x, 0.1)
154
- assert_in_delta(5428192.0, result.y, 0.1)
155
- end
156
-
157
- def test_forward_gk_degrees
158
- point = Proj::Point.new(8.4302123334, 48.9906726079)
159
- result = @proj_gk.forwardDeg(point)
160
- assert_in_delta(3458305.0, result.x, 0.1)
161
- assert_in_delta(5428192.0, result.y, 0.1)
162
- end
163
-
164
- # echo "3458305 5428192" | invproj -f '%.10f' +init=epsg:31467 -
165
- def test_inverse_gk
166
- point = Proj::Point.new(3458305.0, 5428192.0)
167
- result = @proj_gk.inverse(point).to_degrees
168
- assert_in_delta(result.x, 8.4302123334, PRECISION)
169
- assert_in_delta(result.y, 48.9906726079, PRECISION)
170
- end
171
-
172
- def test_inverse_gk_degrees
173
- point = Proj::Point.new(3458305.0, 5428192.0)
174
- result = @proj_gk.inverseDeg(point)
175
- assert_in_delta(result.x, 8.4302123334, PRECISION)
176
- assert_in_delta(result.y, 48.9906726079, PRECISION)
177
- end
178
-
179
- # echo "190 92" | proj +init=epsg:31467 -
180
- def test_out_of_bounds
181
- error = assert_raises(Proj::Error) do
182
- point = Proj::Point.new(190, 92).to_radians
183
- @proj_gk.forward(point)
184
- end
185
- assert_equal('latitude or longitude exceeded limits', error.message)
186
- end
187
-
188
- # echo "3458305 5428192" | cs2cs -f '%.10f' +init=epsg:31467 +to +init=epsg:4326 -
189
- def test_gk_to_wgs84
190
- from = Proj::Point.new(3458305.0, 5428192.0)
191
- to = @proj_gk.transform(@proj_wgs84, from).to_degrees
192
- assert_in_delta(8.4302123334, to.x, PRECISION)
193
- assert_in_delta(48.9906726079, to.y, PRECISION)
194
- end
195
-
196
- # echo "8.4293092923 48.9896114523" | cs2cs -f '%.10f' +init=epsg:4326 +to +init=epsg:31467 -
197
- def test_wgs84_to_gk
198
- from = Proj::Point.new(8.4302123334, 48.9906726079)
199
- to = @proj_wgs84.transform(@proj_gk, from.to_radians)
200
- assert_in_delta(3458305.0, to.x, PRECISION)
201
- assert_in_delta(5428192.0, to.y, PRECISION)
202
- end
203
-
204
- def test_mercator_at_pole_raise
205
- from = Proj::Point.new(0, 90)
206
- assert_raises(Proj::Error) do
207
- @proj_wgs84.transform(@proj_merc, from.to_radians)
208
- end
209
- end
210
-
211
- def test_collection
212
- from0 = Proj::Point.new(3458305.0, 5428192.0)
213
- from1 = Proj::Point.new(0, 0)
214
- collection = @proj_gk.transform_all(@proj_wgs84, [from0, from1])
215
-
216
- to0 = collection[0].to_degrees
217
- to1 = collection[1].to_degrees
218
-
219
- assert_in_delta(8.4302123334, to0.x, PRECISION)
220
- assert_in_delta(48.9906726079, to0.y, PRECISION)
221
-
222
- assert_in_delta(-20.9657785647, to1.x, PRECISION)
223
- assert_in_delta(0, to1.y, PRECISION)
224
- end
225
- end
226
- end
5
+ class ProjectionTest < AbstractTest
6
+ def test_utm
7
+ context = Proj::Context.new
8
+ proj = Proj::Projection.utm(context, zone: 1, north: 0)
9
+ assert(proj)
10
+ end
11
+
12
+ def test_transverse_mercator
13
+ context = Proj::Context.new
14
+ proj = Proj::Projection.transverse_mercator(context, center_lat: 0, center_long: 0,
15
+ scale: 0, false_easting: 0, false_northing: 0,
16
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
17
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
18
+ assert(proj)
19
+ end
20
+
21
+ def test_gauss_schreiber_transverse_mercator
22
+ context = Proj::Context.new
23
+ proj = Proj::Projection.gauss_schreiber_transverse_mercator(context, center_lat: 0, center_long: 0,
24
+ scale: 0, false_easting: 0, false_northing: 0,
25
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
26
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
27
+ assert(proj)
28
+ end
29
+
30
+ def test_transverse_mercator_south_oriented
31
+ context = Proj::Context.new
32
+ proj = Proj::Projection.transverse_mercator_south_oriented(context, center_lat: 0, center_long: 0,
33
+ scale: 0, false_easting: 0, false_northing: 0,
34
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
35
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
36
+ assert(proj)
37
+ end
38
+
39
+ def test_two_point_equidistant
40
+ context = Proj::Context.new
41
+
42
+ proj = Proj::Projection.two_point_equidistant(context,
43
+ latitude_first_point: 0, longitude_first_point: 0,
44
+ latitude_second_point: 0, longitude_secon_point: 0,
45
+ false_easting: 0, false_northing: 0,
46
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
47
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
48
+ assert(proj)
49
+ end
50
+
51
+ def test_tunisia_mining_grid
52
+ skip "This test only work on Proj 9.2 and up"
53
+ context = Proj::Context.new
54
+ proj = Proj::Projection.tunisia_mining_grid(context, center_lat: 0, center_long: 0,
55
+ false_easting: 0, false_northing: 0,
56
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
57
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
58
+ assert(proj)
59
+ end
60
+
61
+ def test_albers_equal_area
62
+ context = Proj::Context.new
63
+
64
+ proj = Proj::Projection.albers_equal_area(context, latitude_false_origin: 0, longitude_false_origin: 0,
65
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
66
+ easting_false_origin: 0, northing_false_origin: 0,
67
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
68
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
69
+ assert(proj)
70
+ end
71
+
72
+ def test_lambert_conic_conformal_1sp
73
+ context = Proj::Context.new
74
+ proj = Proj::Projection.lambert_conic_conformal_1sp(context, center_lat: 0, center_long: 0, scale: 0,
75
+ false_easting: 0, false_northing: 0,
76
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
77
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
78
+ assert(proj)
79
+ end
80
+
81
+ def test_lambert_conic_conformal_2sp
82
+ context = Proj::Context.new
83
+ proj = Proj::Projection.lambert_conic_conformal_2sp(context, latitude_false_origin: 0, longitude_false_origin: 0,
84
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
85
+ easting_false_origin: 0, northing_false_origin: 0,
86
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
87
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
88
+ assert(proj)
89
+ end
90
+
91
+ def test_lambert_conic_conformal_2sp_michigan
92
+ context = Proj::Context.new
93
+ proj = Proj::Projection.lambert_conic_conformal_2sp_michigan(context, latitude_false_origin: 0, longitude_false_origin: 0,
94
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
95
+ easting_false_origin: 0, northing_false_origin: 0,
96
+ ellipsoid_scaling_factor: 0,
97
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
98
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
99
+ assert(proj)
100
+ end
101
+
102
+ def test_lambert_conic_conformal_2sp_belgium
103
+ context = Proj::Context.new
104
+ proj = Proj::Projection.lambert_conic_conformal_2sp_belgium(context, latitude_false_origin: 0, longitude_false_origin: 0,
105
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
106
+ easting_false_origin: 0, northing_false_origin: 0,
107
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
108
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
109
+ assert(proj)
110
+ end
111
+
112
+ def test_azimuthal_equidistant
113
+ context = Proj::Context.new
114
+ proj = Proj::Projection.azimuthal_equidistant(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
115
+ false_easting: 0, false_northing: 0,
116
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
117
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
118
+
119
+ assert(proj)
120
+ end
121
+
122
+ def test_guam_projection
123
+ context = Proj::Context.new
124
+ proj = Proj::Projection.guam_projection(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
125
+ false_easting: 0, false_northing: 0,
126
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
127
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
128
+ assert(proj)
129
+ end
130
+
131
+ def test_bonne
132
+ context = Proj::Context.new
133
+ proj = Proj::Projection.bonne(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
134
+ false_easting: 0, false_northing: 0,
135
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
136
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
137
+ assert(proj)
138
+ end
139
+
140
+ def test_lambert_cylindrical_equal_area_spherical
141
+ context = Proj::Context.new
142
+ proj = Proj::Projection.lambert_cylindrical_equal_area_spherical(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
143
+ false_easting: 0, false_northing: 0,
144
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
145
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
146
+
147
+ assert(proj)
148
+ end
149
+
150
+ def test_lambert_cylindrical_equal_area
151
+ context = Proj::Context.new
152
+ proj = Proj::Projection.lambert_cylindrical_equal_area(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
153
+ false_easting: 0, false_northing: 0,
154
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
155
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
156
+ assert(proj)
157
+ end
158
+
159
+ def test_cassini_soldner
160
+ context = Proj::Context.new
161
+ proj = Proj::Projection.cassini_soldner(context, center_lat: 0, center_long: 0,
162
+ false_easting: 0, false_northing: 0,
163
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
164
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
165
+ assert(proj)
166
+ end
167
+
168
+ def test_equidistant_conic
169
+ context = Proj::Context.new
170
+ proj = Proj::Projection.equidistant_conic(context, center_lat: 0, center_long: 0,
171
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
172
+ false_easting: 0, false_northing: 0,
173
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
174
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
175
+ assert(proj)
176
+ end
177
+
178
+ def test_eckert_i
179
+ context = Proj::Context.new
180
+ proj = Proj::Projection.eckert_i(context, center_long: 0,
181
+ false_easting: 0, false_northing: 0,
182
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
183
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
184
+ assert(proj)
185
+ end
186
+
187
+ def test_eckert_ii
188
+ context = Proj::Context.new
189
+ proj = Proj::Projection.eckert_ii(context, center_long: 0,
190
+ false_easting: 0, false_northing: 0,
191
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
192
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
193
+ assert(proj)
194
+ end
195
+
196
+ def test_eckert_iii
197
+ context = Proj::Context.new
198
+ proj = Proj::Projection.eckert_iii(context, center_long: 0,
199
+ false_easting: 0, false_northing: 0,
200
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
201
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
202
+ assert(proj)
203
+ end
204
+
205
+ def test_eckert_iv
206
+ context = Proj::Context.new
207
+ proj = Proj::Projection.eckert_iv(context, center_long: 0,
208
+ false_easting: 0, false_northing: 0,
209
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
210
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
211
+ assert(proj)
212
+ end
213
+
214
+ def test_eckert_v
215
+ context = Proj::Context.new
216
+ proj = Proj::Projection.eckert_v(context, center_long: 0,
217
+ false_easting: 0, false_northing: 0,
218
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
219
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
220
+ assert(proj)
221
+ end
222
+
223
+ def test_eckert_vi
224
+ context = Proj::Context.new
225
+ proj = Proj::Projection.eckert_vi(context, center_long: 0,
226
+ false_easting: 0, false_northing: 0,
227
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
228
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
229
+ assert(proj)
230
+ end
231
+
232
+ def test_equidistant_cylindrical
233
+ context = Proj::Context.new
234
+ proj = Proj::Projection.equidistant_cylindrical(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
235
+ false_easting: 0, false_northing: 0,
236
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
237
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
238
+ assert(proj)
239
+ end
240
+
241
+ def test_equidistant_cylindrical_spherical
242
+ context = Proj::Context.new
243
+ proj = Proj::Projection.equidistant_cylindrical_spherical(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
244
+ false_easting: 0, false_northing: 0,
245
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
246
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
247
+ assert(proj)
248
+ end
249
+
250
+ def test_gall
251
+ context = Proj::Context.new
252
+ proj = Proj::Projection.gall(context, center_long: 0,
253
+ false_easting: 0, false_northing: 0,
254
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
255
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
256
+ assert(proj)
257
+ end
258
+
259
+ def test_goode_homolosine
260
+ context = Proj::Context.new
261
+ proj = Proj::Projection.goode_homolosine(context, center_long: 0,
262
+ false_easting: 0, false_northing: 0,
263
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
264
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
265
+ assert(proj)
266
+ end
267
+
268
+ def test_interrupted_goode_homolosine
269
+ context = Proj::Context.new
270
+ proj = Proj::Projection.interrupted_goode_homolosine(context, center_long: 0,
271
+ false_easting: 0, false_northing: 0,
272
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
273
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
274
+ assert(proj)
275
+ end
276
+
277
+ def test_geostationary_satellite_sweep_x
278
+ context = Proj::Context.new
279
+ proj = Proj::Projection.geostationary_satellite_sweep_x(context, center_long: 0, height: 0,
280
+ false_easting: 0, false_northing: 0,
281
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
282
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
283
+ assert(proj)
284
+ end
285
+
286
+ def test_geostationary_satellite_sweep_y
287
+ context = Proj::Context.new
288
+ proj = Proj::Projection.geostationary_satellite_sweep_y(context, center_long: 0, height: 0,
289
+ false_easting: 0, false_northing: 0,
290
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
291
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
292
+ assert(proj)
293
+ end
294
+
295
+ def test_gnomonic
296
+ context = Proj::Context.new
297
+ proj = Proj::Projection.gnomonic(context, center_lat: 0, center_long: 0,
298
+ false_easting: 0, false_northing: 0,
299
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
300
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
301
+ assert(proj)
302
+ end
303
+
304
+ def test_hotine_oblique_mercator_variant_a
305
+ context = Proj::Context.new
306
+ proj = Proj::Projection.hotine_oblique_mercator_variant_a(context,
307
+ latitude_projection_centre: 0, longitude_projection_centre: 0,
308
+ azimuth_initial_line: 0, angle_from_rectified_to_skrew_grid: 0,
309
+ scale: 0,
310
+ false_easting: 0, false_northing: 0,
311
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
312
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
313
+ assert(proj)
314
+ end
315
+
316
+ def test_hotine_oblique_mercator_variant_b
317
+ context = Proj::Context.new
318
+ proj = Proj::Projection.hotine_oblique_mercator_variant_b(context,
319
+ latitude_projection_centre: 0, longitude_projection_centre: 0,
320
+ azimuth_initial_line: 0, angle_from_rectified_to_skrew_grid: 0,
321
+ scale: 0,
322
+ easting_projection_centre: 0, northing_projection_centre: 0,
323
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
324
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
325
+ assert(proj)
326
+ end
327
+
328
+ def test_hotine_oblique_mercator_two_point_natural_origin
329
+ context = Proj::Context.new
330
+ proj = Proj::Projection.hotine_oblique_mercator_two_point_natural_origin(context, latitude_projection_centre: 0,
331
+ latitude_point1: 0, longitude_point1: 0,
332
+ latitude_point2: 0, longitude_point2: 0,
333
+ scale: 0,
334
+ easting_projection_centre: 0, northing_projection_centre: 0,
335
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
336
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
337
+ assert(proj)
338
+ end
339
+
340
+ def test_laborde_oblique_mercator
341
+ context = Proj::Context.new
342
+ proj = Proj::Projection.laborde_oblique_mercator(context, latitude_projection_centre: 0, longitude_projection_centre: 0,
343
+ azimuth_initial_line: 0,
344
+ scale: 0,
345
+ false_easting: 0, false_northing: 0,
346
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
347
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
348
+ assert(proj)
349
+ end
350
+
351
+ def test_international_map_world_polyconic
352
+ context = Proj::Context.new
353
+ proj = Proj::Projection.international_map_world_polyconic(context, center_long: 0,
354
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
355
+ false_easting: 0, false_northing: 0,
356
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
357
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
358
+ assert(proj)
359
+ end
360
+
361
+ def test_krovak_north_oriented
362
+ context = Proj::Context.new
363
+ proj = Proj::Projection.krovak_north_oriented(context, latitude_projection_centre: 0, longitude_of_origin: 0,
364
+ colatitude_cone_axis: 0, latitude_pseudo_standard_parallel: 0,
365
+ scale_factor_pseudo_standard_parallel: 0,
366
+ false_easting: 0, false_northing: 0,
367
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
368
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
369
+ assert(proj)
370
+ end
371
+
372
+ def test_krovak
373
+ context = Proj::Context.new
374
+ proj = Proj::Projection.krovak(context, latitude_projection_centre: 0, longitude_of_origin: 0,
375
+ colatitude_cone_axis: 0, latitude_pseudo_standard_parallel: 0,
376
+ scale_factor_pseudo_standard_parallel: 0,
377
+ false_easting: 0, false_northing: 0,
378
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
379
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
380
+ assert(proj)
381
+ end
382
+
383
+ def test_lambert_azimuthal_equal_area
384
+ context = Proj::Context.new
385
+ proj = Proj::Projection.lambert_azimuthal_equal_area(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
386
+ false_easting: 0, false_northing: 0,
387
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
388
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
389
+ assert(proj)
390
+ end
391
+
392
+ def test_miller_cylindrical
393
+ context = Proj::Context.new
394
+ proj = Proj::Projection.miller_cylindrical(context, center_long: 0,
395
+ false_easting: 0, false_northing: 0,
396
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
397
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
398
+ assert(proj)
399
+ end
400
+
401
+ def test_mercator_variant_a
402
+ context = Proj::Context.new
403
+ proj = Proj::Projection.mercator_variant_a(context, center_lat: 0, center_long: 0,
404
+ scale: 0,
405
+ false_easting: 0, false_northing: 0,
406
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
407
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
408
+ assert(proj)
409
+ end
410
+
411
+ def test_mercator_variant_b
412
+ context = Proj::Context.new
413
+ proj = Proj::Projection.mercator_variant_b(context, latitude_first_parallel: 0, center_long: 0,
414
+ false_easting: 0, false_northing: 0,
415
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
416
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
417
+ assert(proj)
418
+ end
419
+
420
+ def test_popular_visualisation_pseudo_mercator
421
+ context = Proj::Context.new
422
+ proj = Proj::Projection.popular_visualisation_pseudo_mercator(context, center_lat: 0, center_long: 0,
423
+ false_easting: 0, false_northing: 0,
424
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
425
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
426
+ assert(proj)
427
+ end
428
+
429
+ def test_mollweide
430
+ context = Proj::Context.new
431
+ proj = Proj::Projection.mollweide(context, center_long: 0,
432
+ false_easting: 0, false_northing: 0,
433
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
434
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
435
+ assert(proj)
436
+ end
437
+
438
+ def test_new_zealand_mapping_grid
439
+ context = Proj::Context.new
440
+ proj = Proj::Projection.new_zealand_mapping_grid(context, center_lat: 0, center_long: 0,
441
+ false_easting: 0, false_northing: 0,
442
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
443
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
444
+ assert(proj)
445
+ end
446
+
447
+ def test_oblique_stereographic
448
+ context = Proj::Context.new
449
+ proj = Proj::Projection.oblique_stereographic(context, center_lat: 0, center_long: 0,
450
+ scale: 0,
451
+ false_easting: 0, false_northing: 0,
452
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
453
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
454
+ assert(proj)
455
+ end
456
+
457
+ def test_orthographic
458
+ context = Proj::Context.new
459
+ proj = Proj::Projection.orthographic(context, center_lat: 0, center_long: 0,
460
+ false_easting: 0, false_northing: 0,
461
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
462
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
463
+ assert(proj)
464
+ end
465
+
466
+ def test_american_polyconic
467
+ context = Proj::Context.new
468
+ proj = Proj::Projection.american_polyconic(context, center_lat: 0, center_long: 0,
469
+ false_easting: 0, false_northing: 0,
470
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
471
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
472
+ assert(proj)
473
+ end
474
+
475
+ def test_polar_stereographic_variant_a
476
+ context = Proj::Context.new
477
+ proj = Proj::Projection.polar_stereographic_variant_a(context, center_lat: 0, center_long: 0,
478
+ scale: 0,
479
+ false_easting: 0, false_northing: 0,
480
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
481
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
482
+ assert(proj)
483
+ end
484
+
485
+ def test_polar_stereographic_variant_b
486
+ context = Proj::Context.new
487
+ proj = Proj::Projection.polar_stereographic_variant_b(context, latitude_standard_parallel: 0, longitude_of_origin: 0,
488
+ false_easting: 0, false_northing: 0,
489
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
490
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
491
+ assert(proj)
492
+ end
493
+
494
+ def test_robinson
495
+ context = Proj::Context.new
496
+ proj = Proj::Projection.robinson(context, center_long: 0,
497
+ false_easting: 0, false_northing: 0,
498
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
499
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
500
+ assert(proj)
501
+ end
502
+
503
+ def test_sinusoidal
504
+ context = Proj::Context.new
505
+ proj = Proj::Projection.sinusoidal(context, center_long: 0,
506
+ false_easting: 0, false_northing: 0,
507
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
508
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
509
+ assert(proj)
510
+ end
511
+
512
+ def test_stereographic
513
+ context = Proj::Context.new
514
+ proj = Proj::Projection.stereographic(context, center_lat: 0, center_long: 0,
515
+ scale: 0,
516
+ false_easting: 0, false_northing: 0,
517
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
518
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
519
+ assert(proj)
520
+ end
521
+
522
+ def test_van_der_grinten
523
+ context = Proj::Context.new
524
+ proj = Proj::Projection.van_der_grinten(context, center_long: 0,
525
+ false_easting: 0, false_northing: 0,
526
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
527
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
528
+ assert(proj)
529
+ end
530
+
531
+ def test_wagner_i
532
+ context = Proj::Context.new
533
+ proj = Proj::Projection.wagner_i(context, center_long: 0,
534
+ false_easting: 0, false_northing: 0,
535
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
536
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
537
+ assert(proj)
538
+ end
539
+
540
+ def test_wagner_ii
541
+ context = Proj::Context.new
542
+ proj = Proj::Projection.wagner_ii(context, center_long: 0,
543
+ false_easting: 0, false_northing: 0,
544
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
545
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
546
+ assert(proj)
547
+ end
548
+
549
+ def test_wagner_iii
550
+ context = Proj::Context.new
551
+ proj = Proj::Projection.wagner_iii(context, latitude_true_scale: 0,
552
+ center_long: 0,
553
+ false_easting: 0, false_northing: 0,
554
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
555
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
556
+ assert(proj)
557
+ end
558
+
559
+ def test_wagner_iv
560
+ context = Proj::Context.new
561
+ proj = Proj::Projection.wagner_iv(context, center_long: 0,
562
+ false_easting: 0, false_northing: 0,
563
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
564
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
565
+ assert(proj)
566
+ end
567
+
568
+ def test_wagner_v
569
+ context = Proj::Context.new
570
+ proj = Proj::Projection.wagner_v(context, center_long: 0,
571
+ false_easting: 0, false_northing: 0,
572
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
573
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
574
+ assert(proj)
575
+ end
576
+
577
+ def test_wagner_vi
578
+ context = Proj::Context.new
579
+ proj = Proj::Projection.wagner_vi(context, center_long: 0,
580
+ false_easting: 0, false_northing: 0,
581
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
582
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
583
+ assert(proj)
584
+ end
585
+
586
+ def test_wagner_vii
587
+ context = Proj::Context.new
588
+ proj = Proj::Projection.wagner_vii(context, center_long: 0,
589
+ false_easting: 0, false_northing: 0,
590
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
591
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
592
+ assert(proj)
593
+ end
594
+
595
+ def test_quadrilateralized_spherical_cube
596
+ context = Proj::Context.new
597
+ proj = Proj::Projection.quadrilateralized_spherical_cube(context, center_lat: 0, center_long: 0,
598
+ false_easting: 0, false_northing: 0,
599
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
600
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
601
+ assert(proj)
602
+ end
603
+
604
+ def test_spherical_cross_track_height
605
+ context = Proj::Context.new
606
+ proj = Proj::Projection.spherical_cross_track_height(context, peg_point_lat: 0, peg_point_long: 0,
607
+ peg_point_heading: 0, peg_point_height: 0,
608
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
609
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
610
+ assert(proj)
611
+ end
612
+
613
+ def test_equal_earth
614
+ context = Proj::Context.new
615
+ proj = Proj::Projection.equal_earth(context, center_long: 0,
616
+ false_easting: 0, false_northing: 0,
617
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
618
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
619
+ assert(proj)
620
+ end
621
+
622
+ def test_vertical_perspective
623
+ context = Proj::Context.new
624
+ proj = Proj::Projection.vertical_perspective(context,
625
+ topo_origin_lat: 0, topo_origin_long: 0, topo_origin_height: 0,
626
+ view_point_height: 0,
627
+ false_easting: 0, false_northing: 0,
628
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433,
629
+ linear_unit_name: "Metre", linear_unit_conv_factor: 1.0)
630
+ assert(proj)
631
+ end
632
+
633
+ def test_pole_rotation_grib_convention
634
+ context = Proj::Context.new
635
+ proj = Proj::Projection.pole_rotation_grib_convention(context,
636
+ south_pole_lat_in_unrotated_crs: 0, south_pole_long_in_unrotated_crs: 0,
637
+ axis_rotation: 0,
638
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433)
639
+ assert(proj)
640
+ end
641
+
642
+ def test_pole_rotation_netcdf_cf_convention
643
+ context = Proj::Context.new
644
+ proj = Proj::Projection.pole_rotation_netcdf_cf_convention(context,
645
+ grid_north_pole_latitude: 0, grid_north_pole_longitude: 0,
646
+ north_pole_grid_longitude: 0,
647
+ ang_unit_name: "Degree", ang_unit_conv_factor: 0.0174532925199433)
648
+ assert(proj)
649
+ end
650
+ end