ffi-gdal 1.0.0.beta5 → 1.0.0.beta6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -3
  3. data/.rubocop.yml +7 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +1 -1
  6. data/History.md +143 -1
  7. data/README.md +5 -11
  8. data/Rakefile +2 -60
  9. data/TODO.md +10 -0
  10. data/examples/geometries.rb +4 -6
  11. data/examples/gridding.rb +99 -98
  12. data/examples/ogr_layer_to_layer.rb +0 -2
  13. data/examples/raster_erasing.rb +47 -0
  14. data/examples/remove_small_polygons.rb +62 -0
  15. data/examples/testing_gdal.rb +0 -3
  16. data/examples/warping.rb +140 -0
  17. data/ffi-gdal.gemspec +5 -2
  18. data/lib/ext/error_symbols.rb +1 -1
  19. data/lib/ext/ffi_library_function_checks.rb +3 -2
  20. data/lib/ext/float_ext.rb +2 -2
  21. data/lib/ext/narray_ext.rb +1 -1
  22. data/lib/ext/numeric_as_data_type.rb +1 -1
  23. data/lib/ext/to_bool.rb +2 -2
  24. data/lib/ffi/cpl/conv.rb +1 -3
  25. data/lib/ffi/cpl/error.rb +0 -3
  26. data/lib/ffi/cpl/minixml.rb +17 -21
  27. data/lib/ffi/cpl/progress.rb +27 -0
  28. data/lib/ffi/cpl/string.rb +0 -8
  29. data/lib/ffi/cpl/vsi.rb +0 -1
  30. data/lib/ffi/cpl/xml_node.rb +0 -1
  31. data/lib/ffi/cpl.rb +15 -0
  32. data/lib/ffi/gdal/alg.rb +72 -54
  33. data/lib/ffi/gdal/gdal.rb +669 -672
  34. data/lib/ffi/gdal/grid.rb +141 -24
  35. data/lib/ffi/gdal/grid_data_metrics_options.rb +1 -1
  36. data/lib/ffi/gdal/grid_moving_average_options.rb +1 -1
  37. data/lib/ffi/gdal/matching.rb +0 -2
  38. data/lib/ffi/gdal/transformer_info.rb +1 -1
  39. data/lib/ffi/gdal/version.rb +1 -1
  40. data/lib/ffi/gdal/vrt.rb +0 -2
  41. data/lib/ffi/gdal/warp_options.rb +12 -14
  42. data/lib/ffi/gdal/warper.rb +61 -6
  43. data/lib/ffi/gdal.rb +18 -3
  44. data/lib/ffi/ogr/api.rb +10 -21
  45. data/lib/ffi/ogr/core.rb +9 -12
  46. data/lib/ffi/ogr/featurestyle.rb +0 -5
  47. data/lib/ffi/ogr/geocoding.rb +0 -1
  48. data/lib/ffi/ogr/srs_api.rb +0 -4
  49. data/lib/ffi/ogr/style_value.rb +1 -2
  50. data/lib/ffi/ogr.rb +15 -12
  51. data/lib/ffi-gdal.rb +5 -3
  52. data/lib/gdal/color_entry.rb +1 -0
  53. data/lib/gdal/color_interpretation.rb +2 -2
  54. data/lib/gdal/color_table.rb +14 -14
  55. data/lib/gdal/color_table_mixins/extensions.rb +4 -4
  56. data/lib/gdal/cpl_error_handler.rb +12 -14
  57. data/lib/gdal/data_type.rb +13 -12
  58. data/lib/gdal/dataset.rb +170 -94
  59. data/lib/gdal/dataset_mixins/algorithm_methods.rb +47 -21
  60. data/lib/gdal/dataset_mixins/extensions.rb +32 -61
  61. data/lib/gdal/dataset_mixins/matching.rb +0 -2
  62. data/lib/gdal/dataset_mixins/warp_methods.rb +42 -0
  63. data/lib/gdal/driver.rb +62 -47
  64. data/lib/gdal/driver_mixins/extensions.rb +2 -7
  65. data/lib/gdal/environment_methods.rb +13 -10
  66. data/lib/gdal/exceptions.rb +24 -2
  67. data/lib/gdal/geo_transform.rb +10 -16
  68. data/lib/gdal/geo_transform_mixins/extensions.rb +58 -3
  69. data/lib/gdal/grid.rb +62 -109
  70. data/lib/gdal/{grid_types → grid_algorithms}/data_metrics_base.rb +1 -3
  71. data/lib/gdal/{grid_types → grid_algorithms}/inverse_distance_to_a_power.rb +2 -4
  72. data/lib/gdal/{grid_types → grid_algorithms}/metric_average_distance.rb +2 -2
  73. data/lib/gdal/{grid_types → grid_algorithms}/metric_average_distance_pts.rb +2 -2
  74. data/lib/gdal/{grid_types → grid_algorithms}/metric_count.rb +2 -2
  75. data/lib/gdal/{grid_types → grid_algorithms}/metric_maximum.rb +2 -2
  76. data/lib/gdal/{grid_types → grid_algorithms}/metric_minimum.rb +2 -2
  77. data/lib/gdal/{grid_types → grid_algorithms}/metric_range.rb +2 -2
  78. data/lib/gdal/{grid_types → grid_algorithms}/moving_average.rb +2 -4
  79. data/lib/gdal/{grid_types → grid_algorithms}/nearest_neighbor.rb +2 -4
  80. data/lib/gdal/grid_algorithms.rb +22 -0
  81. data/lib/gdal/gridder/point_extracting.rb +89 -0
  82. data/lib/gdal/gridder.rb +294 -0
  83. data/lib/gdal/gridder_options.rb +273 -0
  84. data/lib/gdal/internal_helpers.rb +132 -23
  85. data/lib/gdal/major_object.rb +13 -10
  86. data/lib/gdal/merger.rb +130 -0
  87. data/lib/gdal/options.rb +3 -2
  88. data/lib/gdal/raster_attribute_table.rb +74 -51
  89. data/lib/gdal/raster_attribute_table_mixins/extensions.rb +21 -3
  90. data/lib/gdal/raster_band.rb +139 -167
  91. data/lib/gdal/raster_band_classifier.rb +19 -18
  92. data/lib/gdal/raster_band_mixins/algorithm_extensions.rb +107 -0
  93. data/lib/gdal/raster_band_mixins/algorithm_methods.rb +79 -40
  94. data/lib/gdal/raster_band_mixins/coloring_extensions.rb +84 -0
  95. data/lib/gdal/raster_band_mixins/extensions.rb +34 -169
  96. data/lib/gdal/raster_band_mixins/io_extensions.rb +180 -0
  97. data/lib/gdal/rpc_info.rb +1 -2
  98. data/lib/gdal/transformer.rb +1 -6
  99. data/lib/gdal/transformers/approximate_transformer.rb +0 -4
  100. data/lib/gdal/transformers/base_general_image_projection_transformer.rb +0 -6
  101. data/lib/gdal/transformers/gcp_transformer.rb +2 -6
  102. data/lib/gdal/transformers/general_image_projection_transformer.rb +8 -7
  103. data/lib/gdal/transformers/general_image_projection_transformer2.rb +1 -1
  104. data/lib/gdal/transformers/geolocation_transformer.rb +0 -4
  105. data/lib/gdal/transformers/reprojection_transformer.rb +0 -8
  106. data/lib/gdal/transformers/rpc_transformer.rb +0 -4
  107. data/lib/gdal/transformers/tps_transformer.rb +1 -3
  108. data/lib/gdal/version_info.rb +7 -8
  109. data/lib/gdal/virtual_dataset.rb +2 -4
  110. data/lib/gdal/warp_operation.rb +17 -14
  111. data/lib/gdal/warp_options.rb +132 -0
  112. data/lib/gdal.rb +41 -2
  113. data/lib/ogr/coordinate_transformation.rb +79 -32
  114. data/lib/ogr/data_source.rb +17 -14
  115. data/lib/ogr/data_source_extensions.rb +1 -5
  116. data/lib/ogr/driver.rb +11 -14
  117. data/lib/ogr/envelope.rb +1 -1
  118. data/lib/ogr/envelope_extensions.rb +23 -6
  119. data/lib/ogr/error_handling.rb +3 -3
  120. data/lib/ogr/exceptions.rb +6 -0
  121. data/lib/ogr/feature.rb +25 -38
  122. data/lib/ogr/feature_definition.rb +6 -8
  123. data/lib/ogr/feature_definition_extensions.rb +2 -6
  124. data/lib/ogr/feature_extensions.rb +71 -41
  125. data/lib/ogr/field.rb +16 -15
  126. data/lib/ogr/field_definition.rb +4 -4
  127. data/lib/ogr/geocoder.rb +5 -5
  128. data/lib/ogr/geometries/geometry_collection.rb +4 -1
  129. data/lib/ogr/geometries/geometry_collection_25d.rb +12 -0
  130. data/lib/ogr/geometries/line_string.rb +30 -8
  131. data/lib/ogr/geometries/line_string_25d.rb +21 -0
  132. data/lib/ogr/geometries/linear_ring.rb +10 -1
  133. data/lib/ogr/geometries/multi_line_string.rb +2 -1
  134. data/lib/ogr/geometries/multi_line_string_25d.rb +13 -0
  135. data/lib/ogr/geometries/multi_point.rb +2 -1
  136. data/lib/ogr/geometries/multi_point_25d.rb +14 -0
  137. data/lib/ogr/geometries/multi_polygon.rb +3 -2
  138. data/lib/ogr/geometries/multi_polygon_25d.rb +13 -0
  139. data/lib/ogr/geometries/point.rb +20 -23
  140. data/lib/ogr/geometries/point_25d.rb +48 -0
  141. data/lib/ogr/geometries/polygon.rb +4 -1
  142. data/lib/ogr/geometries/polygon_25d.rb +14 -0
  143. data/lib/ogr/geometry.rb +125 -93
  144. data/lib/ogr/geometry_field_definition.rb +7 -5
  145. data/lib/ogr/geometry_mixins/container_mixins.rb +23 -0
  146. data/lib/ogr/geometry_mixins/extensions.rb +111 -0
  147. data/lib/ogr/geometry_types/container.rb +10 -3
  148. data/lib/ogr/geometry_types/curve.rb +68 -23
  149. data/lib/ogr/geometry_types/surface.rb +0 -9
  150. data/lib/ogr/internal_helpers.rb +3 -3
  151. data/lib/ogr/layer.rb +4 -5
  152. data/lib/ogr/layer_mixins/extensions.rb +242 -17
  153. data/lib/ogr/layer_mixins/ogr_feature_methods.rb +11 -11
  154. data/lib/ogr/layer_mixins/ogr_field_methods.rb +6 -11
  155. data/lib/ogr/layer_mixins/ogr_layer_method_methods.rb +18 -18
  156. data/lib/ogr/layer_mixins/ogr_query_filter_methods.rb +0 -2
  157. data/lib/ogr/layer_mixins/ogr_sql_methods.rb +1 -1
  158. data/lib/ogr/spatial_reference.rb +12 -37
  159. data/lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb +53 -55
  160. data/lib/ogr/spatial_reference_mixins/exporters.rb +18 -49
  161. data/lib/ogr/spatial_reference_mixins/parameter_getter_setters.rb +10 -29
  162. data/lib/ogr/style_table.rb +2 -2
  163. data/lib/ogr/style_table_extensions.rb +3 -1
  164. data/lib/ogr/style_tool.rb +8 -14
  165. data/lib/ogr.rb +39 -1
  166. data/spec/ffi-gdal_spec.rb +18 -1
  167. data/spec/integration/gdal/color_table_info_spec.rb +49 -33
  168. data/spec/integration/gdal/dataset_info_spec.rb +294 -45
  169. data/spec/integration/gdal/driver_info_spec.rb +139 -31
  170. data/spec/integration/gdal/geo_transform_info_spec.rb +197 -26
  171. data/spec/integration/gdal/gridder_spec.rb +329 -0
  172. data/spec/integration/gdal/raster_attribute_table_info_spec.rb +216 -11
  173. data/spec/integration/gdal/raster_band_algorithms_spec.rb +33 -0
  174. data/spec/integration/gdal/raster_band_info_spec.rb +240 -271
  175. data/spec/integration/ogr/layer_spec.rb +3 -1
  176. data/spec/spec_helper.rb +15 -6
  177. data/spec/support/images/osgeo/gdal/data/hfa/float-rle.img +0 -0
  178. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.lgo +31 -0
  179. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif +0 -0
  180. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif.msk +0 -0
  181. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.txt +10 -0
  182. data/spec/support/images/osgeo/geotiff/gdal_eg/cea.tif +0 -0
  183. data/spec/support/images/osgeo/geotiff/gdal_eg/cea.txt +84 -0
  184. data/spec/support/images/osgeo/geotiff/zi_imaging/image0.lgo +45 -0
  185. data/spec/support/images/osgeo/geotiff/zi_imaging/image0.tif +0 -0
  186. data/spec/support/integration_help.rb +32 -2
  187. data/spec/support/shared_examples/gdal/major_object_examples.rb +0 -6
  188. data/spec/support/shared_examples/ogr/a_geometry.rb +1 -1
  189. data/spec/unit/ffi/gdal_spec.rb +1 -1
  190. data/spec/unit/gdal/color_entry_spec.rb +1 -0
  191. data/spec/unit/gdal/color_interpretation_spec.rb +1 -0
  192. data/spec/unit/gdal/dataset_spec.rb +53 -2
  193. data/spec/unit/gdal/geo_transform_mixins/extensions_spec.rb +67 -0
  194. data/spec/unit/gdal/geo_transform_spec.rb +1 -1
  195. data/spec/unit/gdal/grid_spec.rb +83 -0
  196. data/spec/unit/gdal/gridder/point_extracting_spec.rb +99 -0
  197. data/spec/unit/gdal/gridder_options_spec.rb +183 -0
  198. data/spec/unit/gdal/gridder_spec.rb +140 -0
  199. data/spec/unit/gdal/internal_helpers_spec.rb +166 -2
  200. data/spec/unit/gdal/major_object_spec.rb +2 -0
  201. data/spec/unit/gdal/options_spec.rb +1 -0
  202. data/spec/unit/gdal/raster_band_classifier_spec.rb +70 -12
  203. data/spec/unit/gdal/raster_band_mixins/extensions_spec.rb +71 -0
  204. data/spec/unit/gdal/raster_band_mixins/io_extensions_spec.rb +133 -0
  205. data/spec/unit/gdal/raster_band_spec.rb +1 -0
  206. data/spec/unit/gdal/rpc_info_spec.rb +1 -0
  207. data/spec/unit/gdal/version_info_spec.rb +2 -0
  208. data/spec/unit/gdal/warp_operation_spec.rb +1 -0
  209. data/spec/unit/ogr/coordinate_transformation_spec.rb +102 -0
  210. data/spec/unit/ogr/data_source_spec.rb +12 -0
  211. data/spec/unit/ogr/feature_extensions_spec.rb +88 -0
  212. data/spec/unit/ogr/feature_spec.rb +30 -46
  213. data/spec/unit/ogr/geometries/geometry_collection_25d_spec.rb +23 -0
  214. data/spec/unit/ogr/geometries/geometry_collection_spec.rb +3 -3
  215. data/spec/unit/ogr/geometries/line_string_25d_spec.rb +23 -0
  216. data/spec/unit/ogr/geometries/line_string_spec.rb +2 -2
  217. data/spec/unit/ogr/geometries/linear_ring_spec.rb +2 -2
  218. data/spec/unit/ogr/geometries/multi_line_string_25d_spec.rb +23 -0
  219. data/spec/unit/ogr/geometries/multi_point_25d_spec.rb +23 -0
  220. data/spec/unit/ogr/geometries/multi_polygon_25d_spec.rb +23 -0
  221. data/spec/unit/ogr/geometries/point_25d_spec.rb +23 -0
  222. data/spec/unit/ogr/geometries/point_spec.rb +14 -24
  223. data/spec/unit/ogr/geometries/polygon_25d_spec.rb +23 -0
  224. data/spec/unit/ogr/geometries/polygon_spec.rb +1 -1
  225. data/spec/unit/ogr/geometry_field_definition_spec.rb +1 -1
  226. data/spec/unit/ogr/geometry_spec.rb +196 -30
  227. data/spec/unit/ogr/internal_helpers_spec.rb +20 -9
  228. data/spec/unit/ogr/layer_mixins/ogr_feature_methods_spec.rb +14 -6
  229. data/spec/unit/ogr/spatial_reference_mixins/exporters_spec.rb +9 -1
  230. data/spec/unit/ogr/spatial_reference_mixins/parameter_getter_setters_spec.rb +2 -1
  231. data/spec/unit/ogr/style_table_spec.rb +1 -1
  232. data/tmp/.keep +0 -0
  233. metadata +121 -19
  234. data/examples/points.txt +0 -127
  235. data/lib/gdal/grid_types.rb +0 -22
  236. data/lib/ogr/geometries/point_extensions.rb +0 -32
  237. data/lib/ogr/geometry_extensions.rb +0 -59
data/lib/ffi/gdal/alg.rb CHANGED
@@ -1,10 +1,5 @@
1
1
  require 'ffi'
2
2
  require_relative '../../ext/ffi_library_function_checks'
3
- require_relative 'rpc_info'
4
- require_relative '../ogr/api'
5
- require_relative '../cpl/error'
6
- require_relative '../cpl/port'
7
- require_relative '../cpl/xml_node'
8
3
 
9
4
  module FFI
10
5
  module GDAL
@@ -39,27 +34,29 @@ module FFI
39
34
  # -----------------------------------------------------------------------
40
35
  # Functions
41
36
  # -----------------------------------------------------------------------
37
+ attach_function :GDALDestroyTransformer, %i[pointer], :void
38
+
42
39
  attach_function :GDALChecksumImage,
43
- [GDAL.find_type(:GDALRasterBandH), :int, :int, :int, :int],
40
+ [FFI::GDAL::GDAL.find_type(:GDALRasterBandH), :int, :int, :int, :int],
44
41
  :int
45
42
  attach_function :GDALComputeMedianCutPCT,
46
43
  [
47
- GDAL.find_type(:GDALRasterBandH),
48
- GDAL.find_type(:GDALRasterBandH),
49
- GDAL.find_type(:GDALRasterBandH),
44
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
45
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
46
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
50
47
  :pointer,
51
48
  :int,
52
- GDAL.find_type(:GDALColorTableH),
53
- GDAL.find_type(:GDALProgressFunc),
49
+ FFI::GDAL::GDAL.find_type(:GDALColorTableH),
50
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
54
51
  :pointer
55
52
  ],
56
53
  :int
57
54
  attach_function :GDALComputeProximity,
58
55
  [
59
- GDAL.find_type(:GDALRasterBandH),
60
- GDAL.find_type(:GDALRasterBandH),
56
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
57
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
61
58
  :pointer,
62
- GDAL.find_type(:GDALProgressFunc),
59
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
63
60
  :pointer
64
61
  ],
65
62
  CPL::Error::CPLErr
@@ -88,7 +85,7 @@ module FFI
88
85
  CPL::Error::CPLErr
89
86
  attach_function :GDALContourGenerate,
90
87
  [
91
- GDAL.find_type(:GDALRasterBandH),
88
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
92
89
  :double,
93
90
  :double,
94
91
  :int,
@@ -98,7 +95,7 @@ module FFI
98
95
  :pointer,
99
96
  :int,
100
97
  :int,
101
- GDAL.find_type(:GDALProgressFunc),
98
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
102
99
  :pointer
103
100
  ],
104
101
  CPL::Error::CPLErr
@@ -106,12 +103,9 @@ module FFI
106
103
  # ~~~~~~~~~~~~~~~~~~~~~
107
104
  # Transformer functions
108
105
  # ~~~~~~~~~~~~~~~~~~~~~
109
- attach_function :GDALSetTransformerDstGeoTransform,
110
- %i[pointer pointer],
111
- :void
112
106
  attach_function :GDALSuggestedWarpOutput,
113
107
  [
114
- GDAL.find_type(:GDALDatasetH),
108
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
115
109
  :GDALTransformerFunc,
116
110
  :pointer,
117
111
  :pointer,
@@ -121,7 +115,7 @@ module FFI
121
115
  CPL::Error::CPLErr
122
116
  attach_function :GDALSuggestedWarpOutput2,
123
117
  [
124
- GDAL.find_type(:GDALDatasetH),
118
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
125
119
  :GDALTransformerFunc,
126
120
  :pointer,
127
121
  :pointer,
@@ -139,12 +133,12 @@ module FFI
139
133
  CPL::Error::CPLErr
140
134
  attach_function :GDALTransformGeolocations,
141
135
  [
142
- GDAL.find_type(:GDALRasterBandH),
143
- GDAL.find_type(:GDALRasterBandH),
144
- GDAL.find_type(:GDALRasterBandH),
136
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
137
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
138
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
145
139
  :GDALTransformerFunc,
146
140
  :pointer,
147
- GDAL.find_type(:GDALProgressFunc),
141
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
148
142
  :pointer,
149
143
  :pointer
150
144
  ],
@@ -180,7 +174,7 @@ module FFI
180
174
  # GeoLoc Transform
181
175
  # ~~~
182
176
  attach_function :GDALCreateGeoLocTransformer,
183
- [GDAL.find_type(:GDALDatasetH), :pointer, :bool],
177
+ [FFI::GDAL::GDAL.find_type(:GDALDatasetH), :pointer, :bool],
184
178
  :pointer
185
179
  attach_function :GDALDestroyGeoLocTransformer, %i[pointer], :void
186
180
  GeoLocTransform = attach_function :GDALGeoLocTransform,
@@ -192,9 +186,9 @@ module FFI
192
186
  # ~~~
193
187
  attach_function :GDALCreateGenImgProjTransformer,
194
188
  [
195
- GDAL.find_type(:GDALDatasetH),
189
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
196
190
  :string,
197
- GDAL.find_type(:GDALDatasetH),
191
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
198
192
  :string,
199
193
  :bool,
200
194
  :double,
@@ -202,7 +196,7 @@ module FFI
202
196
  ],
203
197
  :pointer
204
198
  attach_function :GDALCreateGenImgProjTransformer2,
205
- [GDAL.find_type(:GDALDatasetH), GDAL.find_type(:GDALDatasetH), :pointer],
199
+ [FFI::GDAL::GDAL.find_type(:GDALDatasetH), FFI::GDAL::GDAL.find_type(:GDALDatasetH), :pointer],
206
200
  :pointer
207
201
  attach_function :GDALCreateGenImgProjTransformer3,
208
202
  %i[string pointer string pointer],
@@ -232,7 +226,7 @@ module FFI
232
226
  attach_function :GDALCreateRPCTransformer,
233
227
  [RPCInfo.ptr, :int, :double, :pointer],
234
228
  :pointer
235
- attach_function :RPCInfoToMD, [GDAL::RPCInfo.ptr], :pointer
229
+ attach_function :RPCInfoToMD, [RPCInfo.ptr], :pointer
236
230
  attach_function :GDALDestroyRPCTransformer, %i[pointer], :void
237
231
  RPCTransform = attach_function :GDALRPCTransform,
238
232
  %i[pointer bool int pointer pointer pointer pointer],
@@ -247,48 +241,63 @@ module FFI
247
241
  %i[pointer bool int pointer pointer pointer pointer],
248
242
  :int
249
243
 
244
+ # ~~~
245
+ # RasterBand related functions
246
+ # ~~~
250
247
  attach_function :GDALDitherRGB2PCT,
251
248
  [
252
- GDAL.find_type(:GDALRasterBandH),
253
- GDAL.find_type(:GDALRasterBandH),
254
- GDAL.find_type(:GDALRasterBandH),
255
- GDAL.find_type(:GDALRasterBandH),
256
- GDAL.find_type(:GDALColorTableH),
257
- GDAL.find_type(:GDALProgressFunc),
249
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
250
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
251
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
252
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
253
+ FFI::GDAL::GDAL.find_type(:GDALColorTableH),
254
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
258
255
  :pointer
259
256
  ],
260
257
  CPL::Error::CPLErr
261
258
  attach_function :GDALFillNodata,
262
259
  [
263
- GDAL.find_type(:GDALRasterBandH),
264
- GDAL.find_type(:GDALRasterBandH),
260
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
261
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
265
262
  :double,
266
263
  :int,
267
264
  :int,
268
265
  :pointer,
269
- GDAL.find_type(:GDALProgressFunc),
266
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
270
267
  :pointer
271
268
  ],
272
269
  CPL::Error::CPLErr
273
270
  attach_function :GDALPolygonize,
274
271
  [
275
- GDAL.find_type(:GDALRasterBandH),
276
- GDAL.find_type(:GDALRasterBandH),
272
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
273
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
277
274
  OGR::API.find_type(:OGRLayerH),
278
275
  :int,
279
276
  :pointer,
280
- GDAL.find_type(:GDALProgressFunc),
277
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
281
278
  :pointer
282
279
  ],
283
280
  CPL::Error::CPLErr
284
281
  attach_function :GDALFPolygonize,
285
282
  [
286
- GDAL.find_type(:GDALRasterBandH),
287
- GDAL.find_type(:GDALRasterBandH),
283
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
284
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
288
285
  OGR::API.find_type(:OGRLayerH),
289
286
  :int,
290
287
  :pointer,
291
- GDAL.find_type(:GDALProgressFunc),
288
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
289
+ :pointer
290
+ ],
291
+ CPL::Error::CPLErr
292
+ attach_function :GDALSieveFilter,
293
+ [
294
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
295
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
296
+ FFI::GDAL::GDAL.find_type(:GDALRasterBandH),
297
+ :int,
298
+ :int,
299
+ :pointer,
300
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
292
301
  :pointer
293
302
  ],
294
303
  CPL::Error::CPLErr
@@ -312,13 +321,13 @@ module FFI
312
321
  CPL::Port.find_type(:GUInt32),
313
322
  GDAL::DataType,
314
323
  :pointer,
315
- GDAL.find_type(:GDALProgressFunc),
324
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
316
325
  :pointer
317
326
  ],
318
327
  CPL::Error::CPLErr
319
328
  attach_function :GDALRasterizeGeometries,
320
329
  [
321
- GDAL.find_type(:GDALDatasetH),
330
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
322
331
  :int,
323
332
  :pointer,
324
333
  :int,
@@ -327,13 +336,13 @@ module FFI
327
336
  :pointer,
328
337
  :pointer,
329
338
  :pointer,
330
- GDAL.find_type(:GDALProgressFunc),
339
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
331
340
  :pointer
332
341
  ],
333
342
  CPL::Error::CPLErr
334
343
  attach_function :GDALRasterizeLayers,
335
344
  [
336
- GDAL.find_type(:GDALDatasetH),
345
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
337
346
  :int,
338
347
  :pointer,
339
348
  :int,
@@ -342,7 +351,7 @@ module FFI
342
351
  :pointer,
343
352
  :pointer,
344
353
  :pointer,
345
- GDAL.find_type(:GDALProgressFunc),
354
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
346
355
  :pointer
347
356
  ],
348
357
  CPL::Error::CPLErr
@@ -362,24 +371,33 @@ module FFI
362
371
  :pointer,
363
372
  :double,
364
373
  :pointer,
365
- GDAL.find_type(:GDALProgressFunc),
374
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
366
375
  :pointer
367
376
  ],
368
377
  CPL::Error::CPLErr
369
378
 
370
379
  attach_function :GDALSimpleImageWarp,
371
380
  [
372
- GDAL.find_type(:GDALDatasetH),
373
- GDAL.find_type(:GDALDatasetH),
381
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
382
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
374
383
  :int,
375
384
  :pointer,
376
385
  :GDALTransformerFunc,
377
386
  :pointer,
378
- GDAL.find_type(:GDALProgressFunc),
387
+ FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
379
388
  :pointer,
380
389
  :pointer
381
390
  ],
382
391
  :bool
392
+
393
+ attach_function :GDALComputeMatchingPoints,
394
+ [
395
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
396
+ FFI::GDAL::GDAL.find_type(:GDALDatasetH),
397
+ :pointer,
398
+ :pointer
399
+ ],
400
+ FFI::GDAL::GCP.ptr
383
401
  end
384
402
  end
385
403
  end