proj4rb 4.1.0 → 5.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 (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +98 -0
  3. data/Gemfile +4 -4
  4. data/README.md +53 -0
  5. data/lib/api/proj.rb +750 -0
  6. data/lib/api/proj_experimental.rb +7 -0
  7. data/lib/api/proj_ffi.rb +47 -0
  8. data/lib/api/proj_version.rb +26 -0
  9. data/lib/examples/axis_order_normalization.rb +13 -0
  10. data/lib/examples/batch_transformation.rb +25 -0
  11. data/lib/examples/context_logging.rb +26 -0
  12. data/lib/examples/crs_identification.rb +18 -0
  13. data/lib/examples/database_query.rb +27 -0
  14. data/lib/examples/geodetic_distance.rb +38 -0
  15. data/lib/examples/geodetic_to_projected.rb +18 -0
  16. data/lib/examples/operation_factory_context.rb +19 -0
  17. data/lib/examples/pipeline_operator.rb +21 -0
  18. data/lib/examples/promote_demote_3d.rb +23 -0
  19. data/lib/examples/serialization_formats.rb +17 -0
  20. data/lib/examples/transform_bounds.rb +18 -0
  21. data/lib/examples/transformation_with_area.rb +18 -0
  22. data/lib/proj/area.rb +74 -74
  23. data/lib/proj/axis_info.rb +44 -44
  24. data/lib/proj/bounds.rb +22 -0
  25. data/lib/proj/bounds3d.rb +45 -0
  26. data/lib/proj/context.rb +57 -23
  27. data/lib/proj/conversion.rb +94 -91
  28. data/lib/proj/coordinate.rb +304 -281
  29. data/lib/proj/coordinate_metadata.rb +38 -0
  30. data/lib/proj/coordinate_operation_mixin.rb +464 -381
  31. data/lib/proj/coordinate_system.rb +143 -137
  32. data/lib/proj/crs.rb +688 -672
  33. data/lib/proj/crs_info.rb +47 -47
  34. data/lib/proj/database.rb +310 -305
  35. data/lib/proj/datum.rb +32 -32
  36. data/lib/proj/datum_ensemble.rb +34 -34
  37. data/lib/proj/domain.rb +82 -0
  38. data/lib/proj/ellipsoid.rb +77 -77
  39. data/lib/proj/error.rb +7 -8
  40. data/lib/proj/file_api_callbacks.rb +165 -0
  41. data/lib/proj/grid.rb +121 -121
  42. data/lib/proj/grid_cache.rb +65 -64
  43. data/lib/proj/grid_info.rb +19 -19
  44. data/lib/proj/life_span.rb +21 -0
  45. data/lib/proj/network_api_callbacks.rb +86 -0
  46. data/lib/proj/operation.rb +66 -42
  47. data/lib/proj/operation_factory_context.rb +4 -2
  48. data/lib/proj/options.rb +41 -0
  49. data/lib/proj/parameter.rb +37 -37
  50. data/lib/proj/parameters.rb +106 -107
  51. data/lib/proj/pj_axis_description.rb +26 -0
  52. data/lib/proj/pj_object.rb +602 -670
  53. data/lib/proj/pj_objects.rb +45 -45
  54. data/lib/proj/pj_param_description.rb +28 -0
  55. data/lib/proj/prime_meridian.rb +65 -65
  56. data/lib/proj/projection.rb +1771 -698
  57. data/lib/proj/session.rb +2 -0
  58. data/lib/proj/transformation.rb +102 -102
  59. data/lib/proj/unit.rb +81 -108
  60. data/lib/proj.rb +10 -3
  61. data/lib/proj4.rb +5 -5
  62. data/proj4rb.gemspec +10 -5
  63. data/test/abstract_test.rb +7 -28
  64. data/test/context_test.rb +210 -172
  65. data/test/context_validation_test.rb +11 -0
  66. data/test/conversion_test.rb +376 -368
  67. data/test/coordinate_metadata_test.rb +34 -0
  68. data/test/coordinate_system_test.rb +162 -144
  69. data/test/coordinate_test.rb +289 -34
  70. data/test/crs_test.rb +1112 -1072
  71. data/test/database_test.rb +407 -359
  72. data/test/datum_ensemble_test.rb +64 -64
  73. data/test/datum_test.rb +61 -54
  74. data/test/domain_test.rb +72 -0
  75. data/test/ellipsoid_test.rb +80 -80
  76. data/test/examples_test.rb +149 -0
  77. data/test/file_api_example.rb +58 -0
  78. data/test/file_api_test.rb +74 -66
  79. data/test/grid_cache_test.rb +72 -72
  80. data/test/grid_test.rb +126 -141
  81. data/test/network_api_example.rb +48 -0
  82. data/test/network_api_test.rb +33 -45
  83. data/test/operation_factory_context_test.rb +225 -201
  84. data/test/operation_test.rb +40 -29
  85. data/test/options_test.rb +17 -0
  86. data/test/parameters_test.rb +86 -40
  87. data/test/pj_object_test.rb +221 -179
  88. data/test/prime_meridian_test.rb +75 -75
  89. data/test/proj_test.rb +58 -58
  90. data/test/projection_test.rb +680 -650
  91. data/test/session_test.rb +78 -77
  92. data/test/transformation_test.rb +238 -210
  93. data/test/unit_test.rb +114 -76
  94. metadata +45 -31
  95. data/ChangeLog +0 -89
  96. data/README.rdoc +0 -207
  97. data/lib/api/api.rb +0 -117
  98. data/lib/api/api_5_0.rb +0 -338
  99. data/lib/api/api_5_1.rb +0 -7
  100. data/lib/api/api_5_2.rb +0 -5
  101. data/lib/api/api_6_0.rb +0 -146
  102. data/lib/api/api_6_1.rb +0 -5
  103. data/lib/api/api_6_2.rb +0 -10
  104. data/lib/api/api_6_3.rb +0 -6
  105. data/lib/api/api_7_0.rb +0 -69
  106. data/lib/api/api_7_1.rb +0 -73
  107. data/lib/api/api_7_2.rb +0 -14
  108. data/lib/api/api_8_0.rb +0 -6
  109. data/lib/api/api_8_1.rb +0 -24
  110. data/lib/api/api_8_2.rb +0 -6
  111. data/lib/api/api_9_1.rb +0 -7
  112. data/lib/api/api_9_2.rb +0 -9
  113. data/lib/api/api_experimental.rb +0 -201
  114. data/lib/proj/file_api.rb +0 -166
  115. data/lib/proj/network_api.rb +0 -92
@@ -1,650 +1,680 @@
1
- # encoding: UTF-8
2
-
3
- require_relative './abstract_test'
4
-
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
1
+ # encoding: UTF-8
2
+
3
+ require_relative './abstract_test'
4
+
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_latitude: 0, center_longitude: 0,
15
+ scale: 1, false_easting: 0, false_northing: 0,
16
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
17
+ linear_unit_name: "Metre", linear_unit_conversion_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_latitude: 0, center_longitude: 0,
24
+ scale: 1, false_easting: 0, false_northing: 0,
25
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
26
+ linear_unit_name: "Metre", linear_unit_conversion_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_latitude: 0, center_longitude: 0,
33
+ scale: 1, false_easting: 0, false_northing: 0,
34
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
35
+ linear_unit_name: "Metre", linear_unit_conversion_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_second_point: 0,
45
+ false_easting: 0, false_northing: 0,
46
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
47
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
48
+ assert(proj)
49
+ end
50
+
51
+ if Proj::Api::PROJ_VERSION >= Gem::Version.new('9.2.0')
52
+ def test_tunisia_mining_grid
53
+ context = Proj::Context.new
54
+ proj = Proj::Projection.tunisia_mining_grid(context, center_latitude: 0, center_longitude: 0,
55
+ false_easting: 0, false_northing: 0,
56
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
57
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
58
+ assert(proj)
59
+ end
60
+ end
61
+
62
+ def test_albers_equal_area
63
+ context = Proj::Context.new
64
+
65
+ proj = Proj::Projection.albers_equal_area(context, latitude_false_origin: 0, longitude_false_origin: 0,
66
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
67
+ easting_false_origin: 0, northing_false_origin: 0,
68
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
69
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
70
+ assert(proj)
71
+ end
72
+
73
+ def test_lambert_conic_conformal_1sp
74
+ context = Proj::Context.new
75
+ proj = Proj::Projection.lambert_conic_conformal_1sp(context, center_latitude: 0, center_longitude: 0, scale: 1,
76
+ false_easting: 0, false_northing: 0,
77
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
78
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
79
+ assert(proj)
80
+ end
81
+
82
+ if Proj::Api::PROJ_VERSION >= Gem::Version.new('9.4.0')
83
+ def test_lambert_conic_conformal_1sp_variant_b
84
+ context = Proj::Context.new
85
+ proj = Proj::Projection.lambert_conic_conformal_1sp_variant_b(context,
86
+ latitude_nat_origin: 46.5,
87
+ scale: 0.99987742,
88
+ latitude_false_origin: 46.5,
89
+ longitude_false_origin: 3,
90
+ easting_false_origin: 700000,
91
+ northing_false_origin: 6600000,
92
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
93
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
94
+ assert(proj)
95
+ end
96
+ end
97
+
98
+ def test_lambert_conic_conformal_2sp
99
+ context = Proj::Context.new
100
+ proj = Proj::Projection.lambert_conic_conformal_2sp(context, latitude_false_origin: 0, longitude_false_origin: 0,
101
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
102
+ easting_false_origin: 0, northing_false_origin: 0,
103
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
104
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
105
+ assert(proj)
106
+ end
107
+
108
+ def test_lambert_conic_conformal_2sp_michigan
109
+ context = Proj::Context.new
110
+ proj = Proj::Projection.lambert_conic_conformal_2sp_michigan(context, latitude_false_origin: 0, longitude_false_origin: 0,
111
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
112
+ easting_false_origin: 0, northing_false_origin: 0,
113
+ ellipsoid_scaling_factor: 0,
114
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
115
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
116
+ assert(proj)
117
+ end
118
+
119
+ def test_lambert_conic_conformal_2sp_belgium
120
+ context = Proj::Context.new
121
+ proj = Proj::Projection.lambert_conic_conformal_2sp_belgium(context, latitude_false_origin: 0, longitude_false_origin: 0,
122
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
123
+ easting_false_origin: 0, northing_false_origin: 0,
124
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
125
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
126
+ assert(proj)
127
+ end
128
+
129
+ def test_azimuthal_equidistant
130
+ context = Proj::Context.new
131
+ proj = Proj::Projection.azimuthal_equidistant(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
132
+ false_easting: 0, false_northing: 0,
133
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
134
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
135
+
136
+ assert(proj)
137
+ end
138
+
139
+ def test_guam_projection
140
+ context = Proj::Context.new
141
+ proj = Proj::Projection.guam_projection(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
142
+ false_easting: 0, false_northing: 0,
143
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
144
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
145
+ assert(proj)
146
+ end
147
+
148
+ def test_bonne
149
+ context = Proj::Context.new
150
+ proj = Proj::Projection.bonne(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
151
+ false_easting: 0, false_northing: 0,
152
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
153
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
154
+ assert(proj)
155
+ end
156
+
157
+ def test_lambert_cylindrical_equal_area_spherical
158
+ context = Proj::Context.new
159
+ proj = Proj::Projection.lambert_cylindrical_equal_area_spherical(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
160
+ false_easting: 0, false_northing: 0,
161
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
162
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
163
+
164
+ assert(proj)
165
+ end
166
+
167
+ def test_lambert_cylindrical_equal_area
168
+ context = Proj::Context.new
169
+ proj = Proj::Projection.lambert_cylindrical_equal_area(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
170
+ false_easting: 0, false_northing: 0,
171
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
172
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
173
+ assert(proj)
174
+ end
175
+
176
+ def test_cassini_soldner
177
+ context = Proj::Context.new
178
+ proj = Proj::Projection.cassini_soldner(context, center_latitude: 0, center_longitude: 0,
179
+ false_easting: 0, false_northing: 0,
180
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
181
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
182
+ assert(proj)
183
+ end
184
+
185
+ def test_equidistant_conic
186
+ context = Proj::Context.new
187
+ proj = Proj::Projection.equidistant_conic(context, center_latitude: 0, center_longitude: 0,
188
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
189
+ false_easting: 0, false_northing: 0,
190
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
191
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
192
+ assert(proj)
193
+ end
194
+
195
+ def test_eckert_i
196
+ context = Proj::Context.new
197
+ proj = Proj::Projection.eckert_i(context, center_longitude: 0,
198
+ false_easting: 0, false_northing: 0,
199
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
200
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
201
+ assert(proj)
202
+ end
203
+
204
+ def test_eckert_ii
205
+ context = Proj::Context.new
206
+ proj = Proj::Projection.eckert_ii(context, center_longitude: 0,
207
+ false_easting: 0, false_northing: 0,
208
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
209
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
210
+ assert(proj)
211
+ end
212
+
213
+ def test_eckert_iii
214
+ context = Proj::Context.new
215
+ proj = Proj::Projection.eckert_iii(context, center_longitude: 0,
216
+ false_easting: 0, false_northing: 0,
217
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
218
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
219
+ assert(proj)
220
+ end
221
+
222
+ def test_eckert_iv
223
+ context = Proj::Context.new
224
+ proj = Proj::Projection.eckert_iv(context, center_longitude: 0,
225
+ false_easting: 0, false_northing: 0,
226
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
227
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
228
+ assert(proj)
229
+ end
230
+
231
+ def test_eckert_v
232
+ context = Proj::Context.new
233
+ proj = Proj::Projection.eckert_v(context, center_longitude: 0,
234
+ false_easting: 0, false_northing: 0,
235
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
236
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
237
+ assert(proj)
238
+ end
239
+
240
+ def test_eckert_vi
241
+ context = Proj::Context.new
242
+ proj = Proj::Projection.eckert_vi(context, center_longitude: 0,
243
+ false_easting: 0, false_northing: 0,
244
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
245
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
246
+ assert(proj)
247
+ end
248
+
249
+ def test_equidistant_cylindrical
250
+ context = Proj::Context.new
251
+ proj = Proj::Projection.equidistant_cylindrical(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
252
+ false_easting: 0, false_northing: 0,
253
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
254
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
255
+ assert(proj)
256
+ end
257
+
258
+ def test_equidistant_cylindrical_spherical
259
+ context = Proj::Context.new
260
+ proj = Proj::Projection.equidistant_cylindrical_spherical(context, latitude_first_parallel: 0, longitude_nat_origin: 0,
261
+ false_easting: 0, false_northing: 0,
262
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
263
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
264
+ assert(proj)
265
+ end
266
+
267
+ def test_gall
268
+ context = Proj::Context.new
269
+ proj = Proj::Projection.gall(context, center_longitude: 0,
270
+ false_easting: 0, false_northing: 0,
271
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
272
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
273
+ assert(proj)
274
+ end
275
+
276
+ def test_goode_homolosine
277
+ context = Proj::Context.new
278
+ proj = Proj::Projection.goode_homolosine(context, center_longitude: 0,
279
+ false_easting: 0, false_northing: 0,
280
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
281
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
282
+ assert(proj)
283
+ end
284
+
285
+ def test_interrupted_goode_homolosine
286
+ context = Proj::Context.new
287
+ proj = Proj::Projection.interrupted_goode_homolosine(context, center_longitude: 0,
288
+ false_easting: 0, false_northing: 0,
289
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
290
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
291
+ assert(proj)
292
+ end
293
+
294
+ def test_geostationary_satellite_sweep_x
295
+ context = Proj::Context.new
296
+ proj = Proj::Projection.geostationary_satellite_sweep_x(context, center_longitude: 0, height: 0,
297
+ false_easting: 0, false_northing: 0,
298
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
299
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
300
+ assert(proj)
301
+ end
302
+
303
+ def test_geostationary_satellite_sweep_y
304
+ context = Proj::Context.new
305
+ proj = Proj::Projection.geostationary_satellite_sweep_y(context, center_longitude: 0, height: 0,
306
+ false_easting: 0, false_northing: 0,
307
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
308
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
309
+ assert(proj)
310
+ end
311
+
312
+ def test_gnomonic
313
+ context = Proj::Context.new
314
+ proj = Proj::Projection.gnomonic(context, center_latitude: 0, center_longitude: 0,
315
+ false_easting: 0, false_northing: 0,
316
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
317
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
318
+ assert(proj)
319
+ end
320
+
321
+ def test_hotine_oblique_mercator_variant_a
322
+ context = Proj::Context.new
323
+ proj = Proj::Projection.hotine_oblique_mercator_variant_a(context,
324
+ latitude_projection_centre: 0, longitude_projection_centre: 0,
325
+ azimuth_initial_line: 0, angle_from_rectified_to_skrew_grid: 0,
326
+ scale: 1,
327
+ false_easting: 0, false_northing: 0,
328
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
329
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
330
+ assert(proj)
331
+ end
332
+
333
+ def test_hotine_oblique_mercator_variant_b
334
+ context = Proj::Context.new
335
+ proj = Proj::Projection.hotine_oblique_mercator_variant_b(context,
336
+ latitude_projection_centre: 0, longitude_projection_centre: 0,
337
+ azimuth_initial_line: 0, angle_from_rectified_to_skrew_grid: 0,
338
+ scale: 1,
339
+ easting_projection_centre: 0, northing_projection_centre: 0,
340
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
341
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
342
+ assert(proj)
343
+ end
344
+
345
+ def test_hotine_oblique_mercator_two_point_natural_origin
346
+ context = Proj::Context.new
347
+ proj = Proj::Projection.hotine_oblique_mercator_two_point_natural_origin(context, latitude_projection_centre: 0,
348
+ latitude_point1: 0, longitude_point1: 0,
349
+ latitude_point2: 0, longitude_point2: 0,
350
+ scale: 1,
351
+ easting_projection_centre: 0, northing_projection_centre: 0,
352
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
353
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
354
+ assert(proj)
355
+ end
356
+
357
+ def test_laborde_oblique_mercator
358
+ context = Proj::Context.new
359
+ proj = Proj::Projection.laborde_oblique_mercator(context, latitude_projection_centre: 0, longitude_projection_centre: 0,
360
+ azimuth_initial_line: 0,
361
+ scale: 1,
362
+ false_easting: 0, false_northing: 0,
363
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
364
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
365
+ assert(proj)
366
+ end
367
+
368
+ def test_international_map_world_polyconic
369
+ context = Proj::Context.new
370
+ proj = Proj::Projection.international_map_world_polyconic(context, center_longitude: 0,
371
+ latitude_first_parallel: 0, latitude_second_parallel: 0,
372
+ false_easting: 0, false_northing: 0,
373
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
374
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
375
+ assert(proj)
376
+ end
377
+
378
+ def test_krovak_north_oriented
379
+ context = Proj::Context.new
380
+ proj = Proj::Projection.krovak_north_oriented(context, latitude_projection_centre: 0, longitude_of_origin: 0,
381
+ colatitude_cone_axis: 0, latitude_pseudo_standard_parallel: 0,
382
+ scale_factor_pseudo_standard_parallel: 0,
383
+ false_easting: 0, false_northing: 0,
384
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
385
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
386
+ assert(proj)
387
+ end
388
+
389
+ def test_krovak
390
+ context = Proj::Context.new
391
+ proj = Proj::Projection.krovak(context, latitude_projection_centre: 0, longitude_of_origin: 0,
392
+ colatitude_cone_axis: 0, latitude_pseudo_standard_parallel: 0,
393
+ scale_factor_pseudo_standard_parallel: 0,
394
+ false_easting: 0, false_northing: 0,
395
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
396
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
397
+ assert(proj)
398
+ end
399
+
400
+ def test_lambert_azimuthal_equal_area
401
+ context = Proj::Context.new
402
+ proj = Proj::Projection.lambert_azimuthal_equal_area(context, latitude_nat_origin: 0, longitude_nat_origin: 0,
403
+ false_easting: 0, false_northing: 0,
404
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
405
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
406
+ assert(proj)
407
+ end
408
+
409
+ def test_miller_cylindrical
410
+ context = Proj::Context.new
411
+ proj = Proj::Projection.miller_cylindrical(context, center_longitude: 0,
412
+ false_easting: 0, false_northing: 0,
413
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
414
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
415
+ assert(proj)
416
+ end
417
+
418
+ def test_mercator_variant_a
419
+ context = Proj::Context.new
420
+ proj = Proj::Projection.mercator_variant_a(context, center_latitude: 0, center_longitude: 0,
421
+ scale: 1,
422
+ false_easting: 0, false_northing: 0,
423
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
424
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
425
+ assert(proj)
426
+ end
427
+
428
+ def test_mercator_variant_b
429
+ context = Proj::Context.new
430
+ proj = Proj::Projection.mercator_variant_b(context, latitude_first_parallel: 0, center_longitude: 0,
431
+ false_easting: 0, false_northing: 0,
432
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
433
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
434
+ assert(proj)
435
+ end
436
+
437
+ def test_popular_visualisation_pseudo_mercator
438
+ context = Proj::Context.new
439
+ proj = Proj::Projection.popular_visualisation_pseudo_mercator(context, center_latitude: 0, center_longitude: 0,
440
+ false_easting: 0, false_northing: 0,
441
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
442
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
443
+ assert(proj)
444
+ end
445
+
446
+ def test_mollweide
447
+ context = Proj::Context.new
448
+ proj = Proj::Projection.mollweide(context, center_longitude: 0,
449
+ false_easting: 0, false_northing: 0,
450
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
451
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
452
+ assert(proj)
453
+ end
454
+
455
+ def test_new_zealand_mapping_grid
456
+ context = Proj::Context.new
457
+ proj = Proj::Projection.new_zealand_mapping_grid(context, center_latitude: 0, center_longitude: 0,
458
+ false_easting: 0, false_northing: 0,
459
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
460
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
461
+ assert(proj)
462
+ end
463
+
464
+ def test_oblique_stereographic
465
+ context = Proj::Context.new
466
+ proj = Proj::Projection.oblique_stereographic(context, center_latitude: 0, center_longitude: 0,
467
+ scale: 1,
468
+ false_easting: 0, false_northing: 0,
469
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
470
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
471
+ assert(proj)
472
+ end
473
+
474
+ def test_orthographic
475
+ context = Proj::Context.new
476
+ proj = Proj::Projection.orthographic(context, center_latitude: 0, center_longitude: 0,
477
+ false_easting: 0, false_northing: 0,
478
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
479
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
480
+ assert(proj)
481
+ end
482
+
483
+ def test_american_polyconic
484
+ context = Proj::Context.new
485
+ proj = Proj::Projection.american_polyconic(context, center_latitude: 0, center_longitude: 0,
486
+ false_easting: 0, false_northing: 0,
487
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
488
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
489
+ assert(proj)
490
+ end
491
+
492
+ def test_polar_stereographic_variant_a
493
+ context = Proj::Context.new
494
+ proj = Proj::Projection.polar_stereographic_variant_a(context, center_latitude: 0, center_longitude: 0,
495
+ scale: 1,
496
+ false_easting: 0, false_northing: 0,
497
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
498
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
499
+ assert(proj)
500
+ end
501
+
502
+ def test_polar_stereographic_variant_b
503
+ context = Proj::Context.new
504
+ proj = Proj::Projection.polar_stereographic_variant_b(context, latitude_standard_parallel: 0, longitude_of_origin: 0,
505
+ false_easting: 0, false_northing: 0,
506
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
507
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
508
+ assert(proj)
509
+ end
510
+
511
+ def test_robinson
512
+ context = Proj::Context.new
513
+ proj = Proj::Projection.robinson(context, center_longitude: 0,
514
+ false_easting: 0, false_northing: 0,
515
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
516
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
517
+ assert(proj)
518
+ end
519
+
520
+ def test_sinusoidal
521
+ context = Proj::Context.new
522
+ proj = Proj::Projection.sinusoidal(context, center_longitude: 0,
523
+ false_easting: 0, false_northing: 0,
524
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
525
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
526
+ assert(proj)
527
+ end
528
+
529
+ def test_stereographic
530
+ context = Proj::Context.new
531
+ proj = Proj::Projection.stereographic(context, center_latitude: 0, center_longitude: 0,
532
+ scale: 1,
533
+ false_easting: 0, false_northing: 0,
534
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
535
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
536
+ assert(proj)
537
+ end
538
+
539
+ def test_van_der_grinten
540
+ context = Proj::Context.new
541
+ proj = Proj::Projection.van_der_grinten(context, center_longitude: 0,
542
+ false_easting: 0, false_northing: 0,
543
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
544
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
545
+ assert(proj)
546
+ end
547
+
548
+ def test_wagner_i
549
+ context = Proj::Context.new
550
+ proj = Proj::Projection.wagner_i(context, center_longitude: 0,
551
+ false_easting: 0, false_northing: 0,
552
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
553
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
554
+ assert(proj)
555
+ end
556
+
557
+ def test_wagner_ii
558
+ context = Proj::Context.new
559
+ proj = Proj::Projection.wagner_ii(context, center_longitude: 0,
560
+ false_easting: 0, false_northing: 0,
561
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
562
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
563
+ assert(proj)
564
+ end
565
+
566
+ def test_wagner_iii
567
+ context = Proj::Context.new
568
+ proj = Proj::Projection.wagner_iii(context, latitude_true_scale: 0,
569
+ center_longitude: 0,
570
+ false_easting: 0, false_northing: 0,
571
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
572
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
573
+ assert(proj)
574
+ end
575
+
576
+ def test_wagner_iv
577
+ context = Proj::Context.new
578
+ proj = Proj::Projection.wagner_iv(context, center_longitude: 0,
579
+ false_easting: 0, false_northing: 0,
580
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
581
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
582
+ assert(proj)
583
+ end
584
+
585
+ def test_wagner_v
586
+ context = Proj::Context.new
587
+ proj = Proj::Projection.wagner_v(context, center_longitude: 0,
588
+ false_easting: 0, false_northing: 0,
589
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
590
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
591
+ assert(proj)
592
+ end
593
+
594
+ def test_wagner_vi
595
+ context = Proj::Context.new
596
+ proj = Proj::Projection.wagner_vi(context, center_longitude: 0,
597
+ false_easting: 0, false_northing: 0,
598
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
599
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
600
+ assert(proj)
601
+ end
602
+
603
+ def test_wagner_vii
604
+ context = Proj::Context.new
605
+ proj = Proj::Projection.wagner_vii(context, center_longitude: 0,
606
+ false_easting: 0, false_northing: 0,
607
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
608
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
609
+ assert(proj)
610
+ end
611
+
612
+ def test_quadrilateralized_spherical_cube
613
+ context = Proj::Context.new
614
+ proj = Proj::Projection.quadrilateralized_spherical_cube(context, center_latitude: 0, center_longitude: 0,
615
+ false_easting: 0, false_northing: 0,
616
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
617
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
618
+ assert(proj)
619
+ end
620
+
621
+ def test_spherical_cross_track_height
622
+ context = Proj::Context.new
623
+ proj = Proj::Projection.spherical_cross_track_height(context, peg_point_lat: 0, peg_point_long: 0,
624
+ peg_point_heading: 0, peg_point_height: 0,
625
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
626
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
627
+ assert(proj)
628
+ end
629
+
630
+ def test_equal_earth
631
+ context = Proj::Context.new
632
+ proj = Proj::Projection.equal_earth(context, center_longitude: 0,
633
+ false_easting: 0, false_northing: 0,
634
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
635
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
636
+ assert(proj)
637
+ end
638
+
639
+ def test_vertical_perspective
640
+ context = Proj::Context.new
641
+ proj = Proj::Projection.vertical_perspective(context,
642
+ topo_origin_lat: 0, topo_origin_long: 0, topo_origin_height: 0,
643
+ view_point_height: 0,
644
+ false_easting: 0, false_northing: 0,
645
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
646
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
647
+ assert(proj)
648
+ end
649
+
650
+ def test_pole_rotation_grib_convention
651
+ context = Proj::Context.new
652
+ proj = Proj::Projection.pole_rotation_grib_convention(context,
653
+ south_pole_lat_in_unrotated_crs: 0, south_pole_long_in_unrotated_crs: 0,
654
+ axis_rotation: 0,
655
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433)
656
+ assert(proj)
657
+ end
658
+
659
+ def test_pole_rotation_netcdf_cf_convention
660
+ context = Proj::Context.new
661
+ proj = Proj::Projection.pole_rotation_netcdf_cf_convention(context,
662
+ grid_north_pole_latitude: 0, grid_north_pole_longitude: 0,
663
+ north_pole_grid_longitude: 0,
664
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433)
665
+ assert(proj)
666
+ end
667
+
668
+ if Proj::Api::PROJ_VERSION >= Gem::Version.new('9.5.0')
669
+ def test_local_orthographic
670
+ context = Proj::Context.new
671
+ proj = Proj::Projection.local_orthographic(context,
672
+ latitude_nat_origin: 48.8566, longitude_nat_origin: 2.3522,
673
+ ellipsoidal_height: 0, geocentric_x_origin: 0,
674
+ geocentric_y_origin: 0, geocentric_z_origin: 0,
675
+ angular_unit_name: "Degree", angular_unit_conversion_factor: 0.0174532925199433,
676
+ linear_unit_name: "Metre", linear_unit_conversion_factor: 1.0)
677
+ assert(proj)
678
+ end
679
+ end
680
+ end