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