ffi-gdal 1.0.0.beta3 → 1.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.rubocop.yml +62 -0
- data/Gemfile +1 -1
- data/History.md +53 -28
- data/README.md +6 -0
- data/Rakefile +23 -1
- data/examples/extract_and_colorize.rb +21 -22
- data/examples/geometries.rb +2 -2
- data/examples/gridding.rb +106 -0
- data/examples/ogr_layer_to_layer.rb +1 -1
- data/examples/points.txt +127 -0
- data/examples/testing_gdal.rb +3 -4
- data/ffi-gdal.gemspec +3 -2
- data/lib/ext/error_symbols.rb +2 -57
- data/lib/ext/ffi_library_function_checks.rb +26 -0
- data/lib/ext/float_ext.rb +2 -2
- data/lib/ext/narray_ext.rb +2 -0
- data/lib/ext/numeric_as_data_type.rb +19 -0
- data/lib/ext/to_bool.rb +4 -4
- data/lib/ffi/cpl/conv.rb +132 -0
- data/lib/ffi/cpl/error.rb +67 -0
- data/lib/ffi/cpl/hash_set.rb +39 -0
- data/lib/ffi/cpl/http.rb +25 -0
- data/lib/ffi/cpl/http_result.rb +18 -0
- data/lib/ffi/cpl/list.rb +38 -0
- data/lib/ffi/cpl/mime_part.rb +11 -0
- data/lib/ffi/cpl/minixml.rb +47 -0
- data/lib/ffi/cpl/port.rb +23 -0
- data/lib/ffi/cpl/quad_tree.rb +51 -0
- data/lib/ffi/{ogr/ogr_envelope.rb → cpl/rect_obj.rb} +3 -3
- data/lib/ffi/cpl/string.rb +95 -0
- data/lib/ffi/cpl/vsi.rb +115 -0
- data/lib/ffi/cpl/xml_node.rb +6 -6
- data/lib/ffi/gdal/alg.rb +385 -0
- data/lib/ffi/gdal/{gdal_color_entry.rb → color_entry.rb} +1 -2
- data/lib/ffi/gdal/exceptions.rb +6 -0
- data/lib/ffi/gdal/{gdal_gcp.rb → gcp.rb} +1 -3
- data/lib/ffi/gdal/{gdal_h.rb → gdal.rb} +253 -252
- data/lib/ffi/gdal/grid.rb +58 -0
- data/lib/ffi/gdal/{gdal_grid_data_metrics_options.rb → grid_data_metrics_options.rb} +1 -2
- data/lib/ffi/gdal/{gdal_grid_inverse_distance_to_a_power_options.rb → grid_inverse_distance_to_a_power_options.rb} +1 -2
- data/lib/ffi/gdal/{gdal_grid_moving_average_options.rb → grid_moving_average_options.rb} +1 -2
- data/lib/ffi/gdal/{gdal_grid_nearest_neighbor_options.rb → grid_nearest_neighbor_options.rb} +1 -2
- data/lib/ffi/gdal/matching.rb +20 -0
- data/lib/ffi/gdal/{gdal_rpc_info.rb → rpc_info.rb} +1 -2
- data/lib/ffi/gdal/{gdal_transformer_info.rb → transformer_info.rb} +1 -2
- data/lib/ffi/gdal/version.rb +1 -1
- data/lib/ffi/gdal/vrt.rb +92 -0
- data/lib/ffi/gdal/{gdal_warp_options.rb → warp_options.rb} +8 -4
- data/lib/ffi/gdal/warper.rb +70 -0
- data/lib/ffi/gdal.rb +56 -69
- data/lib/ffi/ogr/api.rb +567 -0
- data/lib/ffi/ogr/{ogr_contour_writer_info.rb → contour_writer_info.rb} +2 -3
- data/lib/ffi/ogr/core.rb +181 -0
- data/lib/ffi/ogr/envelope.rb +12 -0
- data/lib/ffi/ogr/{ogr_envelope_3d.rb → envelope_3d.rb} +2 -2
- data/lib/ffi/ogr/featurestyle.rb +29 -0
- data/lib/ffi/ogr/field.rb +63 -0
- data/lib/ffi/ogr/geocoding.rb +30 -0
- data/lib/ffi/ogr/srs_api.rb +407 -0
- data/lib/ffi/ogr/style_param.rb +13 -0
- data/lib/ffi/ogr/{ogr_style_value.rb → style_value.rb} +4 -3
- data/lib/ffi/ogr.rb +7 -7
- data/lib/ffi-gdal.rb +7 -145
- data/lib/gdal/color_entry.rb +18 -14
- data/lib/gdal/color_entry_mixins/extensions.rb +32 -0
- data/lib/gdal/color_interpretation.rb +2 -2
- data/lib/gdal/color_table.rb +37 -32
- data/lib/gdal/color_table_mixins/extensions.rb +48 -0
- data/lib/gdal/cpl_error_handler.rb +119 -0
- data/lib/gdal/data_type.rb +7 -7
- data/lib/gdal/dataset.rb +131 -238
- data/lib/gdal/dataset_mixins/algorithm_methods.rb +182 -0
- data/lib/gdal/dataset_mixins/extensions.rb +542 -0
- data/lib/gdal/dataset_mixins/matching.rb +26 -0
- data/lib/gdal/driver.rb +68 -92
- data/lib/gdal/driver_mixins/extensions.rb +93 -0
- data/lib/gdal/exceptions.rb +32 -4
- data/lib/gdal/geo_transform.rb +63 -43
- data/lib/gdal/geo_transform_mixins/extensions.rb +57 -0
- data/lib/gdal/grid.rb +144 -0
- data/lib/gdal/grid_types/data_metrics_base.rb +14 -0
- data/lib/gdal/grid_types/inverse_distance_to_a_power.rb +19 -0
- data/lib/gdal/grid_types/metric_average_distance.rb +12 -0
- data/lib/gdal/grid_types/metric_average_distance_pts.rb +12 -0
- data/lib/gdal/grid_types/metric_count.rb +12 -0
- data/lib/gdal/grid_types/metric_maximum.rb +12 -0
- data/lib/gdal/grid_types/metric_minimum.rb +12 -0
- data/lib/gdal/grid_types/metric_range.rb +12 -0
- data/lib/gdal/grid_types/moving_average.rb +19 -0
- data/lib/gdal/grid_types/nearest_neighbor.rb +19 -0
- data/lib/gdal/grid_types.rb +22 -0
- data/lib/gdal/internal_helpers.rb +94 -0
- data/lib/gdal/major_object.rb +4 -7
- data/lib/gdal/options.rb +14 -7
- data/lib/gdal/raster_attribute_table.rb +38 -47
- data/lib/gdal/raster_attribute_table_mixins/extensions.rb +41 -0
- data/lib/gdal/raster_band.rb +193 -227
- data/lib/gdal/raster_band_classifier.rb +107 -0
- data/lib/gdal/raster_band_mixins/algorithm_methods.rb +292 -0
- data/lib/gdal/raster_band_mixins/extensions.rb +238 -0
- data/lib/gdal/rpc_info.rb +35 -0
- data/lib/gdal/transformer.rb +15 -0
- data/lib/gdal/transformers/approximate_transformer.rb +48 -0
- data/lib/gdal/transformers/base_general_image_projection_transformer.rb +45 -0
- data/lib/gdal/transformers/gcp_transformer.rb +55 -0
- data/lib/gdal/transformers/general_image_projection_transformer.rb +31 -0
- data/lib/gdal/transformers/general_image_projection_transformer2.rb +52 -0
- data/lib/gdal/transformers/general_image_projection_transformer3.rb +25 -0
- data/lib/gdal/transformers/geolocation_transformer.rb +42 -0
- data/lib/gdal/transformers/reprojection_transformer.rb +39 -0
- data/lib/gdal/transformers/rpc_transformer.rb +56 -0
- data/lib/gdal/transformers/tps_transformer.rb +40 -0
- data/lib/gdal/virtual_dataset.rb +96 -0
- data/lib/gdal/warp_operation.rb +20 -23
- data/lib/gdal.rb +17 -0
- data/lib/ogr/coordinate_transformation.rb +16 -41
- data/lib/ogr/data_source.rb +103 -58
- data/lib/ogr/data_source_extensions.rb +5 -6
- data/lib/ogr/data_source_mixins/capability_methods.rb +27 -0
- data/lib/ogr/driver.rb +61 -33
- data/lib/ogr/driver_mixins/capability_methods.rb +16 -0
- data/lib/ogr/envelope.rb +29 -18
- data/lib/ogr/envelope_extensions.rb +70 -49
- data/lib/ogr/error_handling.rb +46 -0
- data/lib/ogr/exceptions.rb +58 -12
- data/lib/ogr/feature.rb +334 -86
- data/lib/ogr/feature_definition.rb +94 -51
- data/lib/ogr/feature_definition_extensions.rb +36 -13
- data/lib/ogr/feature_extensions.rb +62 -11
- data/lib/ogr/field.rb +175 -54
- data/lib/ogr/field_definition.rb +110 -0
- data/lib/ogr/{field_extensions.rb → field_definition_extensions.rb} +4 -5
- data/lib/ogr/{geocoding_session.rb → geocoder.rb} +14 -13
- data/lib/ogr/geometries/geometry_collection.rb +13 -0
- data/lib/ogr/geometries/line_string.rb +35 -0
- data/lib/ogr/geometries/linear_ring.rb +11 -0
- data/lib/ogr/geometries/multi_line_string.rb +16 -0
- data/lib/ogr/geometries/multi_point.rb +14 -0
- data/lib/ogr/geometries/multi_polygon.rb +21 -0
- data/lib/ogr/geometries/none_geometry.rb +13 -0
- data/lib/ogr/geometries/point.rb +65 -0
- data/lib/ogr/geometries/point_extensions.rb +32 -0
- data/lib/ogr/geometries/polygon.rb +14 -0
- data/lib/ogr/geometries/unknown_geometry.rb +10 -0
- data/lib/ogr/geometry.rb +270 -242
- data/lib/ogr/geometry_extensions.rb +8 -9
- data/lib/ogr/geometry_field_definition.rb +99 -0
- data/lib/ogr/geometry_field_definition_extensions.rb +19 -0
- data/lib/ogr/geometry_types/container.rb +75 -0
- data/lib/ogr/geometry_types/curve.rb +25 -28
- data/lib/ogr/geometry_types/surface.rb +13 -4
- data/lib/ogr/internal_helpers.rb +57 -0
- data/lib/ogr/layer.rb +60 -181
- data/lib/ogr/layer_mixins/capability_methods.rb +102 -0
- data/lib/ogr/layer_mixins/extensions.rb +59 -0
- data/lib/ogr/layer_mixins/ogr_feature_methods.rb +127 -0
- data/lib/ogr/layer_mixins/ogr_field_methods.rb +143 -0
- data/lib/ogr/layer_mixins/ogr_layer_method_methods.rb +163 -0
- data/lib/ogr/layer_mixins/ogr_query_filter_methods.rb +89 -0
- data/lib/ogr/layer_mixins/ogr_sql_methods.rb +48 -0
- data/lib/ogr/spatial_reference.rb +108 -589
- data/lib/ogr/spatial_reference_extensions.rb +29 -3
- data/lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb +494 -0
- data/lib/ogr/spatial_reference_mixins/exporters.rb +134 -0
- data/lib/ogr/spatial_reference_mixins/importers.rb +243 -0
- data/lib/ogr/spatial_reference_mixins/morphers.rb +25 -0
- data/lib/ogr/spatial_reference_mixins/parameter_getter_setters.rb +122 -0
- data/lib/ogr/spatial_reference_mixins/type_checks.rb +62 -0
- data/lib/ogr/style_table.rb +53 -5
- data/lib/ogr/style_table_extensions.rb +21 -5
- data/lib/ogr/style_tool.rb +118 -0
- data/lib/ogr.rb +8 -0
- data/spec/ffi-gdal_spec.rb +1 -2
- data/spec/integration/{color_table_info_spec.rb → gdal/color_table_info_spec.rb} +12 -12
- data/spec/integration/{dataset_info_spec.rb → gdal/dataset_info_spec.rb} +2 -6
- data/spec/integration/{driver_info_spec.rb → gdal/driver_info_spec.rb} +5 -5
- data/spec/integration/{geo_transform_info_spec.rb → gdal/geo_transform_info_spec.rb} +1 -14
- data/spec/integration/{raster_attribute_table_info_spec.rb → gdal/raster_attribute_table_info_spec.rb} +1 -2
- data/spec/integration/{raster_band_info_spec.rb → gdal/raster_band_info_spec.rb} +30 -42
- data/spec/integration/ogr/layer_spec.rb +97 -0
- data/spec/spec_helper.rb +94 -5
- data/spec/support/integration_help.rb +1 -0
- data/spec/support/shared_contexts.rb +26 -0
- data/spec/support/shared_examples/{major_object_examples.rb → gdal/major_object_examples.rb} +5 -5
- data/spec/support/shared_examples/ogr/a_25D_geometry.rb +7 -0
- data/spec/support/shared_examples/ogr/a_container_geometry.rb +47 -0
- data/spec/support/shared_examples/ogr/a_geometry.rb +404 -0
- data/spec/support/shared_examples/ogr/a_line_string.rb +16 -0
- data/spec/support/test_style_table.txt +3 -0
- data/spec/unit/ext/error_symbols_spec.rb +41 -53
- data/spec/unit/ext/numeric_as_data_type_spec.rb +113 -0
- data/spec/unit/ffi/gdal_spec.rb +70 -0
- data/spec/unit/gdal/color_entry_spec.rb +5 -0
- data/spec/unit/gdal/color_interpretation_spec.rb +5 -0
- data/spec/unit/gdal/{color_table_extensions_spec.rb → color_table_mixins/extensions_spec.rb} +3 -3
- data/spec/unit/gdal/color_table_spec.rb +14 -16
- data/spec/unit/gdal/data_type_spec.rb +10 -17
- data/spec/unit/gdal/dataset_spec.rb +4 -7
- data/spec/unit/gdal/driver_mixins/extensions_spec.rb +22 -0
- data/spec/unit/gdal/driver_spec.rb +49 -0
- data/spec/unit/gdal/environment_methods_spec.rb +6 -0
- data/spec/unit/gdal/geo_transform_spec.rb +276 -0
- data/spec/unit/gdal/grid_spec.rb +5 -0
- data/spec/unit/gdal/internal_helpers_spec.rb +112 -0
- data/spec/unit/gdal/major_object_spec.rb +6 -0
- data/spec/unit/gdal/options_spec.rb +5 -0
- data/spec/unit/gdal/raster_attribute_table_spec.rb +5 -0
- data/spec/unit/gdal/raster_band_classifier_spec.rb +134 -0
- data/spec/unit/gdal/raster_band_spec.rb +5 -0
- data/spec/unit/gdal/rpc_info_spec.rb +5 -0
- data/spec/unit/gdal/version_info_spec.rb +6 -0
- data/spec/unit/gdal/virtual_dataset_spec.rb +32 -0
- data/spec/unit/gdal/warp_operation_spec.rb +5 -0
- data/spec/unit/ogr/data_source_mixins/capability_methods_spec.rb +30 -0
- data/spec/unit/ogr/data_source_spec.rb +209 -0
- data/spec/unit/ogr/driver_mixins/capability_methods_spec.rb +18 -0
- data/spec/unit/ogr/driver_spec.rb +150 -0
- data/spec/unit/ogr/envelope_spec.rb +322 -0
- data/spec/unit/ogr/feature_definition_spec.rb +313 -0
- data/spec/unit/ogr/feature_spec.rb +379 -0
- data/spec/unit/ogr/field_definition_spec.rb +135 -0
- data/spec/unit/ogr/field_spec.rb +193 -0
- data/spec/unit/ogr/geometries/geometry_collection_spec.rb +186 -0
- data/spec/unit/ogr/geometries/line_string_spec.rb +105 -0
- data/spec/unit/ogr/{linear_ring_spec.rb → geometries/linear_ring_spec.rb} +10 -31
- data/spec/unit/ogr/geometries/multi_line_string_spec.rb +14 -0
- data/spec/unit/ogr/geometries/multi_point_spec.rb +14 -0
- data/spec/unit/ogr/geometries/multi_polygon_spec.rb +41 -0
- data/spec/unit/ogr/geometries/none_geometry_spec.rb +12 -0
- data/spec/unit/ogr/{point_spec.rb → geometries/point_spec.rb} +19 -25
- data/spec/unit/ogr/geometries/polygon_spec.rb +17 -0
- data/spec/unit/ogr/geometries/unknown_geometry_spec.rb +10 -0
- data/spec/unit/ogr/geometry_field_definition_spec.rb +87 -0
- data/spec/unit/ogr/geometry_spec.rb +542 -0
- data/spec/unit/ogr/internal_helpers_spec.rb +57 -0
- data/spec/unit/ogr/layer_mixins/capability_methods_spec.rb +88 -0
- data/spec/unit/ogr/layer_mixins/ogr_feature_methods_spec.rb +145 -0
- data/spec/unit/ogr/layer_mixins/ogr_field_methods_spec.rb +432 -0
- data/spec/unit/ogr/layer_mixins/ogr_layer_method_methods_spec.rb +20 -0
- data/spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb +42 -0
- data/spec/unit/ogr/layer_mixins/ogr_sql_methods_spec.rb +12 -0
- data/spec/unit/ogr/layer_spec.rb +66 -67
- data/spec/unit/ogr/spatial_reference_mixins/coordinate_system_getter_setters_spec.rb +46 -0
- data/spec/unit/ogr/spatial_reference_mixins/exporters_spec.rb +139 -0
- data/spec/unit/ogr/spatial_reference_mixins/importers_spec.rb +38 -0
- data/spec/unit/ogr/spatial_reference_mixins/morphers_spec.rb +36 -0
- data/spec/unit/ogr/spatial_reference_mixins/parameter_getter_setters_spec.rb +102 -0
- data/spec/unit/ogr/spatial_reference_mixins/type_checks_spec.rb +157 -0
- data/spec/unit/ogr/spatial_reference_spec.rb +42 -0
- data/spec/unit/ogr/style_table_spec.rb +132 -0
- data/spec/unit/ogr/style_tool_spec.rb +157 -0
- data/spec/unit/version_info_spec.rb +1 -1
- metadata +285 -75
- data/lib/ffi/cpl/conv_h.rb +0 -143
- data/lib/ffi/cpl/error_h.rb +0 -63
- data/lib/ffi/cpl/minixml_h.rb +0 -14
- data/lib/ffi/cpl/string_h.rb +0 -81
- data/lib/ffi/cpl/vsi_h.rb +0 -112
- data/lib/ffi/gdal/alg_h.rb +0 -127
- data/lib/ffi/gdal/grid_h.rb +0 -51
- data/lib/ffi/gdal/warper_h.rb +0 -48
- data/lib/ffi/ogr/api_h.rb +0 -553
- data/lib/ffi/ogr/core_h.rb +0 -148
- data/lib/ffi/ogr/featurestyle_h.rb +0 -22
- data/lib/ffi/ogr/geocoding_h.rb +0 -21
- data/lib/ffi/ogr/ogr_field.rb +0 -50
- data/lib/ffi/ogr/ogr_style_param.rb +0 -12
- data/lib/ffi/ogr/srs_api_h.rb +0 -325
- data/lib/gdal/color_entry_extensions.rb +0 -30
- data/lib/gdal/color_table_extensions.rb +0 -47
- data/lib/gdal/dataset_extensions.rb +0 -496
- data/lib/gdal/driver_extensions.rb +0 -56
- data/lib/gdal/geo_transform_extensions.rb +0 -90
- data/lib/gdal/raster_attribute_table_extensions.rb +0 -40
- data/lib/gdal/raster_band_extensions.rb +0 -198
- data/lib/ogr/geometry_types/collection.rb +0 -45
- data/lib/ogr/layer_extensions.rb +0 -55
- data/lib/ogr/line_string.rb +0 -7
- data/lib/ogr/linear_ring.rb +0 -6
- data/lib/ogr/multi_line_string.rb +0 -9
- data/lib/ogr/multi_point.rb +0 -7
- data/lib/ogr/multi_polygon.rb +0 -14
- data/lib/ogr/point.rb +0 -89
- data/lib/ogr/polygon.rb +0 -9
@@ -1,12 +1,18 @@
|
|
1
1
|
require 'ffi'
|
2
|
+
require_relative '../../ext/ffi_library_function_checks'
|
3
|
+
require_relative '../ogr/core'
|
4
|
+
require_relative '../ogr/srs_api'
|
5
|
+
require_relative 'color_entry'
|
2
6
|
|
3
7
|
module FFI
|
4
8
|
module GDAL
|
9
|
+
extend ::FFI::Library
|
10
|
+
ffi_lib [::FFI::CURRENT_PROCESS, ::FFI::GDAL.gdal_library_path]
|
5
11
|
|
6
|
-
|
12
|
+
# ----------------------------------------------------------------
|
7
13
|
# Enums
|
8
|
-
|
9
|
-
|
14
|
+
# ----------------------------------------------------------------
|
15
|
+
DataType = enum :GDT_Unknown, 0,
|
10
16
|
:GDT_Byte, 1,
|
11
17
|
:GDT_UInt16, 2,
|
12
18
|
:GDT_Int16, 3,
|
@@ -20,19 +26,19 @@ module FFI
|
|
20
26
|
:GDT_CFloat64, 11,
|
21
27
|
:GDT_TypeCount, 12
|
22
28
|
|
23
|
-
|
29
|
+
AsyncStatusType = enum :GARIO_PENDING, 0,
|
24
30
|
:GARIO_UPDATE, 1,
|
25
31
|
:GARIO_ERROR, 2,
|
26
32
|
:GARIO_COMPLETE, 3,
|
27
33
|
:GARIO_TypeCount, 4
|
28
34
|
|
29
|
-
|
35
|
+
Access = enum :GA_ReadOnly, 0,
|
30
36
|
:GA_Update, 1
|
31
37
|
|
32
|
-
|
38
|
+
RWFlag = enum :GF_Read, 0,
|
33
39
|
:GF_Write, 1
|
34
40
|
|
35
|
-
|
41
|
+
ColorInterp = enum :GCI_Undefined, 0,
|
36
42
|
:GCI_GrayIndex, 1,
|
37
43
|
:GCI_PaletteIndex, 2,
|
38
44
|
:GCI_RedBand, 3,
|
@@ -51,16 +57,16 @@ module FFI
|
|
51
57
|
:GCI_YCbCr_CrBand, 16,
|
52
58
|
:GCI_Max, 16 # Seems wrong that this is also 16...
|
53
59
|
|
54
|
-
|
60
|
+
PaletteInterp = enum :GPI_Gray, 0,
|
55
61
|
:GPI_RGB, 1,
|
56
62
|
:GPI_CMYK, 2,
|
57
63
|
:GPI_HLS, 3
|
58
64
|
|
59
|
-
|
65
|
+
RATFieldType = enum :GFT_Integer,
|
60
66
|
:GFT_Real,
|
61
67
|
:GFT_String
|
62
68
|
|
63
|
-
|
69
|
+
RATFieldUsage = enum :GFU_Generic, 0,
|
64
70
|
:GFU_PixelCount, 1,
|
65
71
|
:GFU_Name, 2,
|
66
72
|
:GFU_Min, 3,
|
@@ -80,13 +86,13 @@ module FFI
|
|
80
86
|
:GFU_AlphaMax, 17,
|
81
87
|
:GFU_MaxCount
|
82
88
|
|
83
|
-
|
89
|
+
TileOrganization = enum :GTO_TIP,
|
84
90
|
:GTO_BIT,
|
85
91
|
:GTO_BSQ
|
86
92
|
|
87
|
-
|
93
|
+
# ----------------------------------------------------------------
|
88
94
|
# typedefs
|
89
|
-
|
95
|
+
# ----------------------------------------------------------------
|
90
96
|
typedef :pointer, :GDALMajorObjectH
|
91
97
|
typedef :pointer, :GDALDatasetH
|
92
98
|
typedef :pointer, :GDALRasterBandH
|
@@ -98,40 +104,29 @@ module FFI
|
|
98
104
|
# When using, make sure to return +true+ if the operation should continue;
|
99
105
|
# +false+ if the user has cancelled.
|
100
106
|
callback :GDALProgressFunc,
|
101
|
-
[
|
107
|
+
%i[double string pointer], # completion, message, progress_arg
|
102
108
|
:bool
|
103
109
|
|
104
110
|
callback :GDALDerivedPixelFunc,
|
105
|
-
[:pointer, :int, :pointer, :int, :int,
|
111
|
+
[:pointer, :int, :pointer, :int, :int, DataType, DataType, :int, :int],
|
106
112
|
:int
|
107
|
-
end
|
108
|
-
|
109
|
-
end
|
110
|
-
|
111
|
-
# These requires depend on ^^^
|
112
|
-
require_relative 'alg_h'
|
113
|
-
require_relative 'grid_h'
|
114
|
-
require_relative 'warper_h'
|
115
|
-
|
116
|
-
module FFI
|
117
|
-
module GDAL
|
118
113
|
|
119
|
-
|
114
|
+
# ----------------------------------------------------------------
|
120
115
|
# functions
|
121
|
-
|
116
|
+
# ----------------------------------------------------------------
|
122
117
|
# AsyncStatus
|
123
|
-
attach_function :GDALGetAsyncStatusTypeName, [
|
124
|
-
attach_function :GDALGetAsyncStatusTypeByName, [:string],
|
118
|
+
attach_function :GDALGetAsyncStatusTypeName, [AsyncStatusType], :string
|
119
|
+
attach_function :GDALGetAsyncStatusTypeByName, [:string], AsyncStatusType
|
125
120
|
|
126
|
-
|
121
|
+
# ~~~~~~~~~~~~~~~~~~~
|
127
122
|
# ColorInterpretation
|
128
|
-
|
129
|
-
attach_function :GDALGetColorInterpretationName, [
|
130
|
-
attach_function :GDALGetColorInterpretationByName, [:string],
|
123
|
+
# ~~~~~~~~~~~~~~~~~~~
|
124
|
+
attach_function :GDALGetColorInterpretationName, [ColorInterp], :string
|
125
|
+
attach_function :GDALGetColorInterpretationByName, [:string], ColorInterp
|
131
126
|
|
132
|
-
|
127
|
+
# ~~~~~~~~~~~~~~~~~~~
|
133
128
|
# Driver
|
134
|
-
|
129
|
+
# ~~~~~~~~~~~~~~~~~~~
|
135
130
|
attach_function :GDALAllRegister, [], :void
|
136
131
|
|
137
132
|
# Class-level functions
|
@@ -139,16 +134,16 @@ module FFI
|
|
139
134
|
attach_function :GDALGetDriverCount, [], :int
|
140
135
|
attach_function :GDALIdentifyDriver, %i[string pointer], :GDALDriverH
|
141
136
|
attach_function :GDALGetDriverByName, [:string], :GDALDriverH
|
142
|
-
attach_function :GDALDestroyDriverManager, [
|
137
|
+
attach_function :GDALDestroyDriverManager, [], :void
|
143
138
|
|
144
139
|
# Instance-level functions
|
145
140
|
attach_function :GDALCreate,
|
146
|
-
[:GDALDriverH, :string, :int, :int, :int,
|
141
|
+
[:GDALDriverH, :string, :int, :int, :int, DataType, :pointer],
|
147
142
|
:GDALDatasetH
|
148
143
|
attach_function :GDALCreateCopy,
|
149
144
|
%i[GDALDriverH string GDALDatasetH bool pointer GDALProgressFunc pointer],
|
150
145
|
:GDALDatasetH
|
151
|
-
attach_function :GDALValidateCreationOptions, %i[GDALDriverH pointer], CPLErr
|
146
|
+
attach_function :GDALValidateCreationOptions, %i[GDALDriverH pointer], FFI::CPL::Error::CPLErr
|
152
147
|
attach_function :GDALGetDriverShortName, [:GDALDriverH], :string
|
153
148
|
attach_function :GDALGetDriverLongName, [:GDALDriverH], :string
|
154
149
|
attach_function :GDALGetDriverHelpTopic, [:GDALDriverH], :string
|
@@ -157,33 +152,33 @@ module FFI
|
|
157
152
|
attach_function :GDALDestroyDriver, [:GDALDriverH], :void
|
158
153
|
attach_function :GDALRegisterDriver, [:GDALDriverH], :int
|
159
154
|
attach_function :GDALDeregisterDriver, [:GDALDriverH], :void
|
160
|
-
attach_function :GDALDeleteDataset, [
|
155
|
+
attach_function :GDALDeleteDataset, %i[GDALDriverH string], FFI::CPL::Error::CPLErr
|
161
156
|
attach_function :GDALRenameDataset,
|
162
157
|
%i[GDALDriverH string string],
|
163
|
-
CPLErr
|
158
|
+
FFI::CPL::Error::CPLErr
|
164
159
|
attach_function :GDALCopyDatasetFiles,
|
165
160
|
%i[GDALDriverH string string],
|
166
|
-
CPLErr
|
161
|
+
FFI::CPL::Error::CPLErr
|
167
162
|
|
168
|
-
|
163
|
+
# ~~~~~~~~~~~~~~~~~~~
|
169
164
|
# Dataset
|
170
|
-
|
165
|
+
# ~~~~~~~~~~~~~~~~~~~
|
171
166
|
# Class-level functions
|
172
|
-
attach_function :GDALOpen, [:string,
|
167
|
+
attach_function :GDALOpen, [:string, Access], :GDALDatasetH
|
173
168
|
attach_function :GDALOpenShared,
|
174
|
-
[:string,
|
169
|
+
[:string, Access],
|
175
170
|
:GDALDatasetH
|
176
171
|
attach_function :GDALOpenEx,
|
177
172
|
%i[string uint string string string],
|
178
173
|
:GDALDatasetH
|
179
174
|
attach_function :GDALDumpOpenDatasets, [:pointer], :int
|
180
|
-
attach_function :GDALGetOpenDatasets, [
|
175
|
+
attach_function :GDALGetOpenDatasets, %i[pointer pointer], :void
|
181
176
|
|
182
177
|
# Instance-level functions
|
183
178
|
attach_function :GDALClose, [:GDALDatasetH], :void
|
184
179
|
attach_function :GDALGetDatasetDriver, [:GDALDatasetH], :GDALDriverH
|
185
180
|
attach_function :GDALGetFileList, [:GDALDatasetH], :pointer
|
186
|
-
attach_function :GDALGetInternalHandle, [
|
181
|
+
attach_function :GDALGetInternalHandle, %i[GDALDatasetH string], :pointer
|
187
182
|
attach_function :GDALReferenceDataset, [:GDALDatasetH], :int
|
188
183
|
attach_function :GDALDereferenceDataset, [:GDALDatasetH], :int
|
189
184
|
|
@@ -193,14 +188,14 @@ module FFI
|
|
193
188
|
attach_function :GDALGetRasterXSize, [:GDALDatasetH], :int
|
194
189
|
attach_function :GDALGetRasterYSize, [:GDALDatasetH], :int
|
195
190
|
attach_function :GDALGetRasterCount, [:GDALDatasetH], :int
|
196
|
-
attach_function :GDALGetRasterBand, [
|
191
|
+
attach_function :GDALGetRasterBand, %i[GDALDatasetH int], :GDALRasterBandH
|
197
192
|
attach_function :GDALAddBand,
|
198
|
-
[:GDALDatasetH,
|
199
|
-
CPLErr
|
193
|
+
[:GDALDatasetH, DataType, :pointer],
|
194
|
+
FFI::CPL::Error::CPLErr
|
200
195
|
attach_function :GDALBeginAsyncReader,
|
201
196
|
[
|
202
197
|
:GDALDatasetH,
|
203
|
-
|
198
|
+
RWFlag,
|
204
199
|
:int,
|
205
200
|
:int,
|
206
201
|
:int,
|
@@ -208,7 +203,7 @@ module FFI
|
|
208
203
|
:pointer,
|
209
204
|
:int,
|
210
205
|
:int,
|
211
|
-
|
206
|
+
DataType,
|
212
207
|
:int,
|
213
208
|
:pointer,
|
214
209
|
:int,
|
@@ -217,13 +212,13 @@ module FFI
|
|
217
212
|
], :GDALAsyncReaderH
|
218
213
|
|
219
214
|
attach_function :GDALEndAsyncReader,
|
220
|
-
[
|
215
|
+
%i[GDALDatasetH GDALAsyncReaderH],
|
221
216
|
:void
|
222
217
|
|
223
218
|
attach_function :GDALDatasetRasterIO,
|
224
219
|
[
|
225
220
|
:GDALDatasetH,
|
226
|
-
|
221
|
+
RWFlag,
|
227
222
|
:int,
|
228
223
|
:int,
|
229
224
|
:int,
|
@@ -231,13 +226,13 @@ module FFI
|
|
231
226
|
:pointer,
|
232
227
|
:int,
|
233
228
|
:int,
|
234
|
-
|
229
|
+
DataType,
|
235
230
|
:int,
|
236
231
|
:pointer,
|
237
232
|
:int,
|
238
233
|
:int,
|
239
234
|
:int
|
240
|
-
], CPLErr
|
235
|
+
], FFI::CPL::Error::CPLErr
|
241
236
|
|
242
237
|
attach_function :GDALDatasetAdviseRead,
|
243
238
|
[
|
@@ -248,93 +243,99 @@ module FFI
|
|
248
243
|
:int,
|
249
244
|
:int,
|
250
245
|
:int,
|
251
|
-
|
246
|
+
DataType,
|
252
247
|
:int,
|
253
248
|
:pointer,
|
254
249
|
:pointer
|
255
|
-
], CPLErr
|
250
|
+
], FFI::CPL::Error::CPLErr
|
256
251
|
|
257
|
-
attach_function :GDALInitGCPs, [
|
258
|
-
attach_function :GDALDeinitGCPs, [
|
259
|
-
attach_function :GDALDuplicateGCPs, [
|
252
|
+
attach_function :GDALInitGCPs, %i[int pointer], :void
|
253
|
+
attach_function :GDALDeinitGCPs, %i[int pointer], :void
|
254
|
+
attach_function :GDALDuplicateGCPs, %i[int pointer], :pointer
|
260
255
|
attach_function :GDALGCPsToGeoTransform,
|
261
|
-
[
|
256
|
+
%i[int pointer pointer int],
|
262
257
|
:int
|
263
258
|
attach_function :GDALGetGCPCount, [:GDALDatasetH], :int
|
264
259
|
attach_function :GDALGetGCPProjection, [:GDALDatasetH], :string
|
265
260
|
attach_function :GDALGetGCPs, [:GDALDatasetH], :pointer
|
266
261
|
attach_function :GDALSetGCPs,
|
267
|
-
[
|
268
|
-
CPLErr
|
262
|
+
%i[GDALDatasetH int pointer string],
|
263
|
+
FFI::CPL::Error::CPLErr
|
269
264
|
|
270
265
|
attach_function :GDALGetProjectionRef, [:GDALDatasetH], :string
|
271
|
-
attach_function :GDALSetProjection, [
|
272
|
-
attach_function :GDALGetGeoTransform, [
|
266
|
+
attach_function :GDALSetProjection, %i[GDALDatasetH string], FFI::CPL::Error::CPLErr
|
267
|
+
attach_function :GDALGetGeoTransform, %i[GDALDatasetH pointer], FFI::CPL::Error::CPLErr
|
273
268
|
attach_function :GDALSetGeoTransform,
|
274
|
-
[
|
275
|
-
CPLErr
|
269
|
+
%i[GDALDatasetH pointer],
|
270
|
+
FFI::CPL::Error::CPLErr
|
276
271
|
|
277
272
|
attach_function :GDALBuildOverviews,
|
278
|
-
[
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
], CPLErr
|
273
|
+
%i[
|
274
|
+
GDALDatasetH
|
275
|
+
string
|
276
|
+
int
|
277
|
+
pointer
|
278
|
+
int
|
279
|
+
pointer
|
280
|
+
GDALProgressFunc
|
281
|
+
pointer
|
282
|
+
], FFI::CPL::Error::CPLErr
|
288
283
|
|
289
284
|
# OGR datasets. Not found in v1.11.1
|
290
|
-
attach_function :GDALDatasetGetLayerCount, [:GDALDatasetH], :int
|
291
|
-
attach_function :GDALDatasetGetLayer, [:GDALDatasetH, :int], :OGRLayerH
|
292
|
-
attach_function :GDALDatasetGetLayerByName, [:GDALDatasetH, :string], :OGRLayerH
|
293
|
-
attach_function :GDALDatasetDeleteLayer, [:GDALDatasetH, :int], OGRErr
|
294
|
-
attach_function :GDALDatasetCreateLayer,
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
attach_function :
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
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
|
316
317
|
attach_function :GDALDatasetCopyWholeRaster,
|
317
318
|
%i[GDALDatasetH GDALDatasetH pointer GDALProgressFunc pointer],
|
318
|
-
CPLErr
|
319
|
+
FFI::CPL::Error::CPLErr
|
319
320
|
|
320
|
-
|
321
|
+
# ~~~~~~~~~~~~~~~~~~~
|
321
322
|
# MajorObject
|
322
|
-
|
323
|
+
# ~~~~~~~~~~~~~~~~~~~
|
323
324
|
attach_function :GDALGetMetadataDomainList, [:GDALMajorObjectH], :pointer
|
324
325
|
attach_function :GDALGetMetadata, %i[GDALMajorObjectH string], :pointer
|
325
|
-
attach_function :GDALSetMetadata, %i[GDALMajorObjectH pointer string], CPLErr
|
326
|
+
attach_function :GDALSetMetadata, %i[GDALMajorObjectH pointer string], FFI::CPL::Error::CPLErr
|
326
327
|
attach_function :GDALGetMetadataItem,
|
327
328
|
%i[GDALMajorObjectH string string],
|
328
329
|
:string
|
329
330
|
attach_function :GDALSetMetadataItem,
|
330
331
|
%i[GDALMajorObjectH string string string],
|
331
|
-
CPLErr
|
332
|
+
FFI::CPL::Error::CPLErr
|
332
333
|
attach_function :GDALGetDescription, [:GDALMajorObjectH], :string
|
333
334
|
attach_function :GDALSetDescription, %i[GDALMajorObjectH string], :void
|
334
335
|
|
335
|
-
|
336
|
+
# ~~~~~~~~~~~~~~~~~~~
|
336
337
|
# GeoTransform
|
337
|
-
|
338
|
+
# ~~~~~~~~~~~~~~~~~~~
|
338
339
|
attach_function :GDALInvGeoTransform, %i[pointer pointer], :int
|
339
340
|
attach_function :GDALApplyGeoTransform,
|
340
341
|
%i[pointer double double pointer pointer],
|
@@ -343,36 +344,36 @@ module FFI
|
|
343
344
|
%i[pointer pointer pointer],
|
344
345
|
:void
|
345
346
|
|
346
|
-
|
347
|
+
# ----------------
|
347
348
|
# Raster functions
|
348
|
-
|
349
|
+
# ----------------
|
349
350
|
attach_function :GDALRasterBandCopyWholeRaster,
|
350
|
-
[
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
], CPLErr
|
351
|
+
%i[
|
352
|
+
GDALRasterBandH
|
353
|
+
GDALRasterBandH
|
354
|
+
pointer
|
355
|
+
GDALProgressFunc
|
356
|
+
pointer
|
357
|
+
], FFI::CPL::Error::CPLErr
|
357
358
|
attach_function :GDALRegenerateOverviews,
|
358
|
-
[
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
], CPLErr
|
359
|
+
%i[
|
360
|
+
GDALRasterBandH
|
361
|
+
int
|
362
|
+
pointer
|
363
|
+
string
|
364
|
+
GDALProgressFunc
|
365
|
+
pointer
|
366
|
+
], FFI::CPL::Error::CPLErr
|
366
367
|
attach_function :GDALGetMaskBand, [:GDALRasterBandH], :GDALRasterBandH
|
367
368
|
attach_function :GDALGetMaskFlags, [:GDALRasterBandH], :int
|
368
369
|
attach_function :GDALCreateMaskBand,
|
369
|
-
[
|
370
|
-
CPLErr
|
370
|
+
%i[GDALRasterBandH int],
|
371
|
+
FFI::CPL::Error::CPLErr
|
371
372
|
|
372
|
-
attach_function :GDALGetRasterDataType, [:GDALRasterBandH],
|
373
|
+
attach_function :GDALGetRasterDataType, [:GDALRasterBandH], DataType
|
373
374
|
attach_function :GDALGetBlockSize,
|
374
|
-
[
|
375
|
-
|
375
|
+
%i[GDALRasterBandH pointer pointer],
|
376
|
+
DataType
|
376
377
|
|
377
378
|
attach_function :GDALRasterAdviseRead,
|
378
379
|
[
|
@@ -383,14 +384,14 @@ module FFI
|
|
383
384
|
:int,
|
384
385
|
:int,
|
385
386
|
:int,
|
386
|
-
|
387
|
+
DataType,
|
387
388
|
:pointer
|
388
|
-
], CPLErr
|
389
|
+
], FFI::CPL::Error::CPLErr
|
389
390
|
|
390
391
|
attach_function :GDALRasterIO,
|
391
392
|
[
|
392
393
|
:GDALRasterBandH,
|
393
|
-
|
394
|
+
RWFlag,
|
394
395
|
:int,
|
395
396
|
:int,
|
396
397
|
:int,
|
@@ -398,138 +399,138 @@ module FFI
|
|
398
399
|
:pointer,
|
399
400
|
:int,
|
400
401
|
:int,
|
401
|
-
|
402
|
+
DataType,
|
402
403
|
:int,
|
403
404
|
:int
|
404
|
-
], CPLErr
|
405
|
+
], FFI::CPL::Error::CPLErr
|
405
406
|
attach_function :GDALReadBlock,
|
406
|
-
[
|
407
|
-
CPLErr
|
407
|
+
%i[GDALRasterBandH int int pointer],
|
408
|
+
FFI::CPL::Error::CPLErr
|
408
409
|
attach_function :GDALWriteBlock,
|
409
|
-
[
|
410
|
-
CPLErr
|
410
|
+
%i[GDALRasterBandH int int pointer],
|
411
|
+
FFI::CPL::Error::CPLErr
|
411
412
|
attach_function :GDALGetRasterBandXSize, [:GDALRasterBandH], :int
|
412
413
|
attach_function :GDALGetRasterBandYSize, [:GDALRasterBandH], :int
|
413
|
-
attach_function :GDALGetRasterAccess, [:GDALRasterBandH],
|
414
|
+
attach_function :GDALGetRasterAccess, [:GDALRasterBandH], Access
|
414
415
|
attach_function :GDALGetBandNumber, [:GDALRasterBandH], :int
|
415
416
|
attach_function :GDALGetBandDataset, [:GDALRasterBandH], :GDALDatasetH
|
416
417
|
attach_function :GDALGetRasterColorInterpretation,
|
417
418
|
[:GDALRasterBandH],
|
418
|
-
|
419
|
+
ColorInterp
|
419
420
|
attach_function :GDALSetRasterColorInterpretation,
|
420
|
-
[:GDALRasterBandH,
|
421
|
-
CPLErr
|
421
|
+
[:GDALRasterBandH, ColorInterp],
|
422
|
+
FFI::CPL::Error::CPLErr
|
422
423
|
attach_function :GDALGetRasterColorTable,
|
423
424
|
[:GDALRasterBandH],
|
424
425
|
:GDALColorTableH
|
425
426
|
attach_function :GDALSetRasterColorTable,
|
426
|
-
[
|
427
|
-
CPLErr
|
427
|
+
%i[GDALRasterBandH GDALColorTableH],
|
428
|
+
FFI::CPL::Error::CPLErr
|
428
429
|
|
429
430
|
attach_function :GDALHasArbitraryOverviews, [:GDALRasterBandH], :int
|
430
431
|
attach_function :GDALGetOverviewCount, [:GDALRasterBandH], :int
|
431
|
-
attach_function :GDALGetOverview, [
|
432
|
+
attach_function :GDALGetOverview, %i[GDALRasterBandH int], :GDALRasterBandH
|
432
433
|
attach_function :GDALGetRasterNoDataValue,
|
433
|
-
[
|
434
|
+
%i[GDALRasterBandH pointer],
|
434
435
|
:double
|
435
436
|
attach_function :GDALSetRasterNoDataValue,
|
436
|
-
[
|
437
|
-
CPLErr
|
437
|
+
%i[GDALRasterBandH double],
|
438
|
+
FFI::CPL::Error::CPLErr
|
438
439
|
attach_function :GDALGetRasterCategoryNames,
|
439
440
|
[:GDALRasterBandH],
|
440
441
|
:pointer
|
441
442
|
attach_function :GDALSetRasterCategoryNames,
|
442
|
-
[
|
443
|
-
CPLErr
|
443
|
+
%i[GDALRasterBandH pointer],
|
444
|
+
FFI::CPL::Error::CPLErr
|
444
445
|
attach_function :GDALGetRasterMinimum,
|
445
|
-
[
|
446
|
+
%i[GDALRasterBandH pointer],
|
446
447
|
:double
|
447
448
|
attach_function :GDALGetRasterMaximum,
|
448
|
-
[
|
449
|
+
%i[GDALRasterBandH pointer],
|
449
450
|
:double
|
450
451
|
attach_function :GDALGetRasterStatistics,
|
451
|
-
[
|
452
|
-
CPLErr
|
452
|
+
%i[GDALRasterBandH bool bool pointer pointer pointer pointer],
|
453
|
+
FFI::CPL::Error::CPLErr
|
453
454
|
attach_function :GDALComputeRasterStatistics,
|
454
|
-
[
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
], CPLErr
|
455
|
+
%i[
|
456
|
+
GDALRasterBandH
|
457
|
+
bool
|
458
|
+
pointer
|
459
|
+
pointer
|
460
|
+
pointer
|
461
|
+
pointer
|
462
|
+
GDALProgressFunc
|
463
|
+
pointer
|
464
|
+
], FFI::CPL::Error::CPLErr
|
464
465
|
attach_function :GDALSetRasterStatistics,
|
465
|
-
[
|
466
|
-
CPLErr
|
466
|
+
%i[GDALRasterBandH double double double double],
|
467
|
+
FFI::CPL::Error::CPLErr
|
467
468
|
attach_function :GDALGetRasterUnitType, [:GDALRasterBandH], :string
|
468
|
-
attach_function :GDALSetRasterUnitType, [
|
469
|
-
attach_function :GDALGetRasterOffset, [
|
470
|
-
attach_function :GDALSetRasterOffset, [
|
471
|
-
attach_function :GDALGetRasterScale, [
|
472
|
-
attach_function :GDALSetRasterScale, [
|
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
|
473
474
|
attach_function :GDALComputeRasterMinMax,
|
474
|
-
[
|
475
|
+
%i[GDALRasterBandH bool pointer],
|
475
476
|
:void
|
476
|
-
attach_function :GDALFlushRasterCache, [:GDALRasterBandH], CPLErr
|
477
|
+
attach_function :GDALFlushRasterCache, [:GDALRasterBandH], FFI::CPL::Error::CPLErr
|
477
478
|
attach_function :GDALGetRasterHistogram,
|
478
|
-
[
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
], CPLErr
|
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
|
489
490
|
|
490
491
|
attach_function :GDALGetDefaultHistogram,
|
491
|
-
[
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
], CPLErr
|
492
|
+
%i[
|
493
|
+
GDALRasterBandH
|
494
|
+
pointer
|
495
|
+
pointer
|
496
|
+
pointer
|
497
|
+
pointer
|
498
|
+
bool
|
499
|
+
GDALProgressFunc
|
500
|
+
pointer
|
501
|
+
], FFI::CPL::Error::CPLErr
|
501
502
|
attach_function :GDALSetDefaultHistogram,
|
502
|
-
[
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
], CPLErr
|
503
|
+
%i[
|
504
|
+
GDALRasterBandH
|
505
|
+
double
|
506
|
+
double
|
507
|
+
int
|
508
|
+
pointer
|
509
|
+
], FFI::CPL::Error::CPLErr
|
509
510
|
|
510
511
|
attach_function :GDALGetRandomRasterSample,
|
511
|
-
[
|
512
|
+
%i[GDALRasterBandH int pointer],
|
512
513
|
:int
|
513
514
|
attach_function :GDALGetRasterSampleOverview,
|
514
|
-
[
|
515
|
+
%i[GDALRasterBandH int],
|
515
516
|
:GDALRasterBandH
|
516
517
|
attach_function :GDALFillRaster,
|
517
|
-
[
|
518
|
-
CPLErr
|
518
|
+
%i[GDALRasterBandH double double],
|
519
|
+
FFI::CPL::Error::CPLErr
|
519
520
|
|
520
521
|
attach_function :GDALGetDefaultRAT,
|
521
522
|
[:GDALRasterBandH],
|
522
523
|
:GDALRasterAttributeTableH
|
523
524
|
attach_function :GDALSetDefaultRAT,
|
524
|
-
[
|
525
|
-
CPLErr
|
525
|
+
%i[GDALRasterBandH GDALRasterAttributeTableH],
|
526
|
+
FFI::CPL::Error::CPLErr
|
526
527
|
attach_function :GDALAddDerivedBandPixelFunc,
|
527
|
-
[
|
528
|
-
CPLErr
|
528
|
+
%i[string GDALDerivedPixelFunc],
|
529
|
+
FFI::CPL::Error::CPLErr
|
529
530
|
|
530
|
-
|
531
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
531
532
|
# Raster Attribute Table functions
|
532
|
-
|
533
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
533
534
|
# Class-level functions
|
534
535
|
attach_function :GDALCreateRasterAttributeTable,
|
535
536
|
[],
|
@@ -550,20 +551,20 @@ module FFI
|
|
550
551
|
[:GDALRasterAttributeTableH],
|
551
552
|
:int
|
552
553
|
attach_function :GDALRATGetNameOfCol,
|
553
|
-
[
|
554
|
+
%i[GDALRasterAttributeTableH int],
|
554
555
|
:string
|
555
556
|
attach_function :GDALRATGetUsageOfCol,
|
556
|
-
[
|
557
|
-
|
557
|
+
%i[GDALRasterAttributeTableH int],
|
558
|
+
RATFieldUsage
|
558
559
|
attach_function :GDALRATGetTypeOfCol,
|
559
|
-
[
|
560
|
-
|
560
|
+
%i[GDALRasterAttributeTableH int],
|
561
|
+
RATFieldType
|
561
562
|
attach_function :GDALRATGetColOfUsage,
|
562
|
-
[:GDALRasterAttributeTableH,
|
563
|
+
[:GDALRasterAttributeTableH, RATFieldUsage],
|
563
564
|
:int
|
564
565
|
attach_function :GDALRATCreateColumn,
|
565
|
-
[:GDALRasterAttributeTableH, :string,
|
566
|
-
CPLErr
|
566
|
+
[:GDALRasterAttributeTableH, :string, RATFieldType, RATFieldUsage],
|
567
|
+
FFI::CPL::Error::CPLErr
|
567
568
|
|
568
569
|
attach_function :GDALRATGetValueAsString,
|
569
570
|
%i[GDALRasterAttributeTableH int int],
|
@@ -584,14 +585,14 @@ module FFI
|
|
584
585
|
%i[GDALRasterAttributeTableH int int double],
|
585
586
|
:void
|
586
587
|
attach_function :GDALRATValuesIOAsDouble,
|
587
|
-
[:GDALRasterAttributeTableH,
|
588
|
-
CPLErr
|
588
|
+
[:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
|
589
|
+
FFI::CPL::Error::CPLErr
|
589
590
|
attach_function :GDALRATValuesIOAsInteger,
|
590
|
-
[:GDALRasterAttributeTableH,
|
591
|
-
CPLErr
|
591
|
+
[:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
|
592
|
+
FFI::CPL::Error::CPLErr
|
592
593
|
attach_function :GDALRATValuesIOAsString,
|
593
|
-
[:GDALRasterAttributeTableH,
|
594
|
-
CPLErr
|
594
|
+
[:GDALRasterAttributeTableH, RWFlag, :int, :int, :int, :pointer],
|
595
|
+
FFI::CPL::Error::CPLErr
|
595
596
|
|
596
597
|
attach_function :GDALRATGetRowCount,
|
597
598
|
[:GDALRasterAttributeTableH],
|
@@ -614,52 +615,52 @@ module FFI
|
|
614
615
|
:GDALColorTableH
|
615
616
|
attach_function :GDALRATInitializeFromColorTable,
|
616
617
|
%i[GDALRasterAttributeTableH GDALColorTableH],
|
617
|
-
CPLErr
|
618
|
+
FFI::CPL::Error::CPLErr
|
618
619
|
|
619
620
|
attach_function :GDALRATDumpReadable,
|
620
621
|
%i[GDALRasterAttributeTableH pointer],
|
621
622
|
:void
|
622
623
|
|
623
|
-
|
624
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
624
625
|
# ColorTable functions
|
625
|
-
|
626
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
626
627
|
# Class-level functions
|
627
|
-
attach_function :GDALCreateColorTable, [
|
628
|
+
attach_function :GDALCreateColorTable, [PaletteInterp], :GDALColorTableH
|
628
629
|
|
629
630
|
# Instance-level functions
|
630
631
|
attach_function :GDALDestroyColorTable, [:GDALColorTableH], :void
|
631
632
|
attach_function :GDALCloneColorTable, [:GDALColorTableH], :GDALColorTableH
|
632
633
|
|
633
|
-
attach_function :GDALGetPaletteInterpretation, [:GDALColorTableH],
|
634
|
+
attach_function :GDALGetPaletteInterpretation, [:GDALColorTableH], PaletteInterp
|
634
635
|
attach_function :GDALGetColorEntryCount, [:GDALColorTableH], :int
|
635
|
-
attach_function :GDALGetColorEntry, [
|
636
|
-
attach_function :GDALGetColorEntryAsRGB, [:GDALColorTableH, :int,
|
637
|
-
attach_function :GDALSetColorEntry, [: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
|
638
639
|
|
639
640
|
attach_function :GDALCreateColorRamp,
|
640
|
-
[:GDALColorTableH, :int,
|
641
|
+
[:GDALColorTableH, :int, FFI::GDAL::ColorEntry.ptr, :int, FFI::GDAL::ColorEntry.ptr],
|
641
642
|
:void
|
642
643
|
|
643
|
-
|
644
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
644
645
|
# PaletteInterp functions
|
645
|
-
|
646
|
-
attach_function :GDALGetPaletteInterpretationName, [
|
646
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
647
|
+
attach_function :GDALGetPaletteInterpretationName, [PaletteInterp], :string
|
647
648
|
|
648
|
-
|
649
|
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
649
650
|
# General stuff
|
650
|
-
|
651
|
-
attach_function :GDALGetDataTypeSize, [
|
652
|
-
attach_function :GDALDataTypeIsComplex, [
|
653
|
-
attach_function :GDALGetDataTypeName, [
|
654
|
-
attach_function :GDALGetDataTypeByName, [:string],
|
655
|
-
attach_function :GDALDataTypeUnion, [
|
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
|
656
657
|
|
657
658
|
attach_function :GDALSetCacheMax, %i[int], :void
|
658
|
-
attach_function :GDALSetCacheMax64,
|
659
|
+
attach_function :GDALSetCacheMax64, [CPL::Port.find_type(:GIntBig)], :void
|
659
660
|
attach_function :GDALGetCacheMax, [], :int
|
660
|
-
attach_function :GDALGetCacheMax64, [], :GIntBig
|
661
|
+
attach_function :GDALGetCacheMax64, [], CPL::Port.find_type(:GIntBig)
|
661
662
|
attach_function :GDALGetCacheUsed, [], :int
|
662
|
-
attach_function :GDALGetCacheUsed64, [], :GIntBig
|
663
|
+
attach_function :GDALGetCacheUsed64, [], CPL::Port.find_type(:GIntBig)
|
663
664
|
attach_function :GDALFlushCacheBlock, [], :bool
|
664
665
|
|
665
666
|
attach_function :GDALLoadWorldFile, %i[string pointer], :bool
|