ffi-gdal 1.0.0.beta16 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +17 -0
  3. data/.github/workflows/codacy.yml +61 -0
  4. data/.github/workflows/codeql.yml +74 -0
  5. data/.github/workflows/continuous-integration.yml +36 -0
  6. data/.github/workflows/dependency-review.yml +20 -0
  7. data/.github/workflows/specs-in-docker.yml +27 -0
  8. data/.gitignore +3 -0
  9. data/.rspec +1 -0
  10. data/.rubocop.yml +10 -80
  11. data/.rubocop_todo.yml +23 -40
  12. data/.ruby-version +1 -1
  13. data/Changelog-0.x.md +512 -0
  14. data/Changelog.md +12 -0
  15. data/Dockerfile.gdal2 +110 -0
  16. data/Dockerfile.gdal3 +73 -0
  17. data/README.md +25 -14
  18. data/Rakefile +0 -8
  19. data/Tiltfile +91 -0
  20. data/bin/bundle +123 -0
  21. data/bin/docker-clean +8 -0
  22. data/bin/rake +29 -0
  23. data/bin/rspec +29 -0
  24. data/bin/rubocop +29 -0
  25. data/docker-compose.yml +25 -0
  26. data/examples/extract_and_colorize.rb +0 -13
  27. data/examples/geometries.rb +14 -14
  28. data/examples/ogr_layer_to_layer.rb +1 -3
  29. data/examples/raster_erasing.rb +1 -0
  30. data/examples/remove_small_polygons.rb +1 -1
  31. data/examples/testing_gdal.rb +20 -17
  32. data/examples/warping.rb +9 -7
  33. data/ffi-gdal.gemspec +12 -6
  34. data/lib/ext/ffi_library_function_checks.rb +2 -2
  35. data/lib/ext/to_bool.rb +5 -3
  36. data/lib/ffi/cpl/conv.rb +27 -25
  37. data/lib/ffi/cpl/error.rb +19 -20
  38. data/lib/ffi/cpl/hash_set.rb +4 -4
  39. data/lib/ffi/cpl/http.rb +3 -3
  40. data/lib/ffi/cpl/http_result.rb +8 -8
  41. data/lib/ffi/cpl/list.rb +1 -1
  42. data/lib/ffi/cpl/mime_part.rb +2 -2
  43. data/lib/ffi/cpl/minixml.rb +7 -7
  44. data/lib/ffi/cpl/progress.rb +8 -8
  45. data/lib/ffi/cpl/quad_tree.rb +14 -14
  46. data/lib/ffi/cpl/rect_obj.rb +3 -3
  47. data/lib/ffi/cpl/string.rb +17 -20
  48. data/lib/ffi/cpl/vsi.rb +13 -13
  49. data/lib/ffi/cpl/xml_node.rb +3 -3
  50. data/lib/ffi/extensions/gdal/extensions/all.rb +4 -0
  51. data/lib/ffi/extensions/gdal/extensions/version.rb +9 -0
  52. data/lib/ffi/extensions/gdal/extensions.rb +12 -0
  53. data/lib/ffi/extensions/rttopo/gbox.rb +19 -0
  54. data/lib/ffi/extensions/rttopo/geom.rb +16 -0
  55. data/lib/ffi/extensions/rttopo.rb +41 -0
  56. data/lib/ffi/gdal/alg.rb +277 -277
  57. data/lib/ffi/gdal/color_entry.rb +3 -3
  58. data/lib/ffi/gdal/gcp.rb +6 -6
  59. data/lib/ffi/gdal/gdal.rb +349 -349
  60. data/lib/ffi/gdal/grid.rb +134 -134
  61. data/lib/ffi/gdal/grid_data_metrics_options.rb +4 -4
  62. data/lib/ffi/gdal/grid_inverse_distance_to_a_power_options.rb +9 -9
  63. data/lib/ffi/gdal/grid_moving_average_options.rb +4 -4
  64. data/lib/ffi/gdal/grid_nearest_neighbor_options.rb +3 -3
  65. data/lib/ffi/gdal/matching.rb +3 -3
  66. data/lib/ffi/gdal/rpc_info.rb +17 -17
  67. data/lib/ffi/gdal/transformer_info.rb +4 -4
  68. data/lib/ffi/gdal/version.rb +1 -1
  69. data/lib/ffi/gdal/vrt.rb +39 -39
  70. data/lib/ffi/gdal/warp_options.rb +34 -34
  71. data/lib/ffi/gdal/warper.rb +90 -90
  72. data/lib/ffi/gdal.rb +2 -31
  73. data/lib/ffi/ogr/api.rb +175 -167
  74. data/lib/ffi/ogr/contour_writer_info.rb +4 -4
  75. data/lib/ffi/ogr/core.rb +107 -107
  76. data/lib/ffi/ogr/envelope.rb +3 -3
  77. data/lib/ffi/ogr/envelope_3d.rb +5 -5
  78. data/lib/ffi/ogr/featurestyle.rb +3 -3
  79. data/lib/ffi/ogr/field.rb +22 -22
  80. data/lib/ffi/ogr/geocoding.rb +4 -4
  81. data/lib/ffi/ogr/srs_api.rb +154 -155
  82. data/lib/ffi/ogr/style_param.rb +3 -3
  83. data/lib/ffi/ogr/style_value.rb +4 -4
  84. data/lib/gdal/color_entry.rb +1 -5
  85. data/lib/gdal/color_interpretation.rb +7 -3
  86. data/lib/gdal/color_table.rb +46 -27
  87. data/lib/gdal/cpl_error_handler.rb +26 -6
  88. data/lib/gdal/data_type.rb +10 -3
  89. data/lib/gdal/dataset.rb +171 -85
  90. data/lib/gdal/dataset_mixins/algorithm_methods.rb +44 -44
  91. data/lib/gdal/dataset_mixins/matching.rb +1 -1
  92. data/lib/gdal/dataset_mixins/warp_methods.rb +4 -2
  93. data/lib/gdal/driver.rb +38 -21
  94. data/lib/gdal/environment_methods.rb +6 -6
  95. data/lib/gdal/extensions/all.rb +3 -0
  96. data/lib/gdal/{color_entry_mixins → extensions/color_entry}/extensions.rb +4 -1
  97. data/lib/gdal/{color_table_mixins → extensions/color_table}/extensions.rb +3 -0
  98. data/lib/gdal/extensions/dataset/extensions.rb +205 -0
  99. data/lib/gdal/{driver_mixins → extensions/driver}/extensions.rb +6 -2
  100. data/lib/gdal/{geo_transform_mixins → extensions/geo_transform}/extensions.rb +10 -8
  101. data/lib/gdal/{gridder → extensions/gridder}/point_extracting.rb +7 -5
  102. data/lib/gdal/{gridder.rb → extensions/gridder.rb} +33 -33
  103. data/lib/gdal/{gridder_options.rb → extensions/gridder_options.rb} +13 -14
  104. data/lib/gdal/{raster_attribute_table_mixins → extensions/raster_attribute_table}/extensions.rb +8 -6
  105. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/algorithm_extensions.rb +8 -6
  106. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/coloring_extensions.rb +6 -4
  107. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/extensions.rb +9 -5
  108. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/io_extensions.rb +18 -14
  109. data/lib/gdal/{raster_band_classifier.rb → extensions/raster_band_classifier.rb} +3 -5
  110. data/lib/gdal/geo_transform.rb +1 -6
  111. data/lib/gdal/grid.rb +3 -2
  112. data/lib/gdal/grid_algorithms.rb +9 -9
  113. data/lib/gdal/internal_helpers.rb +46 -9
  114. data/lib/gdal/major_object.rb +11 -3
  115. data/lib/gdal/options.rb +26 -32
  116. data/lib/gdal/raster_attribute_table.rb +63 -37
  117. data/lib/gdal/raster_band.rb +164 -116
  118. data/lib/gdal/raster_band_mixins/algorithm_methods.rb +26 -25
  119. data/lib/gdal/rpc_info.rb +3 -2
  120. data/lib/gdal/transformers/approximate_transformer.rb +12 -3
  121. data/lib/gdal/transformers/base_general_image_projection_transformer.rb +15 -2
  122. data/lib/gdal/transformers/gcp_transformer.rb +27 -19
  123. data/lib/gdal/transformers/general_image_projection_transformer.rb +8 -6
  124. data/lib/gdal/transformers/general_image_projection_transformer2.rb +9 -6
  125. data/lib/gdal/transformers/general_image_projection_transformer3.rb +6 -2
  126. data/lib/gdal/transformers/geolocation_transformer.rb +12 -4
  127. data/lib/gdal/transformers/reprojection_transformer.rb +11 -3
  128. data/lib/gdal/transformers/rpc_transformer.rb +11 -2
  129. data/lib/gdal/transformers/tps_transformer.rb +12 -4
  130. data/lib/gdal/version_info.rb +2 -2
  131. data/lib/gdal/virtual_dataset.rb +2 -0
  132. data/lib/gdal/warp_operation.rb +65 -54
  133. data/lib/gdal/warp_options.rb +9 -11
  134. data/lib/ogr/coordinate_transformation.rb +23 -9
  135. data/lib/ogr/data_source.rb +68 -37
  136. data/lib/ogr/driver.rb +18 -17
  137. data/lib/ogr/envelope.rb +0 -3
  138. data/lib/ogr/error_handling.rb +22 -24
  139. data/lib/ogr/extensions/all.rb +3 -0
  140. data/lib/ogr/{data_source_mixins → extensions/data_source}/capability_methods.rb +2 -0
  141. data/lib/ogr/extensions/data_source/data_source_extensions.rb +16 -0
  142. data/lib/ogr/{driver_mixins → extensions/driver}/capability_methods.rb +5 -1
  143. data/lib/ogr/extensions/envelope/extensions.rb +114 -0
  144. data/lib/ogr/extensions/feature/extensions.rb +87 -0
  145. data/lib/ogr/extensions/feature_definition/extensions.rb +43 -0
  146. data/lib/ogr/extensions/geometries/point/extensions.rb +19 -0
  147. data/lib/ogr/extensions/geometry/container_mixins.rb +56 -0
  148. data/lib/ogr/extensions/geometry/ewkb_io_extensions.rb +44 -0
  149. data/lib/ogr/extensions/geometry/ewkb_record.rb +94 -0
  150. data/lib/ogr/{geometry_mixins → extensions/geometry}/extensions.rb +16 -9
  151. data/lib/ogr/extensions/geometry/rttopo_extensions.rb +48 -0
  152. data/lib/ogr/extensions/geometry/wkb_record.rb +63 -0
  153. data/lib/ogr/extensions/geometry_types/curve/extensions.rb +68 -0
  154. data/lib/ogr/{layer_mixins → extensions/layer}/capability_methods.rb +4 -0
  155. data/lib/ogr/{layer_mixins → extensions/layer}/extensions.rb +11 -6
  156. data/lib/ogr/extensions/spatial_reference/extensions.rb +38 -0
  157. data/lib/ogr/extensions/spatial_reference/initializers.rb +138 -0
  158. data/lib/ogr/extensions/style_table/extensions.rb +31 -0
  159. data/lib/ogr/feature.rb +173 -88
  160. data/lib/ogr/feature_definition.rb +53 -45
  161. data/lib/ogr/field.rb +17 -19
  162. data/lib/ogr/field_definition.rb +30 -18
  163. data/lib/ogr/geocoder.rb +11 -4
  164. data/lib/ogr/geometries/line_string.rb +1 -0
  165. data/lib/ogr/geometries/line_string_25d.rb +0 -9
  166. data/lib/ogr/geometries/linear_ring.rb +2 -2
  167. data/lib/ogr/geometries/point.rb +0 -9
  168. data/lib/ogr/geometry.rb +116 -49
  169. data/lib/ogr/geometry_field_definition.rb +31 -15
  170. data/lib/ogr/geometry_types/container.rb +26 -28
  171. data/lib/ogr/geometry_types/curve.rb +5 -61
  172. data/lib/ogr/geometry_types/surface.rb +1 -1
  173. data/lib/ogr/internal_helpers.rb +2 -2
  174. data/lib/ogr/layer.rb +12 -10
  175. data/lib/ogr/layer_mixins/ogr_feature_methods.rb +39 -27
  176. data/lib/ogr/layer_mixins/ogr_field_methods.rb +66 -50
  177. data/lib/ogr/layer_mixins/ogr_layer_method_methods.rb +17 -8
  178. data/lib/ogr/layer_mixins/ogr_query_filter_methods.rb +7 -6
  179. data/lib/ogr/layer_mixins/ogr_sql_methods.rb +15 -7
  180. data/lib/ogr/spatial_reference.rb +79 -42
  181. data/lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb +149 -118
  182. data/lib/ogr/spatial_reference_mixins/exporters.rb +87 -51
  183. data/lib/ogr/spatial_reference_mixins/importers.rb +88 -43
  184. data/lib/ogr/spatial_reference_mixins/morphers.rb +12 -8
  185. data/lib/ogr/spatial_reference_mixins/parameter_getter_setters.rb +27 -13
  186. data/lib/ogr/style_table.rb +15 -5
  187. data/lib/ogr/style_tool.rb +29 -15
  188. data/lib/ogr.rb +1 -0
  189. data/rakelib/docker.rake +10 -0
  190. data/sorbet/rbi/hidden-definitions/errors.txt +21790 -0
  191. data/tilt/gdal2.yml +22 -0
  192. data/tilt/gdal3.yml +22 -0
  193. metadata +116 -280
  194. data/History.md +0 -360
  195. data/lib/ext/error_symbols.rb +0 -7
  196. data/lib/gdal/dataset_mixins/extensions.rb +0 -380
  197. data/lib/gdal/merger.rb +0 -132
  198. data/lib/ogr/data_source_extensions.rb +0 -10
  199. data/lib/ogr/envelope_extensions.rb +0 -110
  200. data/lib/ogr/feature_definition_extensions.rb +0 -39
  201. data/lib/ogr/feature_extensions.rb +0 -87
  202. data/lib/ogr/geometry_mixins/container_mixins.rb +0 -25
  203. data/lib/ogr/spatial_reference_extensions.rb +0 -34
  204. data/lib/ogr/style_table_extensions.rb +0 -26
  205. data/spec/ffi-gdal_spec.rb +0 -24
  206. data/spec/integration/gdal/color_table_info_spec.rb +0 -78
  207. data/spec/integration/gdal/dataset_info_spec.rb +0 -342
  208. data/spec/integration/gdal/driver_info_spec.rb +0 -170
  209. data/spec/integration/gdal/geo_transform_info_spec.rb +0 -226
  210. data/spec/integration/gdal/gridder_spec.rb +0 -331
  211. data/spec/integration/gdal/raster_attribute_table_info_spec.rb +0 -229
  212. data/spec/integration/gdal/raster_band_algorithms_spec.rb +0 -35
  213. data/spec/integration/gdal/raster_band_info_spec.rb +0 -320
  214. data/spec/integration/ogr/layer_spec.rb +0 -95
  215. data/spec/spec_helper.rb +0 -116
  216. data/spec/support/images/123.tiff +0 -0
  217. data/spec/support/images/osgeo/gdal/data/hfa/float-rle.img +0 -0
  218. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.lgo +0 -31
  219. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif +0 -0
  220. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif.msk +0 -0
  221. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.txt +0 -10
  222. data/spec/support/images/osgeo/geotiff/gdal_eg/cea.tif +0 -0
  223. data/spec/support/images/osgeo/geotiff/gdal_eg/cea.txt +0 -84
  224. data/spec/support/images/osgeo/geotiff/zi_imaging/image0.lgo +0 -45
  225. data/spec/support/images/osgeo/geotiff/zi_imaging/image0.tif +0 -0
  226. data/spec/support/integration_help.rb +0 -34
  227. data/spec/support/shapefiles/states_21basic/states.dbf +0 -0
  228. data/spec/support/shapefiles/states_21basic/states.prj +0 -1
  229. data/spec/support/shapefiles/states_21basic/states.sbn +0 -0
  230. data/spec/support/shapefiles/states_21basic/states.sbx +0 -0
  231. data/spec/support/shapefiles/states_21basic/states.shp +0 -0
  232. data/spec/support/shapefiles/states_21basic/states.shp.xml +0 -3
  233. data/spec/support/shapefiles/states_21basic/states.shx +0 -0
  234. data/spec/support/shared_contexts.rb +0 -28
  235. data/spec/support/shared_examples/gdal/major_object_examples.rb +0 -55
  236. data/spec/support/shared_examples/ogr/a_25d_geometry.rb +0 -9
  237. data/spec/support/shared_examples/ogr/a_container_geometry.rb +0 -49
  238. data/spec/support/shared_examples/ogr/a_geometry.rb +0 -406
  239. data/spec/support/shared_examples/ogr/a_line_string.rb +0 -18
  240. data/spec/support/test_style_table.txt +0 -3
  241. data/spec/support/worldfiles/SR_50M/SR_50M.VERSION.txt +0 -1
  242. data/spec/support/worldfiles/SR_50M/SR_50M.prj +0 -1
  243. data/spec/support/worldfiles/SR_50M/SR_50M.tfw +0 -6
  244. data/spec/support/worldfiles/SR_50M/SR_50M.tif +0 -0
  245. data/spec/unit/ext/error_symbols_spec.rb +0 -69
  246. data/spec/unit/ext/numeric_as_data_type_spec.rb +0 -115
  247. data/spec/unit/ffi/gdal_spec.rb +0 -73
  248. data/spec/unit/gdal/color_entry_spec.rb +0 -8
  249. data/spec/unit/gdal/color_interpretation_spec.rb +0 -8
  250. data/spec/unit/gdal/color_table_mixins/extensions_spec.rb +0 -62
  251. data/spec/unit/gdal/color_table_spec.rb +0 -146
  252. data/spec/unit/gdal/data_type_spec.rb +0 -74
  253. data/spec/unit/gdal/dataset_mixins/warp_methods_spec.rb +0 -55
  254. data/spec/unit/gdal/dataset_spec.rb +0 -148
  255. data/spec/unit/gdal/driver_mixins/extensions_spec.rb +0 -24
  256. data/spec/unit/gdal/driver_spec.rb +0 -51
  257. data/spec/unit/gdal/environment_methods_spec.rb +0 -8
  258. data/spec/unit/gdal/geo_transform_mixins/extensions_spec.rb +0 -69
  259. data/spec/unit/gdal/geo_transform_spec.rb +0 -265
  260. data/spec/unit/gdal/grid_spec.rb +0 -98
  261. data/spec/unit/gdal/gridder/point_extracting_spec.rb +0 -101
  262. data/spec/unit/gdal/gridder_options_spec.rb +0 -185
  263. data/spec/unit/gdal/gridder_spec.rb +0 -182
  264. data/spec/unit/gdal/internal_helpers_spec.rb +0 -278
  265. data/spec/unit/gdal/major_object_spec.rb +0 -10
  266. data/spec/unit/gdal/options_spec.rb +0 -33
  267. data/spec/unit/gdal/raster_attribute_table_spec.rb +0 -7
  268. data/spec/unit/gdal/raster_band_classifier_spec.rb +0 -260
  269. data/spec/unit/gdal/raster_band_mixins/extensions_spec.rb +0 -73
  270. data/spec/unit/gdal/raster_band_mixins/io_extensions_spec.rb +0 -135
  271. data/spec/unit/gdal/raster_band_spec.rb +0 -8
  272. data/spec/unit/gdal/rpc_info_spec.rb +0 -8
  273. data/spec/unit/gdal/version_info_spec.rb +0 -10
  274. data/spec/unit/gdal/virtual_dataset_spec.rb +0 -34
  275. data/spec/unit/gdal/warp_operation_spec.rb +0 -8
  276. data/spec/unit/gdal/warp_options_spec.rb +0 -338
  277. data/spec/unit/ogr/coordinate_transformation_spec.rb +0 -104
  278. data/spec/unit/ogr/data_source_mixins/capability_methods_spec.rb +0 -32
  279. data/spec/unit/ogr/data_source_spec.rb +0 -223
  280. data/spec/unit/ogr/driver_mixins/capability_methods_spec.rb +0 -20
  281. data/spec/unit/ogr/driver_spec.rb +0 -152
  282. data/spec/unit/ogr/envelope_spec.rb +0 -324
  283. data/spec/unit/ogr/feature_definition_spec.rb +0 -296
  284. data/spec/unit/ogr/feature_extensions_spec.rb +0 -90
  285. data/spec/unit/ogr/feature_spec.rb +0 -363
  286. data/spec/unit/ogr/field_definition_spec.rb +0 -118
  287. data/spec/unit/ogr/field_spec.rb +0 -195
  288. data/spec/unit/ogr/geometries/geometry_collection_25d_spec.rb +0 -25
  289. data/spec/unit/ogr/geometries/geometry_collection_spec.rb +0 -188
  290. data/spec/unit/ogr/geometries/line_string_25d_spec.rb +0 -25
  291. data/spec/unit/ogr/geometries/line_string_spec.rb +0 -107
  292. data/spec/unit/ogr/geometries/linear_ring_spec.rb +0 -92
  293. data/spec/unit/ogr/geometries/multi_line_string_25d_spec.rb +0 -25
  294. data/spec/unit/ogr/geometries/multi_line_string_spec.rb +0 -16
  295. data/spec/unit/ogr/geometries/multi_point_25d_spec.rb +0 -25
  296. data/spec/unit/ogr/geometries/multi_point_spec.rb +0 -16
  297. data/spec/unit/ogr/geometries/multi_polygon_25d_spec.rb +0 -25
  298. data/spec/unit/ogr/geometries/multi_polygon_spec.rb +0 -43
  299. data/spec/unit/ogr/geometries/none_geometry_spec.rb +0 -14
  300. data/spec/unit/ogr/geometries/point_25d_spec.rb +0 -25
  301. data/spec/unit/ogr/geometries/point_spec.rb +0 -307
  302. data/spec/unit/ogr/geometries/polygon_25d_spec.rb +0 -25
  303. data/spec/unit/ogr/geometries/polygon_spec.rb +0 -19
  304. data/spec/unit/ogr/geometries/unknown_geometry_spec.rb +0 -12
  305. data/spec/unit/ogr/geometry_field_definition_spec.rb +0 -73
  306. data/spec/unit/ogr/geometry_spec.rb +0 -711
  307. data/spec/unit/ogr/internal_helpers_spec.rb +0 -70
  308. data/spec/unit/ogr/layer_mixins/capability_methods_spec.rb +0 -90
  309. data/spec/unit/ogr/layer_mixins/ogr_feature_methods_spec.rb +0 -155
  310. data/spec/unit/ogr/layer_mixins/ogr_field_methods_spec.rb +0 -434
  311. data/spec/unit/ogr/layer_mixins/ogr_layer_method_methods_spec.rb +0 -22
  312. data/spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb +0 -44
  313. data/spec/unit/ogr/layer_mixins/ogr_sql_methods_spec.rb +0 -14
  314. data/spec/unit/ogr/layer_spec.rb +0 -98
  315. data/spec/unit/ogr/spatial_reference_mixins/coordinate_system_getter_setters_spec.rb +0 -48
  316. data/spec/unit/ogr/spatial_reference_mixins/exporters_spec.rb +0 -151
  317. data/spec/unit/ogr/spatial_reference_mixins/importers_spec.rb +0 -40
  318. data/spec/unit/ogr/spatial_reference_mixins/morphers_spec.rb +0 -38
  319. data/spec/unit/ogr/spatial_reference_mixins/parameter_getter_setters_spec.rb +0 -105
  320. data/spec/unit/ogr/spatial_reference_mixins/type_checks_spec.rb +0 -159
  321. data/spec/unit/ogr/spatial_reference_spec.rb +0 -44
  322. data/spec/unit/ogr/style_table_spec.rb +0 -108
  323. data/spec/unit/ogr/style_tool_spec.rb +0 -159
  324. data/spec/unit/version_info_spec.rb +0 -50
@@ -17,7 +17,7 @@ module GDAL
17
17
  # @param red_band [GDAL::RasterBand, FFI::Pointer]
18
18
  # @param green_band [GDAL::RasterBand, FFI::Pointer]
19
19
  # @param blue_band [GDAL::RasterBand, FFI::Pointer]
20
- # @param colors [Fixnum] Number of colors to return; 2-256.
20
+ # @param colors [Integer] Number of colors to return; 2-256.
21
21
  # @param color_interpretation [FFI::GDAL::GDAL::PaletteInterp] The type
22
22
  # of ColorTable to return.
23
23
  # @param progress_function [Proc, FFI:GDAL::GDAL.ProgressFunc]
@@ -90,11 +90,11 @@ module GDAL
90
90
  # of the raster data won't affect the checksum. Real and imaginary
91
91
  # components of complex bands influence the result.
92
92
  #
93
- # @param x_offset [Fixnum]
94
- # @param y_offset [Fixnum]
95
- # @param x_size [Fixnum]
96
- # @param y_size [Fixnum]
97
- # @return [Fixnum] The checksum value.
93
+ # @param x_offset [Integer]
94
+ # @param y_offset [Integer]
95
+ # @param x_size [Integer]
96
+ # @param y_size [Integer]
97
+ # @return [Integer] The checksum value.
98
98
  def checksum_image(x_offset, y_offset, x_size, y_size)
99
99
  !!FFI::GDAL::Alg.GDALChecksumImage(
100
100
  @c_pointer,
@@ -123,11 +123,11 @@ module GDAL
123
123
  # from non-zero pixel values.
124
124
  # @option options [String] distunits (PIXEL) Indicates what unit type to
125
125
  # use for computing.
126
- # @option options [Fixnum] maxdist The maximum distance to search.
127
- # @option options [Fixnum] nodata If not given, it will try to use the
126
+ # @option options [Integer] maxdist The maximum distance to search.
127
+ # @option options [Integer] nodata If not given, it will try to use the
128
128
  # nodata value on the +proximity_band+. If not found there, will use
129
129
  # 65535.
130
- # @option options [Fixnum] fixed_buf_val If set, all pixels within the
130
+ # @option options [Integer] fixed_buf_val If set, all pixels within the
131
131
  # +maxdist+ threshold are set to this fixed value instead of to a
132
132
  # proximity distance.
133
133
  def compute_proximity!(proximity_band, progress_function: nil, progress_arg: nil, **options)
@@ -164,7 +164,7 @@ module GDAL
164
164
  # be interpolated (it does so using 0-valued pixels).
165
165
  # @param max_search_distance [Float] Max number of pixels to search in all
166
166
  # directions to find values to interpolate from.
167
- # @param smoothing_iterations [Fixnum] The number of 3x3 smoothing filter
167
+ # @param smoothing_iterations [Integer] The number of 3x3 smoothing filter
168
168
  # passes to run. Can be 0.
169
169
  # @param progress_function [Proc, FFI:GDAL::GDAL.ProgressFunc]
170
170
  # @param progress_arg [FFI::Pointer] Usually used when when using a
@@ -177,13 +177,13 @@ module GDAL
177
177
  options_ptr = GDAL::Options.pointer(options)
178
178
 
179
179
  !!FFI::GDAL::Alg.GDALFillNodata(@c_pointer,
180
- mask_band_ptr,
181
- max_search_distance,
182
- 0, # deprecated option in GDAL
183
- smoothing_iterations,
184
- options_ptr,
185
- progress_function,
186
- progress_arg)
180
+ mask_band_ptr,
181
+ max_search_distance,
182
+ 0, # deprecated option in GDAL
183
+ smoothing_iterations,
184
+ options_ptr,
185
+ progress_function,
186
+ progress_arg)
187
187
  end
188
188
 
189
189
  # Creates vector polygons for all connected regions of pixels in the raster
@@ -211,7 +211,7 @@ module GDAL
211
211
  # @param mask_band [GDAL::RasterBand, FFI::Pointer] Optional band, where all
212
212
  # pixels in the mask with a value other than zero will be considered
213
213
  # suitable for collection as polygons.
214
- # @param pixel_value_field [Fixnum] Index of the feature attribute into
214
+ # @param pixel_value_field [Integer] Index of the feature attribute into
215
215
  # which the pixel value of the polygon should be written.
216
216
  # @param use_integer_function [Boolean] Indicates using GDAL's
217
217
  # GDALPolygonize() instead of GDALFPolygonize(); the former uses a
@@ -219,7 +219,7 @@ module GDAL
219
219
  # 32-bit float buffer. The integer based function is faster but less
220
220
  # precise.
221
221
  # @param options [Hash]
222
- # @option options [Fixnum] '8CONNECTED' (4) Set to 8 to use 8
222
+ # @option options [Integer] '8CONNECTED' (4) Set to 8 to use 8
223
223
  # connectedness.
224
224
  # @param progress_function [Proc, FFI:GDAL::GDAL.ProgressFunc]
225
225
  # @param progress_arg [FFI::Pointer] Usually used when when using a
@@ -227,9 +227,10 @@ module GDAL
227
227
  # @return [OGR::Layer]
228
228
  def polygonize(layer, mask_band: nil, pixel_value_field: -1, use_integer_function: false, progress_function: nil,
229
229
  progress_arg: nil, **options)
230
- mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, false)
230
+ mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, warn_on_nil: false)
231
231
  layer_ptr = GDAL._pointer(OGR::Layer, layer)
232
232
  raise OGR::InvalidLayer, "Invalid layer: #{layer.inspect}" if layer_ptr.null?
233
+
233
234
  log "Pixel value field: #{pixel_value_field}"
234
235
 
235
236
  options_ptr = GDAL::Options.pointer(options)
@@ -258,9 +259,9 @@ module GDAL
258
259
  # If +mask_band+ is given, "nodata" pixels in the band will not be treated
259
260
  # as part of a polygon, regardless of their pixel values.
260
261
  #
261
- # @param size_threshold [Fixnum] Polygons found in the raster with sizes
262
+ # @param size_threshold [Integer] Polygons found in the raster with sizes
262
263
  # smaller than this will be merged into their largest neighbor.
263
- # @param connectedness [Fixnum] 4 or 8. 4 indicates that diagonal pixels
264
+ # @param connectedness [Integer] 4 or 8. 4 indicates that diagonal pixels
264
265
  # are not considered directly adjacent for polygon membership purposes;
265
266
  # 8 indicates they are.
266
267
  # @param mask_band [GDAL::RasterBand] [description] All pixels in this
@@ -299,9 +300,9 @@ module GDAL
299
300
 
300
301
  private
301
302
 
302
- # @param size_threshold [Fixnum] Polygons found in the raster with sizes
303
+ # @param size_threshold [Integer] Polygons found in the raster with sizes
303
304
  # smaller than this will be merged into their largest neighbor.
304
- # @param connectedness [Fixnum] 4 or 8. 4 indicates that diagonal pixels
305
+ # @param connectedness [Integer] 4 or 8. 4 indicates that diagonal pixels
305
306
  # are not considered directly adjacent for polygon membership purposes;
306
307
  # 8 indicates they are.
307
308
  # @param mask_band [GDAL::RasterBand] [description] All pixels in this
@@ -313,7 +314,7 @@ module GDAL
313
314
  # @param options [Hash] None supported in GDAL as of this writing.
314
315
  def _sieve_filter(size_threshold, connectedness, destination_band, mask_band: nil, progress_function: nil,
315
316
  progress_arg: nil, **options)
316
- mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, false)
317
+ mask_band_ptr = GDAL._pointer(GDAL::RasterBand, mask_band, warn_on_nil: false)
317
318
  destination_band_ptr = GDAL._pointer(GDAL::RasterBand, destination_band)
318
319
 
319
320
  if destination_band.nil? || destination_band.null?
data/lib/gdal/rpc_info.rb CHANGED
@@ -14,9 +14,10 @@ module GDAL
14
14
 
15
15
  # @param struct_or_ptr [FFI::GDAL::RPCInfo, FFI::Pointer]
16
16
  def initialize(struct_or_ptr = nil)
17
- @c_struct = if struct_or_ptr.is_a? FFI::GDAL::RPCInfo
17
+ @c_struct = case struct_or_ptr
18
+ when FFI::GDAL::RPCInfo
18
19
  struct_or_ptr
19
- elsif struct_or_ptr.is_a? FFI::Pointer
20
+ when FFI::Pointer
20
21
  FFI::GDAL::RPCInfo.new(struct_or_ptr)
21
22
  else
22
23
  FFI::GDAL::RPCInfo.new
@@ -8,6 +8,14 @@ module GDAL
8
8
  FFI::GDAL::Alg::ApproxTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyApproxTransformer(pointer)
16
+ end
17
+
18
+ # @return [FFI::Pointer]
11
19
  attr_reader :c_pointer
12
20
 
13
21
  # @param base_transformer [GDAL::Transformer]
@@ -17,17 +25,18 @@ module GDAL
17
25
  base_transformer_function = base_transformer.function
18
26
  transformer_arg_ptr = base_transformer.c_pointer
19
27
 
20
- @c_pointer = FFI::GDAL::Alg.GDALCreateApproxTransformer(
28
+ pointer = FFI::GDAL::Alg.GDALCreateApproxTransformer(
21
29
  base_transformer_function,
22
30
  transformer_arg_ptr,
23
31
  max_error
24
32
  )
33
+
34
+ @c_pointer = FFI::AutoPointer.new(pointer, ApproximateTransformer.method(:destroy))
25
35
  end
26
36
 
27
37
  def destroy!
28
- return unless @c_pointer
38
+ ApproximateTransformer.destroy(@c_pointer)
29
39
 
30
- FFI::GDAL::Alg.GDALDestroyApproxTransformer(@c_pointer)
31
40
  @c_pointer = nil
32
41
  end
33
42
 
@@ -8,12 +8,19 @@ module GDAL
8
8
  FFI::GDAL::Alg::GenImgProjTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyGenImgProjTransformer(pointer)
16
+ end
17
+
18
+ # @return [FFI::Pointer]
11
19
  attr_reader :c_pointer
12
20
 
13
21
  def destroy!
14
- return unless @c_pointer
22
+ BaseGeneralImageProjectionTransformer.release(@c_pointer)
15
23
 
16
- FFI::GDAL::Alg.GDALDestroyGenImgProjTransformer(@c_pointer)
17
24
  @c_pointer = nil
18
25
  end
19
26
 
@@ -37,6 +44,12 @@ module GDAL
37
44
  @c_pointer, geo_transform_ptr
38
45
  )
39
46
  end
47
+
48
+ private
49
+
50
+ def init_pointer(pointer)
51
+ @c_pointer = FFI::AutoPointer.new(pointer, BaseGeneralImageProjectionTransformer.method(:release))
52
+ end
40
53
  end
41
54
  end
42
55
  end
@@ -8,13 +8,20 @@ module GDAL
8
8
  FFI::GDAL::Alg::GCPTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyGCPTransformer(pointer)
16
+ end
17
+
11
18
  # @return [FFI::Pointer] C pointer to the GCP transformer.
12
19
  attr_reader :c_pointer
13
20
 
14
21
  # @param gcp_list [Array<FFI::GDAL::GCP>]
15
- # @param requested_polynomial_order [Fixnum] 1, 2, or 3.
22
+ # @param requested_polynomial_order [Integer] 1, 2, or 3.
16
23
  # @param reversed [Boolean]
17
- def initialize(gcp_list, requested_polynomial_order, reversed = false, tolerance: nil, minimum_gcps: nil)
24
+ def initialize(gcp_list, requested_polynomial_order, reversed: false, tolerance: nil, minimum_gcps: nil)
18
25
  gcp_list_ptr = FFI::MemoryPointer.new(:pointer, gcp_list.size)
19
26
 
20
27
  # TODO: fasterer: each_with_index is slower than loop
@@ -22,27 +29,28 @@ module GDAL
22
29
  gcp_list_ptr[i].put_pointer(0, gcp.to_ptr)
23
30
  end
24
31
 
25
- @c_pointer = if tolerance || minimum_gcps
26
- FFI::GDAL::Alg.GDALCreateGCPRefineTransformer(
27
- gcp_list.size,
28
- gcp_list_ptr,
29
- requested_polynomial_order,
30
- reversed
31
- )
32
- else
33
- FFI::GDAL::Alg.GDALCreateGCPTransformer(
34
- gcp_list.size,
35
- gcp_list_ptr,
36
- requested_polynomial_order,
37
- reversed
38
- )
39
- end
32
+ pointer = if tolerance || minimum_gcps
33
+ FFI::GDAL::Alg.GDALCreateGCPRefineTransformer(
34
+ gcp_list.size,
35
+ gcp_list_ptr,
36
+ requested_polynomial_order,
37
+ reversed
38
+ )
39
+ else
40
+ FFI::GDAL::Alg.GDALCreateGCPTransformer(
41
+ gcp_list.size,
42
+ gcp_list_ptr,
43
+ requested_polynomial_order,
44
+ reversed
45
+ )
46
+ end
47
+
48
+ @c_pointer = FFI::AutoPointer.new(pointer, GCPTransformer.method(:release))
40
49
  end
41
50
 
42
51
  def destroy!
43
- return unless @c_pointer
52
+ GCPTransformer.release(@c_pointer)
44
53
 
45
- FFI::GDAL::Alg.GDALDestroyGCPTransformer(@c_pointer)
46
54
  @c_pointer = nil
47
55
  end
48
56
 
@@ -10,13 +10,15 @@ module GDAL
10
10
  # @param source_wkt [String]
11
11
  # @param destination_wkt [String]
12
12
  # @param gcp_use_ok [Boolean]
13
- # @param order [Fixnum]
13
+ # @param order [Integer]
14
14
  def initialize(source_dataset, destination_dataset: nil, source_wkt: nil, destination_wkt: nil,
15
15
  gcp_use_ok: false, order: 0)
16
- source_ptr = GDAL._pointer(GDAL::Dataset, source_dataset)
17
- dest_ptr = GDAL._pointer(GDAL::Dataset, destination_dataset, false)
16
+ super()
17
+
18
+ source_ptr = GDAL::Dataset.new_pointer(source_dataset)
19
+ dest_ptr = GDAL::Dataset.new_pointer(destination_dataset, warn_on_nil: false)
18
20
 
19
- @c_pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer(
21
+ pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer(
20
22
  source_ptr,
21
23
  source_wkt,
22
24
  dest_ptr,
@@ -25,9 +27,9 @@ module GDAL
25
27
  0.0,
26
28
  order
27
29
  )
28
- raise if @c_pointer.null?
30
+ raise if pointer.null?
29
31
 
30
- super()
32
+ init_pointer(pointer)
31
33
  end
32
34
  end
33
35
  end
@@ -15,11 +15,11 @@ module GDAL
15
15
  # @option options [String] dst_srs Use to override +destination_dataset+'s WKT
16
16
  # SRS.
17
17
  # @option options [Boolean] gcps_ok (true)
18
- # @option options [Fixnum] refine_minimum_gcps Minimum amount of GCPs that
18
+ # @option options [Integer] refine_minimum_gcps Minimum amount of GCPs that
19
19
  # should be available after the refinement.
20
20
  # @option options [Float] refine_tolerance The tolerance that specifies
21
21
  # when a GCP will be eliminated.
22
- # @option options [Fixnum] max_gcp_order Max order to use for GCP-derived
22
+ # @option options [Integer] max_gcp_order Max order to use for GCP-derived
23
23
  # polynomials, if possible. Default is to auto-select based on the number
24
24
  # of GCPs. A value of -1 triggers use of Thin Plate Spline instead of
25
25
  # polynomials.
@@ -38,17 +38,20 @@ module GDAL
38
38
  # up a CENTER_LONG value on the coordinate system to rewrap things around
39
39
  # the center of the image.
40
40
  def initialize(source_dataset, destination_dataset: nil, **options)
41
- source_ptr = GDAL._pointer(GDAL::Dataset, source_dataset)
42
- destination_ptr = GDAL._pointer(GDAL::Dataset, destination_dataset, false)
41
+ super()
42
+
43
+ source_ptr = GDAL::Dataset.new_pointer(source_dataset)
44
+ destination_ptr = GDAL::Dataset.new_pointer(destination_dataset, warn_on_nil: false)
43
45
  options_ptr = GDAL::Options.pointer(options)
44
46
 
45
- @c_pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer2(
47
+ pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer2(
46
48
  source_ptr,
47
49
  destination_ptr,
48
50
  options_ptr
49
51
  )
52
+ raise if pointer.null?
50
53
 
51
- super()
54
+ init_pointer(pointer)
52
55
  end
53
56
  end
54
57
  end
@@ -11,17 +11,21 @@ module GDAL
11
11
  # @param destination_geo_transform [GDAL::GeoTransform, FFI::Pointer]
12
12
  # @return [FFI::Pointer]
13
13
  def initialize(source_wkt, source_geo_transform, destination_wkt, destination_geo_transform)
14
+ super()
15
+
14
16
  source_ptr = GDAL._pointer(GDAL::GeoTransform, source_geo_transform)
15
17
  destination_ptr = GDAL._pointer(GDAL::GeoTransform, destination_geo_transform)
16
18
 
17
- @c_pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer3(
19
+ pointer = FFI::GDAL::Alg.GDALCreateGenImgProjTransformer3(
18
20
  source_wkt,
19
21
  source_ptr,
20
22
  destination_wkt,
21
23
  destination_ptr
22
24
  )
23
25
 
24
- super()
26
+ raise if pointer.null?
27
+
28
+ init_pointer(pointer)
25
29
  end
26
30
  end
27
31
  end
@@ -8,27 +8,35 @@ module GDAL
8
8
  FFI::GDAL::Alg::GeoLocTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyGeoLocTransformer(pointer)
16
+ end
17
+
11
18
  # @return [FFI::Pointer] C pointer to the C geolocation transformer.
12
19
  attr_reader :c_pointer
13
20
 
14
21
  # @param base_dataset [GDAL::Dataset]
15
22
  # @param geolocation_info [Array<String>]
16
23
  # @param reversed [Boolean]
17
- def intialize(base_dataset, geolocation_info, reversed = false)
24
+ def intialize(base_dataset, geolocation_info, reversed: false)
18
25
  base_dataset_ptr = GDAL._pointer(GDAL::Dataset, base_dataset)
19
26
  geolocation_info_ptr = GDAL._string_array_to_pointer(geolocation_info)
20
27
 
21
- @c_pointer = FFI::GDAL::Alg.CreateGeoLocTransformer(
28
+ pointer = FFI::GDAL::Alg.CreateGeoLocTransformer(
22
29
  base_dataset_ptr,
23
30
  geolocation_info_ptr,
24
31
  reversed
25
32
  )
33
+
34
+ @c_pointer = FFI::AutoPointer.new(pointer, GeolocationTransformer.method(:release))
26
35
  end
27
36
 
28
37
  def destroy!
29
- return unless @c_pointer
38
+ GeolocationTransformer.release(@c_pointer)
30
39
 
31
- FFI::GDAL::Alg.GDALDestroyGeoLocTransformer(@c_pointer)
32
40
  @c_pointer = nil
33
41
  end
34
42
 
@@ -8,19 +8,27 @@ module GDAL
8
8
  FFI::GDAL::Alg::ReprojectionTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyReprojectionTransformer(pointer)
16
+ end
17
+
11
18
  # @return [FFI::Pointer] C pointer to the C reprojection transformer.
12
19
  attr_reader :c_pointer
13
20
 
14
21
  # @param source_wkt [String]
15
22
  # @param destination_wkt [String]
16
23
  def initialize(source_wkt, destination_wkt)
17
- @c_pointer = FFI::GDAL::Alg.GDALCreateReprojectionTransformer(source_wkt, destination_wkt)
24
+ pointer = FFI::GDAL::Alg.GDALCreateReprojectionTransformer(source_wkt, destination_wkt)
25
+
26
+ @c_pointer = FFI::AutoPointer.new(pointer, ReprojectionTransformer.method(:release))
18
27
  end
19
28
 
20
29
  def destroy!
21
- return unless @c_pointer
30
+ ReprojectionTransformer.release(@c_pointer)
22
31
 
23
- FFI::GDAL::Alg.GDALDestroyReprojectionTransformer(@c_pointer)
24
32
  @c_pointer = nil
25
33
  end
26
34
 
@@ -8,6 +8,13 @@ module GDAL
8
8
  FFI::GDAL::Alg::RPCTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyRPCTransformer(pointer)
16
+ end
17
+
11
18
  # @return [FFI::Pointer] C pointer to the C RPC transformer.
12
19
  attr_reader :c_pointer
13
20
 
@@ -28,15 +35,17 @@ module GDAL
28
35
  # @option options [Number] rpc_dem_missing_value Value of DEM height that
29
36
  # must be unsed in case the DEM has a nodata value at the sampling point,
30
37
  # or if its extent doesn't cover the requested coordinate.
31
- def initialize(rpc_info, pixel_error_threshold, reversed = false, **options)
38
+ def initialize(rpc_info, pixel_error_threshold, reversed: false, **options)
32
39
  options_ptr = GDAL::Options.pointer(options)
33
40
 
34
- @c_pointer = FFI::GDAL::Alg.GDALCreateRPCTransformer(
41
+ pointer = FFI::GDAL::Alg.GDALCreateRPCTransformer(
35
42
  rpc_info,
36
43
  reversed,
37
44
  pixel_error_threshold,
38
45
  options_ptr
39
46
  )
47
+
48
+ @c_pointer = FFI::AutoPointer.new(pointer, RPCTransformer.method(:release))
40
49
  end
41
50
 
42
51
  def destroy!
@@ -8,12 +8,19 @@ module GDAL
8
8
  FFI::GDAL::Alg::TPSTransform
9
9
  end
10
10
 
11
+ # @param pointer [FFI::Pointer]
12
+ def self.release(pointer)
13
+ return unless pointer && !pointer.null?
14
+
15
+ FFI::GDAL::Alg.GDALDestroyTPSTransformer(pointer)
16
+ end
17
+
11
18
  # @return [FFI::Pointer] C pointer to the C TPS transformer.
12
19
  attr_reader :c_pointer
13
20
 
14
21
  # @param gcp_list [Array<FFI::GDAL::GCP>]
15
22
  # @param reversed [Boolean]
16
- def initialize(gcp_list, reversed = false)
23
+ def initialize(gcp_list, reversed: false)
17
24
  gcp_list_ptr = FFI::MemoryPointer.new(:pointer, gcp_list.size)
18
25
 
19
26
  # TODO: fasterer: each_with_index is slower than loop
@@ -21,13 +28,14 @@ module GDAL
21
28
  gcp_list_ptr[i].put_pointer(0, gcp.to_ptr)
22
29
  end
23
30
 
24
- @c_pointer = FFI::GDAL::Alg.GDALCreateTPSTransformer(gcp_list.size, gcp_list_ptr, reversed)
31
+ pointer = FFI::GDAL::Alg.GDALCreateTPSTransformer(gcp_list.size, gcp_list_ptr, reversed)
32
+
33
+ @c_pointer = FFI::AutoPointer.new(pointer, TPSTransformer.method(:release))
25
34
  end
26
35
 
27
36
  def destroy!
28
- return unless @c_pointer
37
+ TPSTransformer.release(@c_pointer)
29
38
 
30
- FFI::GDAL::Alg.GDALDestroyTPSTransformer(@c_pointer)
31
39
  @c_pointer = nil
32
40
  end
33
41
 
@@ -46,8 +46,8 @@ module GDAL
46
46
  FFI::GDAL.GDALVersionInfo('--version')
47
47
  end
48
48
 
49
- # @param major [Fixnum]
50
- # @param minor [Fixnum]
49
+ # @param major [Integer]
50
+ # @param minor [Integer]
51
51
  # @return [Boolean] +true+ if the runtime GDAL library matches the given
52
52
  # version params.
53
53
  def check_version(major, minor)
@@ -41,6 +41,7 @@ module GDAL
41
41
  FFI::GDAL::VRT.VRTAddSource(vrt_band, new_source)
42
42
  end
43
43
 
44
+ # rubocop:disable Metrics/ParameterLists
44
45
  # @return [Boolean]
45
46
  def add_simple_source(vrt_band, source_band, no_data_value,
46
47
  src_x_offset: 0, src_y_offset: 0, src_x_size: nil, src_y_size: nil,
@@ -83,6 +84,7 @@ module GDAL
83
84
  no_data_value # dfNoDataValue
84
85
  )
85
86
  end
87
+ # rubocop:enable Metrics/ParameterLists
86
88
 
87
89
  # @param vrt_band [FFI::Pointer]
88
90
  # @param read_function [Proc]