proj4rb 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +26 -15
- data/README.rdoc +82 -44
- data/Rakefile +27 -27
- data/lib/api/api.rb +96 -118
- data/lib/api/api_5_0.rb +331 -300
- data/lib/api/api_5_1.rb +6 -6
- data/lib/api/api_5_2.rb +4 -4
- data/lib/api/api_6_0.rb +116 -14
- data/lib/api/api_6_1.rb +4 -4
- data/lib/api/api_6_2.rb +9 -6
- data/lib/api/api_6_3.rb +6 -0
- data/lib/api/api_7_0.rb +68 -0
- data/lib/api/api_7_1.rb +73 -0
- data/lib/api/api_7_2.rb +14 -0
- data/lib/api/api_8_0.rb +6 -0
- data/lib/api/api_8_1.rb +24 -0
- data/lib/api/api_8_2.rb +6 -0
- data/lib/api/api_9_1.rb +7 -0
- data/lib/api/api_9_2.rb +9 -0
- data/lib/api/api_experimental.rb +196 -0
- data/lib/proj/area.rb +73 -32
- data/lib/proj/axis_info.rb +44 -0
- data/lib/proj/bounds.rb +13 -0
- data/lib/proj/context.rb +174 -28
- data/lib/proj/conversion.rb +92 -0
- data/lib/proj/coordinate.rb +281 -197
- data/lib/proj/coordinate_operation_mixin.rb +381 -0
- data/lib/proj/coordinate_system.rb +137 -0
- data/lib/proj/crs.rb +672 -204
- data/lib/proj/crs_info.rb +47 -0
- data/lib/proj/database.rb +305 -0
- data/lib/proj/datum.rb +32 -0
- data/lib/proj/datum_ensemble.rb +34 -0
- data/lib/proj/ellipsoid.rb +77 -41
- data/lib/proj/error.rb +62 -9
- data/lib/proj/file_api.rb +166 -0
- data/lib/proj/grid.rb +121 -0
- data/lib/proj/grid_cache.rb +64 -0
- data/lib/proj/grid_info.rb +19 -0
- data/lib/proj/network_api.rb +92 -0
- data/lib/proj/operation.rb +42 -42
- data/lib/proj/operation_factory_context.rb +136 -0
- data/lib/proj/parameter.rb +38 -0
- data/lib/proj/parameters.rb +106 -0
- data/lib/proj/pj_object.rb +670 -80
- data/lib/proj/pj_objects.rb +44 -0
- data/lib/proj/prime_meridian.rb +65 -39
- data/lib/proj/projection.rb +698 -207
- data/lib/proj/session.rb +46 -0
- data/lib/proj/strings.rb +32 -0
- data/lib/proj/transformation.rb +101 -60
- data/lib/proj/unit.rb +108 -53
- data/lib/proj.rb +110 -9
- data/proj4rb.gemspec +5 -5
- data/test/abstract_test.rb +23 -1
- data/test/context_test.rb +172 -82
- data/test/conversion_test.rb +368 -0
- data/test/coordinate_system_test.rb +144 -0
- data/test/crs_test.rb +770 -71
- data/test/database_test.rb +360 -0
- data/test/datum_ensemble_test.rb +65 -0
- data/test/datum_test.rb +55 -0
- data/test/ellipsoid_test.rb +64 -18
- data/test/file_api_test.rb +66 -0
- data/test/grid_cache_test.rb +72 -0
- data/test/grid_test.rb +141 -0
- data/test/network_api_test.rb +45 -0
- data/test/operation_factory_context_test.rb +201 -0
- data/test/parameters_test.rb +40 -0
- data/test/pj_object_test.rb +179 -0
- data/test/prime_meridian_test.rb +76 -0
- data/test/proj_test.rb +46 -4
- data/test/projection_test.rb +646 -222
- data/test/session_test.rb +78 -0
- data/test/transformation_test.rb +149 -7
- data/test/unit_test.rb +57 -28
- metadata +51 -13
- data/lib/api/api_4_9.rb +0 -31
- data/lib/proj/config.rb +0 -70
- data/lib/proj/point.rb +0 -72
- data/test/prime_meridians_test.rb +0 -33
data/lib/api/api_5_0.rb
CHANGED
@@ -1,301 +1,332 @@
|
|
1
|
-
module Proj
|
2
|
-
module Api
|
3
|
-
typedef :pointer, :PJ
|
4
|
-
typedef :pointer, :PJ_CONTEXT
|
5
|
-
typedef :pointer, :PJ_AREA
|
6
|
-
|
7
|
-
class
|
8
|
-
layout :meridional_scale, :double, # h
|
9
|
-
:parallel_scale, :double, # k
|
10
|
-
:areal_scale, :double, # s
|
11
|
-
|
12
|
-
:angular_distortion, :double, # omega
|
13
|
-
:meridian_parallel_angle, :double, # theta-prime
|
14
|
-
:meridian_convergence, :double, # alpha
|
15
|
-
|
16
|
-
:tissot_semimajor, :double, # a
|
17
|
-
:tissot_semiminor, :double, # b
|
18
|
-
|
19
|
-
:dx_dlam, :double,
|
20
|
-
:dx_dphi, :double,
|
21
|
-
:dy_dlam, :double,
|
22
|
-
:dy_dphi, :double
|
23
|
-
end
|
24
|
-
|
25
|
-
# Data types for list of operations, ellipsoids, datums and units used in PROJ.4
|
26
|
-
class PJ_LIST < FFI::Struct
|
27
|
-
layout :id, :string, # projection keyword
|
28
|
-
:PJ, :pointer, # projection entry point
|
29
|
-
:descr, :pointer # description text
|
30
|
-
end
|
31
|
-
PJ_OPERATIONS = PJ_LIST
|
32
|
-
|
33
|
-
class PJ_ELLPS < FFI::Struct
|
34
|
-
layout :id, :string, # ellipse keyword name
|
35
|
-
:major, :string, # a= value
|
36
|
-
:ell, :string, # elliptical parameter
|
37
|
-
:name, :string # comments
|
38
|
-
end
|
39
|
-
|
40
|
-
class PJ_UNITS < FFI::Struct
|
41
|
-
layout :id, :string, # units keyword
|
42
|
-
:to_meter, :string, # multiply by value to get meters
|
43
|
-
:name, :string, # comments
|
44
|
-
:factor, :double # to_meter factor in actual numbers
|
45
|
-
end
|
46
|
-
|
47
|
-
class PJ_PRIME_MERIDIANS < FFI::Struct
|
48
|
-
layout :id, :string, # prime meridian keyword
|
49
|
-
:defn, :string # offset from greenwich in DMS format.
|
50
|
-
end
|
51
|
-
|
52
|
-
# Geodetic, mostly spatiotemporal coordinate types
|
53
|
-
class PJ_XYZT < FFI::Struct
|
54
|
-
layout :x, :double,
|
55
|
-
:y, :double,
|
56
|
-
:z, :double,
|
57
|
-
:t, :double
|
58
|
-
end
|
59
|
-
|
60
|
-
class PJ_UVWT < FFI::Struct
|
61
|
-
layout :u, :double,
|
62
|
-
:v, :double,
|
63
|
-
:w, :double,
|
64
|
-
:t, :double
|
65
|
-
end
|
66
|
-
|
67
|
-
class PJ_LPZT < FFI::Struct
|
68
|
-
layout :lam, :double,
|
69
|
-
:phi, :double,
|
70
|
-
:z, :double,
|
71
|
-
:t, :double
|
72
|
-
end
|
73
|
-
|
74
|
-
# Rotations: omega, phi, kappa
|
75
|
-
class PJ_OPK < FFI::Struct
|
76
|
-
layout :o, :double,
|
77
|
-
:p, :double,
|
78
|
-
:k, :double
|
79
|
-
end
|
80
|
-
|
81
|
-
# East, North, Up
|
82
|
-
class PJ_ENU < FFI::Struct
|
83
|
-
layout :e, :double,
|
84
|
-
:n, :double,
|
85
|
-
:u, :double
|
86
|
-
end
|
87
|
-
|
88
|
-
# Geodesic length, fwd azi, rev azi
|
89
|
-
class PJ_GEOD < FFI::Struct
|
90
|
-
layout :s, :double,
|
91
|
-
:a1, :double,
|
92
|
-
:a2, :double
|
93
|
-
end
|
94
|
-
|
95
|
-
# Classic proj.4 pair/triplet types - moved into the PJ_ name space.
|
96
|
-
class PJ_UV < FFI::Struct
|
97
|
-
layout :u, :double,
|
98
|
-
:v, :double
|
99
|
-
end
|
100
|
-
|
101
|
-
class PJ_XY < FFI::Struct
|
102
|
-
layout :x, :double,
|
103
|
-
:y, :double
|
104
|
-
end
|
105
|
-
|
106
|
-
class PJ_LP < FFI::Struct
|
107
|
-
layout :lam, :double,
|
108
|
-
:phi, :double
|
109
|
-
end
|
110
|
-
|
111
|
-
class PJ_XYZ < FFI::Struct
|
112
|
-
layout :x, :double,
|
113
|
-
:y, :double,
|
114
|
-
:z, :double
|
115
|
-
end
|
116
|
-
|
117
|
-
class PJ_UVW < FFI::Struct
|
118
|
-
layout :u, :double,
|
119
|
-
:v, :double,
|
120
|
-
:w, :double
|
121
|
-
end
|
122
|
-
|
123
|
-
class PJ_LPZ < FFI::Struct
|
124
|
-
layout :lam, :double,
|
125
|
-
:phi, :double,
|
126
|
-
:z, :double
|
127
|
-
end
|
128
|
-
|
129
|
-
class PJ_COORD < FFI::Union
|
130
|
-
layout :v, [:double, 4],
|
131
|
-
:xyzt, PJ_XYZT,
|
132
|
-
:uvwt, PJ_UVWT,
|
133
|
-
:lpzt, PJ_LPZT,
|
134
|
-
:geod, PJ_GEOD,
|
135
|
-
:opk, PJ_OPK,
|
136
|
-
:enu, PJ_ENU,
|
137
|
-
:xyz, PJ_XYZ,
|
138
|
-
:uvw, PJ_UVW,
|
139
|
-
:lpz, PJ_LPZ,
|
140
|
-
:xy, PJ_XY,
|
141
|
-
:uv, PJ_UV,
|
142
|
-
:lp, PJ_LP
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
:
|
160
|
-
:
|
161
|
-
:
|
162
|
-
:
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
:
|
172
|
-
:
|
173
|
-
:
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
:
|
184
|
-
:
|
185
|
-
:
|
186
|
-
:
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
:
|
204
|
-
:
|
205
|
-
:
|
206
|
-
:
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
attach_function :
|
282
|
-
attach_function :
|
283
|
-
attach_function :
|
284
|
-
|
285
|
-
attach_function :
|
286
|
-
|
287
|
-
#
|
288
|
-
attach_function :
|
289
|
-
attach_function :
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
attach_function :
|
295
|
-
attach_function :
|
296
|
-
attach_function :
|
297
|
-
|
298
|
-
|
299
|
-
attach_function :
|
300
|
-
|
1
|
+
module Proj
|
2
|
+
module Api
|
3
|
+
typedef :pointer, :PJ
|
4
|
+
typedef :pointer, :PJ_CONTEXT
|
5
|
+
typedef :pointer, :PJ_AREA
|
6
|
+
|
7
|
+
class PJ_FACTORS < FFI::Struct
|
8
|
+
layout :meridional_scale, :double, # h
|
9
|
+
:parallel_scale, :double, # k
|
10
|
+
:areal_scale, :double, # s
|
11
|
+
|
12
|
+
:angular_distortion, :double, # omega
|
13
|
+
:meridian_parallel_angle, :double, # theta-prime
|
14
|
+
:meridian_convergence, :double, # alpha
|
15
|
+
|
16
|
+
:tissot_semimajor, :double, # a
|
17
|
+
:tissot_semiminor, :double, # b
|
18
|
+
|
19
|
+
:dx_dlam, :double,
|
20
|
+
:dx_dphi, :double,
|
21
|
+
:dy_dlam, :double,
|
22
|
+
:dy_dphi, :double
|
23
|
+
end
|
24
|
+
|
25
|
+
# Data types for list of operations, ellipsoids, datums and units used in PROJ.4
|
26
|
+
class PJ_LIST < FFI::Struct
|
27
|
+
layout :id, :string, # projection keyword
|
28
|
+
:PJ, :pointer, # projection entry point
|
29
|
+
:descr, :pointer # description text
|
30
|
+
end
|
31
|
+
PJ_OPERATIONS = PJ_LIST
|
32
|
+
|
33
|
+
class PJ_ELLPS < FFI::Struct
|
34
|
+
layout :id, :string, # ellipse keyword name
|
35
|
+
:major, :string, # a= value
|
36
|
+
:ell, :string, # elliptical parameter
|
37
|
+
:name, :string # comments
|
38
|
+
end
|
39
|
+
|
40
|
+
class PJ_UNITS < FFI::Struct
|
41
|
+
layout :id, :string, # units keyword
|
42
|
+
:to_meter, :string, # multiply by value to get meters
|
43
|
+
:name, :string, # comments
|
44
|
+
:factor, :double # to_meter factor in actual numbers
|
45
|
+
end
|
46
|
+
|
47
|
+
class PJ_PRIME_MERIDIANS < FFI::Struct
|
48
|
+
layout :id, :string, # prime meridian keyword
|
49
|
+
:defn, :string # offset from greenwich in DMS format.
|
50
|
+
end
|
51
|
+
|
52
|
+
# Geodetic, mostly spatiotemporal coordinate types
|
53
|
+
class PJ_XYZT < FFI::Struct
|
54
|
+
layout :x, :double,
|
55
|
+
:y, :double,
|
56
|
+
:z, :double,
|
57
|
+
:t, :double
|
58
|
+
end
|
59
|
+
|
60
|
+
class PJ_UVWT < FFI::Struct
|
61
|
+
layout :u, :double,
|
62
|
+
:v, :double,
|
63
|
+
:w, :double,
|
64
|
+
:t, :double
|
65
|
+
end
|
66
|
+
|
67
|
+
class PJ_LPZT < FFI::Struct
|
68
|
+
layout :lam, :double,
|
69
|
+
:phi, :double,
|
70
|
+
:z, :double,
|
71
|
+
:t, :double
|
72
|
+
end
|
73
|
+
|
74
|
+
# Rotations: omega, phi, kappa
|
75
|
+
class PJ_OPK < FFI::Struct
|
76
|
+
layout :o, :double,
|
77
|
+
:p, :double,
|
78
|
+
:k, :double
|
79
|
+
end
|
80
|
+
|
81
|
+
# East, North, Up
|
82
|
+
class PJ_ENU < FFI::Struct
|
83
|
+
layout :e, :double,
|
84
|
+
:n, :double,
|
85
|
+
:u, :double
|
86
|
+
end
|
87
|
+
|
88
|
+
# Geodesic length, fwd azi, rev azi
|
89
|
+
class PJ_GEOD < FFI::Struct
|
90
|
+
layout :s, :double,
|
91
|
+
:a1, :double,
|
92
|
+
:a2, :double
|
93
|
+
end
|
94
|
+
|
95
|
+
# Classic proj.4 pair/triplet types - moved into the PJ_ name space.
|
96
|
+
class PJ_UV < FFI::Struct
|
97
|
+
layout :u, :double,
|
98
|
+
:v, :double
|
99
|
+
end
|
100
|
+
|
101
|
+
class PJ_XY < FFI::Struct
|
102
|
+
layout :x, :double,
|
103
|
+
:y, :double
|
104
|
+
end
|
105
|
+
|
106
|
+
class PJ_LP < FFI::Struct
|
107
|
+
layout :lam, :double,
|
108
|
+
:phi, :double
|
109
|
+
end
|
110
|
+
|
111
|
+
class PJ_XYZ < FFI::Struct
|
112
|
+
layout :x, :double,
|
113
|
+
:y, :double,
|
114
|
+
:z, :double
|
115
|
+
end
|
116
|
+
|
117
|
+
class PJ_UVW < FFI::Struct
|
118
|
+
layout :u, :double,
|
119
|
+
:v, :double,
|
120
|
+
:w, :double
|
121
|
+
end
|
122
|
+
|
123
|
+
class PJ_LPZ < FFI::Struct
|
124
|
+
layout :lam, :double,
|
125
|
+
:phi, :double,
|
126
|
+
:z, :double
|
127
|
+
end
|
128
|
+
|
129
|
+
class PJ_COORD < FFI::Union
|
130
|
+
layout :v, [:double, 4],
|
131
|
+
:xyzt, PJ_XYZT,
|
132
|
+
:uvwt, PJ_UVWT,
|
133
|
+
:lpzt, PJ_LPZT,
|
134
|
+
:geod, PJ_GEOD,
|
135
|
+
:opk, PJ_OPK,
|
136
|
+
:enu, PJ_ENU,
|
137
|
+
:xyz, PJ_XYZ,
|
138
|
+
:uvw, PJ_UVW,
|
139
|
+
:lpz, PJ_LPZ,
|
140
|
+
:xy, PJ_XY,
|
141
|
+
:uv, PJ_UV,
|
142
|
+
:lp, PJ_LP
|
143
|
+
|
144
|
+
def eql?(other)
|
145
|
+
self[:v][0] == other[:v][0] &&
|
146
|
+
self[:v][1] == other[:v][1] &&
|
147
|
+
self[:v][2] == other[:v][2] &&
|
148
|
+
self[:v][3] == other[:v][3]
|
149
|
+
end
|
150
|
+
|
151
|
+
def ==(other)
|
152
|
+
self.eql?(other)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
class PJ_INFO < FFI::Struct
|
157
|
+
layout :major, :int, # Major release number
|
158
|
+
:minor, :int, # Minor release number
|
159
|
+
:patch, :int, # Patch level
|
160
|
+
:release, :string, # Release info. Version + date
|
161
|
+
:version, :string, # Full version number
|
162
|
+
:searchpath, :string, # Paths where init and grid files are looked for. Paths are separated by
|
163
|
+
# semi-colons on Windows, and colons on non-Windows platforms.
|
164
|
+
:paths, :pointer,
|
165
|
+
:path_count, :size_t
|
166
|
+
end
|
167
|
+
|
168
|
+
class PJ_PROJ_INFO < FFI::Struct
|
169
|
+
layout :id, :string, # Name of the projection in question
|
170
|
+
:description, :string, # Description of the projection
|
171
|
+
:definition, :string, # Projection definition
|
172
|
+
:has_inverse, :int, # 1 if an inverse mapping exists, 0 otherwise
|
173
|
+
:accuracy, :double # Expected accuracy of the transformation. -1 if unknown.
|
174
|
+
|
175
|
+
def to_s
|
176
|
+
"<#{self.class.name} id: #{self[:id]}, description: #{self[:description]}, definition: #{self[:definition]}, has_inverse: #{self[:has_inverse]} accuracy: #{self[:accuracy]}"
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
class PJ_GRID_INFO < FFI::Struct
|
181
|
+
layout :gridname, [:char, 32], # name of grid
|
182
|
+
:filename, [:char, 260], # full path to grid
|
183
|
+
:format, [:char, 8], # file format of grid
|
184
|
+
:lowerleft, PJ_LP, # Coordinates of lower left corner
|
185
|
+
:upperright, PJ_LP, # Coordinates of upper right corner
|
186
|
+
:n_lon, :int, # Grid size
|
187
|
+
:n_lat, :int, # Grid size
|
188
|
+
:cs_lon, :double, # Cell size of grid
|
189
|
+
:cs_lat, :double # Cell size of grid
|
190
|
+
end
|
191
|
+
|
192
|
+
class PJ_INIT_INFO < FFI::Struct
|
193
|
+
layout :name, [:string, 32], # name init file
|
194
|
+
:filename, [:string, 260], # full path to the init file
|
195
|
+
:version, [:string, 32], # version of the init file
|
196
|
+
:origin, [:string, 32], # origin of the file, e.g. EPSG
|
197
|
+
:lastupdate, [:string, 16] # Date of last update in YYYY-MM-DD format
|
198
|
+
end
|
199
|
+
|
200
|
+
PJ_LOG_LEVEL = enum(:PJ_LOG_NONE , 0,
|
201
|
+
:PJ_LOG_ERROR, 1,
|
202
|
+
:PJ_LOG_DEBUG, 2,
|
203
|
+
:PJ_LOG_TRACE, 3,
|
204
|
+
:PJ_LOG_TELL , 4,
|
205
|
+
:PJ_LOG_DEBUG_MAJOR, 2, # for proj_api.h compatibility
|
206
|
+
:PJ_LOG_DEBUG_MINOR, 3) # for proj_api.h compatibility
|
207
|
+
|
208
|
+
# Apply transformation to observation - in forward or inverse direction
|
209
|
+
PJ_DIRECTION = enum(:PJ_FWD, 1, # Forward
|
210
|
+
:PJ_IDENT, 0, # Do nothing
|
211
|
+
:PJ_INV, -1) # Inverse
|
212
|
+
|
213
|
+
# Object category
|
214
|
+
PJ_CATEGORY = enum(:PJ_CATEGORY_ELLIPSOID,
|
215
|
+
:PJ_CATEGORY_PRIME_MERIDIAN,
|
216
|
+
:PJ_CATEGORY_DATUM,
|
217
|
+
:PJ_CATEGORY_CRS,
|
218
|
+
:PJ_CATEGORY_COORDINATE_OPERATION,
|
219
|
+
:PJ_CATEGORY_DATUM_ENSEMBLE)
|
220
|
+
|
221
|
+
PJ_TYPE = enum(:PJ_TYPE_UNKNOWN,
|
222
|
+
:PJ_TYPE_ELLIPSOID,
|
223
|
+
:PJ_TYPE_PRIME_MERIDIAN,
|
224
|
+
:PJ_TYPE_GEODETIC_REFERENCE_FRAME,
|
225
|
+
:PJ_TYPE_DYNAMIC_GEODETIC_REFERENCE_FRAME,
|
226
|
+
:PJ_TYPE_VERTICAL_REFERENCE_FRAME,
|
227
|
+
:PJ_TYPE_DYNAMIC_VERTICAL_REFERENCE_FRAME,
|
228
|
+
:PJ_TYPE_DATUM_ENSEMBLE,
|
229
|
+
|
230
|
+
# Abstract type, not returned by proj_get_type()
|
231
|
+
:PJ_TYPE_CRS,
|
232
|
+
|
233
|
+
:PJ_TYPE_GEODETIC_CRS,
|
234
|
+
:PJ_TYPE_GEOCENTRIC_CRS,
|
235
|
+
:PJ_TYPE_GEOGRAPHIC_CRS,
|
236
|
+
:PJ_TYPE_GEOGRAPHIC_2D_CRS,
|
237
|
+
:PJ_TYPE_GEOGRAPHIC_3D_CRS,
|
238
|
+
:PJ_TYPE_VERTICAL_CRS,
|
239
|
+
:PJ_TYPE_PROJECTED_CRS,
|
240
|
+
:PJ_TYPE_COMPOUND_CRS,
|
241
|
+
:PJ_TYPE_TEMPORAL_CRS,
|
242
|
+
:PJ_TYPE_ENGINEERING_CRS,
|
243
|
+
:PJ_TYPE_BOUND_CRS,
|
244
|
+
:PJ_TYPE_OTHER_CRS,
|
245
|
+
|
246
|
+
:PJ_TYPE_CONVERSION,
|
247
|
+
:PJ_TYPE_TRANSFORMATION,
|
248
|
+
:PJ_TYPE_CONCATENATED_OPERATION,
|
249
|
+
:PJ_TYPE_OTHER_COORDINATE_OPERATION,
|
250
|
+
|
251
|
+
:PJ_TYPE_TEMPORAL_DATUM,
|
252
|
+
:PJ_TYPE_ENGINEERING_DATUM,
|
253
|
+
:PJ_TYPE_PARAMETRIC_DATUM,
|
254
|
+
|
255
|
+
:PJ_TYPE_DERIVED_PROJECTED_CRS,
|
256
|
+
|
257
|
+
:PJ_TYPE_COORDINATE_METADATA)
|
258
|
+
|
259
|
+
PJ_PROJ_STRING_TYPE = enum(:PJ_PROJ_5,
|
260
|
+
:PJ_PROJ_4)
|
261
|
+
|
262
|
+
PJ_COORDINATE_SYSTEM_TYPE = enum(:PJ_CS_TYPE_UNKNOWN,
|
263
|
+
:PJ_CS_TYPE_CARTESIAN,
|
264
|
+
:PJ_CS_TYPE_ELLIPSOIDAL,
|
265
|
+
:PJ_CS_TYPE_VERTICAL,
|
266
|
+
:PJ_CS_TYPE_SPHERICAL,
|
267
|
+
:PJ_CS_TYPE_ORDINAL,
|
268
|
+
:PJ_CS_TYPE_PARAMETRIC,
|
269
|
+
:PJ_CS_TYPE_DATETIMETEMPORAL,
|
270
|
+
:PJ_CS_TYPE_TEMPORALCOUNT,
|
271
|
+
:PJ_CS_TYPE_TEMPORALMEASURE)
|
272
|
+
|
273
|
+
PJ_WKT_TYPE = enum(:PJ_WKT2_2015,
|
274
|
+
:PJ_WKT2_2015_SIMPLIFIED,
|
275
|
+
:PJ_WKT2_2019,
|
276
|
+
:PJ_WKT2_2018, # Deprecated alias for PJ_WKT2_2019
|
277
|
+
:PJ_WKT2_2018_SIMPLIFIED, # Deprecated alias for PJ_WKT2_2019
|
278
|
+
:PJ_WKT1_GDAL,
|
279
|
+
:PJ_WKT1_ESRI)
|
280
|
+
|
281
|
+
attach_function :proj_info, [], PJ_INFO.by_value
|
282
|
+
attach_function :proj_grid_info, [:string], PJ_GRID_INFO.by_value
|
283
|
+
attach_function :proj_init_info, [:string], PJ_INIT_INFO.by_value
|
284
|
+
|
285
|
+
attach_function :proj_pj_info, [:PJ], PJ_PROJ_INFO.by_value
|
286
|
+
|
287
|
+
# Contexts
|
288
|
+
attach_function :proj_context_create, [], :PJ_CONTEXT
|
289
|
+
attach_function :proj_context_destroy, [:PJ_CONTEXT], :PJ_CONTEXT
|
290
|
+
|
291
|
+
# Error handling
|
292
|
+
attach_function :proj_context_errno, [:PJ_CONTEXT], :int
|
293
|
+
attach_function :proj_errno, [:PJ], :int
|
294
|
+
attach_function :proj_errno_set, [:PJ, :int], :int
|
295
|
+
attach_function :proj_errno_reset, [:PJ], :int
|
296
|
+
attach_function :proj_errno_restore, [:PJ, :int], :int
|
297
|
+
|
298
|
+
# Manage the transformation definition object PJ
|
299
|
+
attach_function :proj_create, [:PJ_CONTEXT, :string], :PJ
|
300
|
+
attach_function :proj_create_argv, [:PJ_CONTEXT, :int, :pointer], :PJ
|
301
|
+
attach_function :proj_create_crs_to_crs, [:PJ_CONTEXT, :string, :string, :PJ_AREA], :PJ
|
302
|
+
attach_function :proj_destroy, [:PJ], :PJ
|
303
|
+
|
304
|
+
attach_function :proj_trans, [:PJ, PJ_DIRECTION, PJ_COORD.by_value], PJ_COORD.by_value
|
305
|
+
attach_function :proj_trans_generic, [:PJ, PJ_DIRECTION, :pointer, :size_t, :size_t, :pointer, :size_t, :size_t, :pointer, :size_t, :size_t, :pointer, :size_t, :size_t], :size_t
|
306
|
+
attach_function :proj_trans_array, [:PJ, PJ_DIRECTION, :size_t, :pointer], :int
|
307
|
+
attach_function :proj_roundtrip, [:PJ, PJ_DIRECTION, :int, PJ_COORD.by_ref], :double
|
308
|
+
attach_function :proj_factors, [:PJ, PJ_COORD.by_value], PJ_FACTORS.by_value
|
309
|
+
|
310
|
+
# Get lists of operations, ellipsoids, units and prime meridians
|
311
|
+
attach_function :proj_list_operations, [], :pointer #PJ_LIST
|
312
|
+
attach_function :proj_list_ellps, [], :pointer #PJ_ELLPS
|
313
|
+
attach_function :proj_list_units, [], :pointer #PJ_UNITS
|
314
|
+
attach_function :proj_list_prime_meridians, [], :pointer #PJ_PRIME_MERIDIANS
|
315
|
+
|
316
|
+
# Degrees/radians
|
317
|
+
attach_function :proj_torad, [:double], :double
|
318
|
+
attach_function :proj_todeg, [:double], :double
|
319
|
+
attach_function :proj_dmstor, [:string, :pointer], :double
|
320
|
+
attach_function :proj_rtodms, [:pointer, :double, :int, :int], :string
|
321
|
+
|
322
|
+
attach_function :proj_angular_input, [:PJ, PJ_DIRECTION], :int
|
323
|
+
attach_function :proj_angular_output, [:PJ, PJ_DIRECTION], :int
|
324
|
+
|
325
|
+
# Distances
|
326
|
+
attach_function :proj_lp_dist, [:PJ, PJ_COORD.by_value, PJ_COORD.by_value], :double
|
327
|
+
attach_function :proj_lpz_dist, [:PJ, PJ_COORD.by_value, PJ_COORD.by_value], :double
|
328
|
+
attach_function :proj_geod, [:PJ, PJ_COORD.by_value, PJ_COORD.by_value], PJ_COORD.by_value
|
329
|
+
attach_function :proj_xy_dist, [PJ_COORD.by_value, PJ_COORD.by_value], :double
|
330
|
+
attach_function :proj_xyz_dist, [PJ_COORD.by_value, PJ_COORD.by_value], :double
|
331
|
+
end
|
301
332
|
end
|
data/lib/api/api_5_1.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
module Proj
|
2
|
-
module Api
|
3
|
-
attach_function :proj_log_level, [:PJ_CONTEXT,
|
4
|
-
callback :pj_log_function, [:pointer, :int, :string], :void
|
5
|
-
attach_function :proj_log_func, [:PJ_CONTEXT, :pointer, :pj_log_function], :void
|
6
|
-
end
|
1
|
+
module Proj
|
2
|
+
module Api
|
3
|
+
attach_function :proj_log_level, [:PJ_CONTEXT, PJ_LOG_LEVEL], PJ_LOG_LEVEL
|
4
|
+
callback :pj_log_function, [:pointer, :int, :string], :void
|
5
|
+
attach_function :proj_log_func, [:PJ_CONTEXT, :pointer, :pj_log_function], :void
|
6
|
+
end
|
7
7
|
end
|