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
data/lib/ffi/gdal/gdal.rb CHANGED
@@ -14,82 +14,82 @@ module FFI
14
14
  # Enums
15
15
  # ----------------------------------------------------------------
16
16
  DataType = enum :GDT_Unknown, 0,
17
- :GDT_Byte, 1,
18
- :GDT_UInt16, 2,
19
- :GDT_Int16, 3,
20
- :GDT_UInt32, 4,
21
- :GDT_Int32, 5,
22
- :GDT_Float32, 6,
23
- :GDT_Float64, 7,
24
- :GDT_CInt16, 8,
25
- :GDT_CInt32, 9,
26
- :GDT_CFloat32, 10,
27
- :GDT_CFloat64, 11,
28
- :GDT_TypeCount, 12
17
+ :GDT_Byte, 1,
18
+ :GDT_UInt16, 2,
19
+ :GDT_Int16, 3,
20
+ :GDT_UInt32, 4,
21
+ :GDT_Int32, 5,
22
+ :GDT_Float32, 6,
23
+ :GDT_Float64, 7,
24
+ :GDT_CInt16, 8,
25
+ :GDT_CInt32, 9,
26
+ :GDT_CFloat32, 10,
27
+ :GDT_CFloat64, 11,
28
+ :GDT_TypeCount, 12
29
29
 
30
30
  AsyncStatusType = enum :GARIO_PENDING, 0,
31
- :GARIO_UPDATE, 1,
32
- :GARIO_ERROR, 2,
33
- :GARIO_COMPLETE, 3,
34
- :GARIO_TypeCount, 4
31
+ :GARIO_UPDATE, 1,
32
+ :GARIO_ERROR, 2,
33
+ :GARIO_COMPLETE, 3,
34
+ :GARIO_TypeCount, 4
35
35
 
36
36
  Access = enum :GA_ReadOnly, 0,
37
- :GA_Update, 1
37
+ :GA_Update, 1
38
38
 
39
39
  RWFlag = enum :GF_Read, 0,
40
- :GF_Write, 1
40
+ :GF_Write, 1
41
41
 
42
42
  ColorInterp = enum :GCI_Undefined, 0,
43
- :GCI_GrayIndex, 1,
44
- :GCI_PaletteIndex, 2,
45
- :GCI_RedBand, 3,
46
- :GCI_GreenBand, 4,
47
- :GCI_BlueBand, 5,
48
- :GCI_AlphaBand, 6,
49
- :GCI_HueBand, 7,
50
- :GCI_SaturationBand, 8,
51
- :GCI_LightnessBand, 9,
52
- :GCI_CyanBand, 10,
53
- :GCI_MagentaBand, 11,
54
- :GCI_YellowBand, 12,
55
- :GCI_BlackBand, 13,
56
- :GCI_YCbCr_YBand, 14,
57
- :GCI_YCbCr_CbBand, 15,
58
- :GCI_YCbCr_CrBand, 16,
59
- :GCI_Max, 16 # Seems wrong that this is also 16...
43
+ :GCI_GrayIndex, 1,
44
+ :GCI_PaletteIndex, 2,
45
+ :GCI_RedBand, 3,
46
+ :GCI_GreenBand, 4,
47
+ :GCI_BlueBand, 5,
48
+ :GCI_AlphaBand, 6,
49
+ :GCI_HueBand, 7,
50
+ :GCI_SaturationBand, 8,
51
+ :GCI_LightnessBand, 9,
52
+ :GCI_CyanBand, 10,
53
+ :GCI_MagentaBand, 11,
54
+ :GCI_YellowBand, 12,
55
+ :GCI_BlackBand, 13,
56
+ :GCI_YCbCr_YBand, 14,
57
+ :GCI_YCbCr_CbBand, 15,
58
+ :GCI_YCbCr_CrBand, 16,
59
+ :GCI_Max, 16 # Seems wrong that this is also 16...
60
60
 
61
61
  PaletteInterp = enum :GPI_Gray, 0,
62
- :GPI_RGB, 1,
63
- :GPI_CMYK, 2,
64
- :GPI_HLS, 3
62
+ :GPI_RGB, 1,
63
+ :GPI_CMYK, 2,
64
+ :GPI_HLS, 3
65
65
 
66
66
  RATFieldType = enum :GFT_Integer,
67
- :GFT_Real,
68
- :GFT_String
67
+ :GFT_Real,
68
+ :GFT_String
69
69
 
70
70
  RATFieldUsage = enum :GFU_Generic, 0,
71
- :GFU_PixelCount, 1,
72
- :GFU_Name, 2,
73
- :GFU_Min, 3,
74
- :GFU_Max, 4,
75
- :GFU_MinMax, 5,
76
- :GFU_Red, 6,
77
- :GFU_Green, 7,
78
- :GFU_Blue, 8,
79
- :GFU_Alpha, 9,
80
- :GFU_RedMin, 10,
81
- :GFU_GreenMin, 11,
82
- :GFU_BlueMin, 12,
83
- :GFU_AlphaMin, 13,
84
- :GFU_RedMax, 14,
85
- :GFU_GreenMax, 15,
86
- :GFU_BlueMax, 16,
87
- :GFU_AlphaMax, 17,
88
- :GFU_MaxCount
71
+ :GFU_PixelCount, 1,
72
+ :GFU_Name, 2,
73
+ :GFU_Min, 3,
74
+ :GFU_Max, 4,
75
+ :GFU_MinMax, 5,
76
+ :GFU_Red, 6,
77
+ :GFU_Green, 7,
78
+ :GFU_Blue, 8,
79
+ :GFU_Alpha, 9,
80
+ :GFU_RedMin, 10,
81
+ :GFU_GreenMin, 11,
82
+ :GFU_BlueMin, 12,
83
+ :GFU_AlphaMin, 13,
84
+ :GFU_RedMax, 14,
85
+ :GFU_GreenMax, 15,
86
+ :GFU_BlueMax, 16,
87
+ :GFU_AlphaMax, 17,
88
+ :GFU_MaxCount
89
89
 
90
90
  TileOrganization = enum :GTO_TIP,
91
- :GTO_BIT,
92
- :GTO_BSQ
91
+ :GTO_BIT,
92
+ :GTO_BSQ
93
93
 
94
94
  # ----------------------------------------------------------------
95
95
  # typedefs
@@ -103,14 +103,14 @@ module FFI
103
103
  typedef :pointer, :GDALAsyncReaderH
104
104
 
105
105
  # When using, make sure to return +true+ if the operation should continue;
106
- # +false+ if the user has cancelled.
106
+ # +false+ if the user has canceled.
107
107
  callback :GDALProgressFunc,
108
- %i[double string pointer], # completion, message, progress_arg
109
- :bool
108
+ %i[double string pointer], # completion, message, progress_arg
109
+ :bool
110
110
 
111
111
  callback :GDALDerivedPixelFunc,
112
- [:pointer, :int, :pointer, :int, :int, DataType, DataType, :int, :int],
113
- :int
112
+ [:pointer, :int, :pointer, :int, :int, DataType, DataType, :int, :int],
113
+ :int
114
114
 
115
115
  # ----------------------------------------------------------------
116
116
  # functions
@@ -122,7 +122,7 @@ module FFI
122
122
  # ~~~~~~~~~~~~~~~~~~~
123
123
  # ColorInterpretation
124
124
  # ~~~~~~~~~~~~~~~~~~~
125
- attach_function :GDALGetColorInterpretationName, [ColorInterp], :string
125
+ attach_function :GDALGetColorInterpretationName, [ColorInterp], :strptr
126
126
  attach_function :GDALGetColorInterpretationByName, [:string], ColorInterp
127
127
 
128
128
  # ~~~~~~~~~~~~~~~~~~~
@@ -139,27 +139,27 @@ module FFI
139
139
 
140
140
  # Instance-level functions
141
141
  attach_function :GDALCreate,
142
- [:GDALDriverH, :string, :int, :int, :int, DataType, :pointer],
143
- :GDALDatasetH
142
+ [:GDALDriverH, :string, :int, :int, :int, DataType, :pointer],
143
+ :GDALDatasetH
144
144
  attach_function :GDALCreateCopy,
145
- %i[GDALDriverH string GDALDatasetH bool pointer GDALProgressFunc pointer],
146
- :GDALDatasetH
145
+ %i[GDALDriverH string GDALDatasetH bool pointer GDALProgressFunc pointer],
146
+ :GDALDatasetH
147
147
  attach_function :GDALValidateCreationOptions, %i[GDALDriverH pointer], :bool
148
- attach_function :GDALGetDriverShortName, [:GDALDriverH], :string
149
- attach_function :GDALGetDriverLongName, [:GDALDriverH], :string
150
- attach_function :GDALGetDriverHelpTopic, [:GDALDriverH], :string
151
- attach_function :GDALGetDriverCreationOptionList, [:GDALDriverH], :string
148
+ attach_function :GDALGetDriverShortName, [:GDALDriverH], :strptr
149
+ attach_function :GDALGetDriverLongName, [:GDALDriverH], :strptr
150
+ attach_function :GDALGetDriverHelpTopic, [:GDALDriverH], :strptr
151
+ attach_function :GDALGetDriverCreationOptionList, [:GDALDriverH], :strptr
152
152
 
153
153
  attach_function :GDALDestroyDriver, [:GDALDriverH], :void
154
154
  attach_function :GDALRegisterDriver, [:GDALDriverH], :int
155
155
  attach_function :GDALDeregisterDriver, [:GDALDriverH], :void
156
156
  attach_function :GDALDeleteDataset, %i[GDALDriverH string], FFI::CPL::Error::CPLErr
157
157
  attach_function :GDALRenameDataset,
158
- %i[GDALDriverH string string],
159
- FFI::CPL::Error::CPLErr
158
+ %i[GDALDriverH string string],
159
+ FFI::CPL::Error::CPLErr
160
160
  attach_function :GDALCopyDatasetFiles,
161
- %i[GDALDriverH string string],
162
- FFI::CPL::Error::CPLErr
161
+ %i[GDALDriverH string string],
162
+ FFI::CPL::Error::CPLErr
163
163
 
164
164
  # ~~~~~~~~~~~~~~~~~~~
165
165
  # Dataset
@@ -167,8 +167,8 @@ module FFI
167
167
  # Class-level functions
168
168
  attach_function :GDALOpen, [:string, Access], :GDALDatasetH
169
169
  attach_function :GDALOpenShared,
170
- [:string, Access],
171
- :GDALDatasetH
170
+ [:string, Access],
171
+ :GDALDatasetH
172
172
  attach_function :GDALDumpOpenDatasets, [:pointer], :int
173
173
  attach_function :GDALGetOpenDatasets, %i[pointer pointer], :void
174
174
 
@@ -188,96 +188,96 @@ module FFI
188
188
  attach_function :GDALGetRasterCount, [:GDALDatasetH], :int
189
189
  attach_function :GDALGetRasterBand, %i[GDALDatasetH int], :GDALRasterBandH
190
190
  attach_function :GDALAddBand,
191
- [:GDALDatasetH, DataType, :pointer],
192
- FFI::CPL::Error::CPLErr
191
+ [:GDALDatasetH, DataType, :pointer],
192
+ FFI::CPL::Error::CPLErr
193
193
  attach_function :GDALBeginAsyncReader,
194
- [
195
- :GDALDatasetH,
196
- RWFlag,
197
- :int,
198
- :int,
199
- :int,
200
- :int,
201
- :pointer,
202
- :int,
203
- :int,
204
- DataType,
205
- :int,
206
- :pointer,
207
- :int,
208
- :int,
209
- :int
210
- ], :GDALAsyncReaderH
194
+ [
195
+ :GDALDatasetH,
196
+ RWFlag,
197
+ :int,
198
+ :int,
199
+ :int,
200
+ :int,
201
+ :pointer,
202
+ :int,
203
+ :int,
204
+ DataType,
205
+ :int,
206
+ :pointer,
207
+ :int,
208
+ :int,
209
+ :int
210
+ ], :GDALAsyncReaderH
211
211
 
212
212
  attach_function :GDALEndAsyncReader,
213
- %i[GDALDatasetH GDALAsyncReaderH],
214
- :void
213
+ %i[GDALDatasetH GDALAsyncReaderH],
214
+ :void
215
215
 
216
216
  attach_function :GDALDatasetRasterIO,
217
- [
218
- :GDALDatasetH,
219
- RWFlag,
220
- :int,
221
- :int,
222
- :int,
223
- :int,
224
- :pointer,
225
- :int,
226
- :int,
227
- DataType,
228
- :int,
229
- :pointer,
230
- :int,
231
- :int,
232
- :int
233
- ], FFI::CPL::Error::CPLErr
217
+ [
218
+ :GDALDatasetH,
219
+ RWFlag,
220
+ :int,
221
+ :int,
222
+ :int,
223
+ :int,
224
+ :pointer,
225
+ :int,
226
+ :int,
227
+ DataType,
228
+ :int,
229
+ :pointer,
230
+ :int,
231
+ :int,
232
+ :int
233
+ ], FFI::CPL::Error::CPLErr
234
234
 
235
235
  attach_function :GDALDatasetAdviseRead,
236
- [
237
- :GDALDatasetH,
238
- :int,
239
- :int,
240
- :int,
241
- :int,
242
- :int,
243
- :int,
244
- DataType,
245
- :int,
246
- :pointer,
247
- :pointer
248
- ], FFI::CPL::Error::CPLErr
236
+ [
237
+ :GDALDatasetH,
238
+ :int,
239
+ :int,
240
+ :int,
241
+ :int,
242
+ :int,
243
+ :int,
244
+ DataType,
245
+ :int,
246
+ :pointer,
247
+ :pointer
248
+ ], FFI::CPL::Error::CPLErr
249
249
 
250
250
  attach_function :GDALInitGCPs, %i[int pointer], :void
251
251
  attach_function :GDALDeinitGCPs, %i[int pointer], :void
252
252
  attach_function :GDALDuplicateGCPs, %i[int pointer], :pointer
253
253
  attach_function :GDALGCPsToGeoTransform,
254
- %i[int pointer pointer int],
255
- :int
254
+ %i[int pointer pointer int],
255
+ :int
256
256
  attach_function :GDALGetGCPCount, [:GDALDatasetH], :int
257
- attach_function :GDALGetGCPProjection, [:GDALDatasetH], :string
257
+ attach_function :GDALGetGCPProjection, [:GDALDatasetH], :strptr
258
258
  attach_function :GDALGetGCPs, [:GDALDatasetH], :pointer
259
259
  attach_function :GDALSetGCPs,
260
- %i[GDALDatasetH int pointer string],
261
- FFI::CPL::Error::CPLErr
260
+ %i[GDALDatasetH int pointer string],
261
+ FFI::CPL::Error::CPLErr
262
262
 
263
- attach_function :GDALGetProjectionRef, [:GDALDatasetH], :string
263
+ attach_function :GDALGetProjectionRef, [:GDALDatasetH], :strptr
264
264
  attach_function :GDALSetProjection, %i[GDALDatasetH string], FFI::CPL::Error::CPLErr
265
265
  attach_function :GDALGetGeoTransform, %i[GDALDatasetH pointer], FFI::CPL::Error::CPLErr
266
266
  attach_function :GDALSetGeoTransform,
267
- %i[GDALDatasetH pointer],
268
- FFI::CPL::Error::CPLErr
267
+ %i[GDALDatasetH pointer],
268
+ FFI::CPL::Error::CPLErr
269
269
 
270
270
  attach_function :GDALBuildOverviews,
271
- %i[
272
- GDALDatasetH
273
- string
274
- int
275
- pointer
276
- int
277
- pointer
278
- GDALProgressFunc
279
- pointer
280
- ], FFI::CPL::Error::CPLErr
271
+ %i[
272
+ GDALDatasetH
273
+ string
274
+ int
275
+ pointer
276
+ int
277
+ pointer
278
+ GDALProgressFunc
279
+ pointer
280
+ ], FFI::CPL::Error::CPLErr
281
281
 
282
282
  # OGR datasets. Not found in v1.11.1
283
283
  # attach_function :GDALDatasetGetLayerCount, [:GDALDatasetH], :int
@@ -313,8 +313,8 @@ module FFI
313
313
 
314
314
  attach_function :GDALCreateDatasetMaskBand, %i[GDALDatasetH int], FFI::CPL::Error::CPLErr
315
315
  attach_function :GDALDatasetCopyWholeRaster,
316
- %i[GDALDatasetH GDALDatasetH pointer GDALProgressFunc pointer],
317
- FFI::CPL::Error::CPLErr
316
+ %i[GDALDatasetH GDALDatasetH pointer GDALProgressFunc pointer],
317
+ FFI::CPL::Error::CPLErr
318
318
 
319
319
  # ~~~~~~~~~~~~~~~~~~~
320
320
  # MajorObject
@@ -323,12 +323,12 @@ module FFI
323
323
  attach_function :GDALGetMetadata, %i[GDALMajorObjectH string], :pointer
324
324
  attach_function :GDALSetMetadata, %i[GDALMajorObjectH pointer string], FFI::CPL::Error::CPLErr
325
325
  attach_function :GDALGetMetadataItem,
326
- %i[GDALMajorObjectH string string],
327
- :string
326
+ %i[GDALMajorObjectH string string],
327
+ :strptr
328
328
  attach_function :GDALSetMetadataItem,
329
- %i[GDALMajorObjectH string string string],
330
- FFI::CPL::Error::CPLErr
331
- attach_function :GDALGetDescription, [:GDALMajorObjectH], :string
329
+ %i[GDALMajorObjectH string string string],
330
+ FFI::CPL::Error::CPLErr
331
+ attach_function :GDALGetDescription, [:GDALMajorObjectH], :strptr
332
332
  attach_function :GDALSetDescription, %i[GDALMajorObjectH string], :void
333
333
 
334
334
  # ~~~~~~~~~~~~~~~~~~~
@@ -336,288 +336,288 @@ module FFI
336
336
  # ~~~~~~~~~~~~~~~~~~~
337
337
  attach_function :GDALInvGeoTransform, %i[pointer pointer], :int
338
338
  attach_function :GDALApplyGeoTransform,
339
- %i[pointer double double pointer pointer],
340
- :void
339
+ %i[pointer double double pointer pointer],
340
+ :void
341
341
  attach_function :GDALComposeGeoTransforms,
342
- %i[pointer pointer pointer],
343
- :void
342
+ %i[pointer pointer pointer],
343
+ :void
344
344
 
345
345
  # ----------------
346
346
  # Raster functions
347
347
  # ----------------
348
348
  attach_function :GDALRasterBandCopyWholeRaster,
349
- %i[
350
- GDALRasterBandH
351
- GDALRasterBandH
352
- pointer
353
- GDALProgressFunc
354
- pointer
355
- ], FFI::CPL::Error::CPLErr
349
+ %i[
350
+ GDALRasterBandH
351
+ GDALRasterBandH
352
+ pointer
353
+ GDALProgressFunc
354
+ pointer
355
+ ], FFI::CPL::Error::CPLErr
356
356
  attach_function :GDALRegenerateOverviews,
357
- %i[
358
- GDALRasterBandH
359
- int
360
- pointer
361
- string
362
- GDALProgressFunc
363
- pointer
364
- ], FFI::CPL::Error::CPLErr
357
+ %i[
358
+ GDALRasterBandH
359
+ int
360
+ pointer
361
+ string
362
+ GDALProgressFunc
363
+ pointer
364
+ ], FFI::CPL::Error::CPLErr
365
365
  attach_function :GDALGetMaskBand, [:GDALRasterBandH], :GDALRasterBandH
366
366
  attach_function :GDALGetMaskFlags, [:GDALRasterBandH], :int
367
367
  attach_function :GDALCreateMaskBand,
368
- %i[GDALRasterBandH int],
369
- FFI::CPL::Error::CPLErr
368
+ %i[GDALRasterBandH int],
369
+ FFI::CPL::Error::CPLErr
370
370
 
371
371
  attach_function :GDALGetRasterDataType, [:GDALRasterBandH], DataType
372
372
  attach_function :GDALGetBlockSize,
373
- %i[GDALRasterBandH pointer pointer],
374
- DataType
373
+ %i[GDALRasterBandH pointer pointer],
374
+ DataType
375
375
 
376
376
  attach_function :GDALRasterAdviseRead,
377
- [
378
- :GDALRasterBandH,
379
- :int,
380
- :int,
381
- :int,
382
- :int,
383
- :int,
384
- :int,
385
- DataType,
386
- :pointer
387
- ], FFI::CPL::Error::CPLErr
377
+ [
378
+ :GDALRasterBandH,
379
+ :int,
380
+ :int,
381
+ :int,
382
+ :int,
383
+ :int,
384
+ :int,
385
+ DataType,
386
+ :pointer
387
+ ], FFI::CPL::Error::CPLErr
388
388
 
389
389
  attach_function :GDALRasterIO,
390
- [
391
- :GDALRasterBandH,
392
- RWFlag,
393
- :int,
394
- :int,
395
- :int,
396
- :int,
397
- :pointer,
398
- :int,
399
- :int,
400
- DataType,
401
- :int,
402
- :int
403
- ], FFI::CPL::Error::CPLErr
390
+ [
391
+ :GDALRasterBandH,
392
+ RWFlag,
393
+ :int,
394
+ :int,
395
+ :int,
396
+ :int,
397
+ :pointer,
398
+ :int,
399
+ :int,
400
+ DataType,
401
+ :int,
402
+ :int
403
+ ], FFI::CPL::Error::CPLErr
404
404
  attach_function :GDALReadBlock,
405
- %i[GDALRasterBandH int int pointer],
406
- FFI::CPL::Error::CPLErr
405
+ %i[GDALRasterBandH int int pointer],
406
+ FFI::CPL::Error::CPLErr
407
407
  attach_function :GDALWriteBlock,
408
- %i[GDALRasterBandH int int pointer],
409
- FFI::CPL::Error::CPLErr
408
+ %i[GDALRasterBandH int int pointer],
409
+ FFI::CPL::Error::CPLErr
410
410
  attach_function :GDALGetRasterBandXSize, [:GDALRasterBandH], :int
411
411
  attach_function :GDALGetRasterBandYSize, [:GDALRasterBandH], :int
412
412
  attach_function :GDALGetRasterAccess, [:GDALRasterBandH], Access
413
413
  attach_function :GDALGetBandNumber, [:GDALRasterBandH], :int
414
414
  attach_function :GDALGetBandDataset, [:GDALRasterBandH], :GDALDatasetH
415
415
  attach_function :GDALGetRasterColorInterpretation,
416
- [:GDALRasterBandH],
417
- ColorInterp
416
+ [:GDALRasterBandH],
417
+ ColorInterp
418
418
  attach_function :GDALSetRasterColorInterpretation,
419
- [:GDALRasterBandH, ColorInterp],
420
- FFI::CPL::Error::CPLErr
419
+ [:GDALRasterBandH, ColorInterp],
420
+ FFI::CPL::Error::CPLErr
421
421
  attach_function :GDALGetRasterColorTable,
422
- [:GDALRasterBandH],
423
- :GDALColorTableH
422
+ [:GDALRasterBandH],
423
+ :GDALColorTableH
424
424
  attach_function :GDALSetRasterColorTable,
425
- %i[GDALRasterBandH GDALColorTableH],
426
- FFI::CPL::Error::CPLErr
425
+ %i[GDALRasterBandH GDALColorTableH],
426
+ FFI::CPL::Error::CPLErr
427
427
 
428
428
  attach_function :GDALHasArbitraryOverviews, [:GDALRasterBandH], :int
429
429
  attach_function :GDALGetOverviewCount, [:GDALRasterBandH], :int
430
430
  attach_function :GDALGetOverview, %i[GDALRasterBandH int], :GDALRasterBandH
431
431
  attach_function :GDALGetRasterNoDataValue,
432
- %i[GDALRasterBandH pointer],
433
- :double
432
+ %i[GDALRasterBandH pointer],
433
+ :double
434
434
  attach_function :GDALSetRasterNoDataValue,
435
- %i[GDALRasterBandH double],
436
- FFI::CPL::Error::CPLErr
435
+ %i[GDALRasterBandH double],
436
+ FFI::CPL::Error::CPLErr
437
437
  attach_function :GDALGetRasterCategoryNames,
438
- [:GDALRasterBandH],
439
- :pointer
438
+ [:GDALRasterBandH],
439
+ :pointer
440
440
  attach_function :GDALSetRasterCategoryNames,
441
- %i[GDALRasterBandH pointer],
442
- FFI::CPL::Error::CPLErr
441
+ %i[GDALRasterBandH pointer],
442
+ FFI::CPL::Error::CPLErr
443
443
  attach_function :GDALGetRasterMinimum,
444
- %i[GDALRasterBandH pointer],
445
- :double
444
+ %i[GDALRasterBandH pointer],
445
+ :double
446
446
  attach_function :GDALGetRasterMaximum,
447
- %i[GDALRasterBandH pointer],
448
- :double
447
+ %i[GDALRasterBandH pointer],
448
+ :double
449
449
  attach_function :GDALGetRasterStatistics,
450
- %i[GDALRasterBandH bool bool pointer pointer pointer pointer],
451
- FFI::CPL::Error::CPLErr
450
+ %i[GDALRasterBandH bool bool pointer pointer pointer pointer],
451
+ FFI::CPL::Error::CPLErr
452
452
  attach_function :GDALComputeRasterStatistics,
453
- %i[
454
- GDALRasterBandH
455
- bool
456
- pointer
457
- pointer
458
- pointer
459
- pointer
460
- GDALProgressFunc
461
- pointer
462
- ], FFI::CPL::Error::CPLErr
453
+ %i[
454
+ GDALRasterBandH
455
+ bool
456
+ pointer
457
+ pointer
458
+ pointer
459
+ pointer
460
+ GDALProgressFunc
461
+ pointer
462
+ ], FFI::CPL::Error::CPLErr
463
463
  attach_function :GDALSetRasterStatistics,
464
- %i[GDALRasterBandH double double double double],
465
- FFI::CPL::Error::CPLErr
466
- attach_function :GDALGetRasterUnitType, [:GDALRasterBandH], :string
464
+ %i[GDALRasterBandH double double double double],
465
+ FFI::CPL::Error::CPLErr
466
+ attach_function :GDALGetRasterUnitType, [:GDALRasterBandH], :strptr
467
467
  attach_function :GDALSetRasterUnitType, %i[GDALRasterBandH string], FFI::CPL::Error::CPLErr
468
468
  attach_function :GDALGetRasterOffset, %i[GDALRasterBandH pointer], :double
469
469
  attach_function :GDALSetRasterOffset, %i[GDALRasterBandH double], FFI::CPL::Error::CPLErr
470
470
  attach_function :GDALGetRasterScale, %i[GDALRasterBandH pointer], :double
471
471
  attach_function :GDALSetRasterScale, %i[GDALRasterBandH double], FFI::CPL::Error::CPLErr
472
472
  attach_function :GDALComputeRasterMinMax,
473
- %i[GDALRasterBandH bool pointer],
474
- :void
473
+ %i[GDALRasterBandH bool pointer],
474
+ :void
475
475
  attach_function :GDALFlushRasterCache, [:GDALRasterBandH], FFI::CPL::Error::CPLErr
476
476
  attach_function :GDALGetRasterHistogram,
477
- %i[
478
- GDALRasterBandH
479
- double
480
- double
481
- int
482
- pointer
483
- bool
484
- bool
485
- GDALProgressFunc
486
- pointer
487
- ], FFI::CPL::Error::CPLErr
477
+ %i[
478
+ GDALRasterBandH
479
+ double
480
+ double
481
+ int
482
+ pointer
483
+ bool
484
+ bool
485
+ GDALProgressFunc
486
+ pointer
487
+ ], FFI::CPL::Error::CPLErr
488
488
 
489
489
  attach_function :GDALGetDefaultHistogram,
490
- %i[
491
- GDALRasterBandH
492
- pointer
493
- pointer
494
- pointer
495
- pointer
496
- bool
497
- GDALProgressFunc
498
- pointer
499
- ], FFI::CPL::Error::CPLErr
490
+ %i[
491
+ GDALRasterBandH
492
+ pointer
493
+ pointer
494
+ pointer
495
+ pointer
496
+ bool
497
+ GDALProgressFunc
498
+ pointer
499
+ ], FFI::CPL::Error::CPLErr
500
500
  attach_function :GDALSetDefaultHistogram,
501
- %i[
502
- GDALRasterBandH
503
- double
504
- double
505
- int
506
- pointer
507
- ], FFI::CPL::Error::CPLErr
501
+ %i[
502
+ GDALRasterBandH
503
+ double
504
+ double
505
+ int
506
+ pointer
507
+ ], FFI::CPL::Error::CPLErr
508
508
 
509
509
  attach_function :GDALGetRandomRasterSample,
510
- %i[GDALRasterBandH int pointer],
511
- :int
510
+ %i[GDALRasterBandH int pointer],
511
+ :int
512
512
  attach_function :GDALGetRasterSampleOverview,
513
- %i[GDALRasterBandH int],
514
- :GDALRasterBandH
513
+ %i[GDALRasterBandH int],
514
+ :GDALRasterBandH
515
515
  attach_function :GDALFillRaster,
516
- %i[GDALRasterBandH double double],
517
- FFI::CPL::Error::CPLErr
516
+ %i[GDALRasterBandH double double],
517
+ FFI::CPL::Error::CPLErr
518
518
 
519
519
  attach_function :GDALGetDefaultRAT,
520
- [:GDALRasterBandH],
521
- :GDALRasterAttributeTableH
520
+ [:GDALRasterBandH],
521
+ :GDALRasterAttributeTableH
522
522
  attach_function :GDALSetDefaultRAT,
523
- %i[GDALRasterBandH GDALRasterAttributeTableH],
524
- FFI::CPL::Error::CPLErr
523
+ %i[GDALRasterBandH GDALRasterAttributeTableH],
524
+ FFI::CPL::Error::CPLErr
525
525
  attach_function :GDALAddDerivedBandPixelFunc,
526
- %i[string GDALDerivedPixelFunc],
527
- FFI::CPL::Error::CPLErr
526
+ %i[string GDALDerivedPixelFunc],
527
+ FFI::CPL::Error::CPLErr
528
528
 
529
529
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
530
530
  # Raster Attribute Table functions
531
531
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
532
532
  # Class-level functions
533
533
  attach_function :GDALCreateRasterAttributeTable,
534
- [],
535
- :GDALRasterAttributeTableH
534
+ [],
535
+ :GDALRasterAttributeTableH
536
536
 
537
537
  # Instance-level functions
538
538
  attach_function :GDALDestroyRasterAttributeTable,
539
- [:GDALRasterAttributeTableH],
540
- :void
539
+ [:GDALRasterAttributeTableH],
540
+ :void
541
541
  attach_function :GDALRATChangesAreWrittenToFile,
542
- [:GDALRasterAttributeTableH],
543
- :bool
542
+ [:GDALRasterAttributeTableH],
543
+ :bool
544
544
  attach_function :GDALRATClone,
545
- [:GDALRasterAttributeTableH],
546
- :GDALRasterAttributeTableH
545
+ [:GDALRasterAttributeTableH],
546
+ :GDALRasterAttributeTableH
547
547
 
548
548
  attach_function :GDALRATGetColumnCount,
549
- [:GDALRasterAttributeTableH],
550
- :int
549
+ [:GDALRasterAttributeTableH],
550
+ :int
551
551
  attach_function :GDALRATGetNameOfCol,
552
- %i[GDALRasterAttributeTableH int],
553
- :string
552
+ %i[GDALRasterAttributeTableH int],
553
+ :strptr
554
554
  attach_function :GDALRATGetUsageOfCol,
555
- %i[GDALRasterAttributeTableH int],
556
- RATFieldUsage
555
+ %i[GDALRasterAttributeTableH int],
556
+ RATFieldUsage
557
557
  attach_function :GDALRATGetTypeOfCol,
558
- %i[GDALRasterAttributeTableH int],
559
- RATFieldType
558
+ %i[GDALRasterAttributeTableH int],
559
+ RATFieldType
560
560
  attach_function :GDALRATGetColOfUsage,
561
- [:GDALRasterAttributeTableH, RATFieldUsage],
562
- :int
561
+ [:GDALRasterAttributeTableH, RATFieldUsage],
562
+ :int
563
563
  attach_function :GDALRATCreateColumn,
564
- [:GDALRasterAttributeTableH, :string, RATFieldType, RATFieldUsage],
565
- FFI::CPL::Error::CPLErr
564
+ [:GDALRasterAttributeTableH, :string, RATFieldType, RATFieldUsage],
565
+ FFI::CPL::Error::CPLErr
566
566
 
567
567
  attach_function :GDALRATGetValueAsString,
568
- %i[GDALRasterAttributeTableH int int],
569
- :string
568
+ %i[GDALRasterAttributeTableH int int],
569
+ :strptr
570
570
  attach_function :GDALRATGetValueAsInt,
571
- %i[GDALRasterAttributeTableH int int],
572
- :int
571
+ %i[GDALRasterAttributeTableH int int],
572
+ :int
573
573
  attach_function :GDALRATGetValueAsDouble,
574
- %i[GDALRasterAttributeTableH int int],
575
- :double
574
+ %i[GDALRasterAttributeTableH int int],
575
+ :double
576
576
  attach_function :GDALRATSetValueAsString,
577
- %i[GDALRasterAttributeTableH int int string],
578
- :void
577
+ %i[GDALRasterAttributeTableH int int string],
578
+ :void
579
579
  attach_function :GDALRATSetValueAsInt,
580
- %i[GDALRasterAttributeTableH int int int],
581
- :void
580
+ %i[GDALRasterAttributeTableH int int int],
581
+ :void
582
582
  attach_function :GDALRATSetValueAsDouble,
583
- %i[GDALRasterAttributeTableH int int double],
584
- :void
583
+ %i[GDALRasterAttributeTableH int int double],
584
+ :void
585
585
  attach_function :GDALRATValuesIOAsDouble,
586
- [:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
587
- FFI::CPL::Error::CPLErr
586
+ [:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
587
+ FFI::CPL::Error::CPLErr
588
588
  attach_function :GDALRATValuesIOAsInteger,
589
- [:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
590
- FFI::CPL::Error::CPLErr
589
+ [:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
590
+ FFI::CPL::Error::CPLErr
591
591
  attach_function :GDALRATValuesIOAsString,
592
- [:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
593
- FFI::CPL::Error::CPLErr
592
+ [:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
593
+ FFI::CPL::Error::CPLErr
594
594
 
595
595
  attach_function :GDALRATGetRowCount,
596
- [:GDALRasterAttributeTableH],
597
- :int
596
+ [:GDALRasterAttributeTableH],
597
+ :int
598
598
  attach_function :GDALRATSetRowCount,
599
- %i[GDALRasterAttributeTableH int],
600
- :void
599
+ %i[GDALRasterAttributeTableH int],
600
+ :void
601
601
  attach_function :GDALRATGetRowOfValue,
602
- %i[GDALRasterAttributeTableH double],
603
- :int
602
+ %i[GDALRasterAttributeTableH double],
603
+ :int
604
604
 
605
605
  attach_function :GDALRATSetLinearBinning,
606
- %i[GDALRasterAttributeTableH double double],
607
- :int
606
+ %i[GDALRasterAttributeTableH double double],
607
+ :int
608
608
  attach_function :GDALRATGetLinearBinning,
609
- %i[GDALRasterAttributeTableH pointer pointer],
610
- :bool
609
+ %i[GDALRasterAttributeTableH pointer pointer],
610
+ :bool
611
611
  attach_function :GDALRATTranslateToColorTable,
612
- %i[GDALRasterAttributeTableH int],
613
- :GDALColorTableH
612
+ %i[GDALRasterAttributeTableH int],
613
+ :GDALColorTableH
614
614
  attach_function :GDALRATInitializeFromColorTable,
615
- %i[GDALRasterAttributeTableH GDALColorTableH],
616
- FFI::CPL::Error::CPLErr
615
+ %i[GDALRasterAttributeTableH GDALColorTableH],
616
+ FFI::CPL::Error::CPLErr
617
617
 
618
618
  attach_function :GDALRATDumpReadable,
619
- %i[GDALRasterAttributeTableH pointer],
620
- :void
619
+ %i[GDALRasterAttributeTableH pointer],
620
+ :void
621
621
 
622
622
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
623
623
  # ColorTable functions
@@ -636,20 +636,20 @@ module FFI
636
636
  attach_function :GDALSetColorEntry, [:GDALColorTableH, :int, FFI::GDAL::ColorEntry.ptr], :void
637
637
 
638
638
  attach_function :GDALCreateColorRamp,
639
- [:GDALColorTableH, :int, FFI::GDAL::ColorEntry.ptr, :int, FFI::GDAL::ColorEntry.ptr],
640
- :void
639
+ [:GDALColorTableH, :int, FFI::GDAL::ColorEntry.ptr, :int, FFI::GDAL::ColorEntry.ptr],
640
+ :void
641
641
 
642
642
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
643
643
  # PaletteInterp functions
644
644
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
645
- attach_function :GDALGetPaletteInterpretationName, [PaletteInterp], :string
645
+ attach_function :GDALGetPaletteInterpretationName, [PaletteInterp], :strptr
646
646
 
647
647
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
648
648
  # General stuff
649
649
  # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
650
650
  attach_function :GDALGetDataTypeSize, [DataType], :int
651
651
  attach_function :GDALDataTypeIsComplex, [DataType], :bool
652
- attach_function :GDALGetDataTypeName, [DataType], :string
652
+ attach_function :GDALGetDataTypeName, [DataType], :strptr
653
653
  attach_function :GDALGetDataTypeByName, [:string], DataType
654
654
  attach_function :GDALDataTypeUnion, [DataType, DataType], DataType
655
655
 
@@ -670,14 +670,14 @@ module FFI
670
670
 
671
671
  attach_function :GDALGeneralCmdLineProcessor, %i[int pointer int], :int
672
672
  attach_function :GDALSwapWords,
673
- %i[pointer int int int],
674
- :void
673
+ %i[pointer int int int],
674
+ :void
675
675
  attach_function :GDALCopyWords,
676
- %i[pointer int int pointer int int int int],
677
- :void
676
+ %i[pointer int int pointer int int int int],
677
+ :void
678
678
  attach_function :GDALCopyBits,
679
- %i[pointer int int pointer int int int int],
680
- :void
679
+ %i[pointer int int pointer int int int int],
680
+ :void
681
681
  end
682
682
  end
683
683
  end