ffi-gdal 0.0.4 → 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -1
  3. data/Rakefile +12 -1
  4. data/TODO.md +11 -0
  5. data/ffi-gdal.gemspec +2 -2
  6. data/lib/ext/error_symbols.rb +59 -0
  7. data/lib/ext/float_ext.rb +15 -0
  8. data/lib/ext/narray_ext.rb +16 -0
  9. data/lib/ext/to_bool.rb +2 -0
  10. data/lib/ffi-gdal.rb +139 -4
  11. data/lib/ffi/{gdal/cpl_conv.rb → cpl/conv_h.rb} +2 -3
  12. data/lib/ffi/{gdal/cpl_error.rb → cpl/error_h.rb} +1 -25
  13. data/lib/ffi/cpl/minixml_h.rb +14 -0
  14. data/lib/ffi/{gdal/cpl_string.rb → cpl/string_h.rb} +0 -25
  15. data/lib/ffi/{gdal/cpl_vsi.rb → cpl/vsi_h.rb} +0 -0
  16. data/lib/ffi/cpl/xml_node.rb +13 -0
  17. data/lib/ffi/gdal.rb +57 -593
  18. data/lib/ffi/gdal/alg_h.rb +127 -0
  19. data/lib/ffi/gdal/gdal_grid_data_metrics_options.rb +14 -0
  20. data/lib/ffi/gdal/gdal_grid_inverse_distance_to_a_power_options.rb +19 -0
  21. data/lib/ffi/gdal/gdal_grid_moving_average_options.rb +14 -0
  22. data/lib/ffi/gdal/gdal_grid_nearest_neighbor_options.rb +13 -0
  23. data/lib/ffi/gdal/gdal_h.rb +683 -0
  24. data/lib/ffi/gdal/gdal_rpc_info.rb +27 -0
  25. data/lib/ffi/gdal/gdal_transformer_info.rb +14 -0
  26. data/lib/ffi/gdal/gdal_warp_options.rb +43 -0
  27. data/lib/ffi/gdal/grid_h.rb +51 -0
  28. data/lib/ffi/gdal/version.rb +1 -1
  29. data/lib/ffi/gdal/warper_h.rb +48 -0
  30. data/lib/ffi/ogr.rb +12 -0
  31. data/lib/ffi/ogr/api_h.rb +553 -0
  32. data/lib/ffi/ogr/core_h.rb +148 -0
  33. data/lib/ffi/ogr/featurestyle_h.rb +22 -0
  34. data/lib/ffi/ogr/geocoding_h.rb +21 -0
  35. data/lib/ffi/ogr/ogr_contour_writer_info.rb +14 -0
  36. data/lib/ffi/ogr/ogr_envelope.rb +12 -0
  37. data/lib/ffi/ogr/ogr_envelope_3d.rb +14 -0
  38. data/lib/ffi/ogr/ogr_field.rb +50 -0
  39. data/lib/ffi/ogr/ogr_style_param.rb +12 -0
  40. data/lib/ffi/ogr/ogr_style_value.rb +13 -0
  41. data/lib/ffi/ogr/srs_api_h.rb +325 -0
  42. data/lib/gdal/color_entry.rb +47 -0
  43. data/lib/gdal/color_entry_extensions.rb +30 -0
  44. data/lib/gdal/color_interpretation.rb +15 -0
  45. data/lib/gdal/color_table.rb +146 -0
  46. data/lib/gdal/color_table_extensions.rb +47 -0
  47. data/lib/gdal/color_table_types/cmyk.rb +25 -0
  48. data/lib/gdal/color_table_types/gray.rb +9 -0
  49. data/lib/gdal/color_table_types/hls.rb +21 -0
  50. data/lib/gdal/color_table_types/rgb.rb +25 -0
  51. data/lib/gdal/data_type.rb +38 -0
  52. data/lib/gdal/dataset.rb +437 -0
  53. data/lib/gdal/dataset_extensions.rb +496 -0
  54. data/lib/gdal/driver.rb +244 -0
  55. data/lib/gdal/driver_extensions.rb +56 -0
  56. data/lib/gdal/environment_methods.rb +43 -0
  57. data/lib/{ffi-gdal → gdal}/exceptions.rb +4 -1
  58. data/lib/gdal/geo_transform.rb +188 -0
  59. data/lib/gdal/geo_transform_extensions.rb +90 -0
  60. data/lib/gdal/logger.rb +7 -0
  61. data/lib/{ffi-gdal → gdal}/major_object.rb +15 -14
  62. data/lib/gdal/options.rb +49 -0
  63. data/lib/gdal/raster_attribute_table.rb +185 -0
  64. data/lib/gdal/raster_attribute_table_extensions.rb +40 -0
  65. data/lib/{ffi-gdal → gdal}/raster_band.rb +227 -99
  66. data/lib/gdal/raster_band_extensions.rb +198 -0
  67. data/lib/{ffi-gdal → gdal}/version_info.rb +8 -0
  68. data/lib/gdal/warp_operation.rb +96 -0
  69. data/lib/ogr/coordinate_transformation.rb +108 -0
  70. data/lib/ogr/data_source.rb +172 -0
  71. data/lib/ogr/data_source_extensions.rb +32 -0
  72. data/lib/ogr/driver.rb +119 -0
  73. data/lib/ogr/envelope.rb +80 -0
  74. data/lib/ogr/envelope_extensions.rb +92 -0
  75. data/lib/ogr/exceptions.rb +35 -0
  76. data/lib/ogr/feature.rb +212 -0
  77. data/lib/ogr/feature_definition.rb +120 -0
  78. data/lib/ogr/feature_definition_extensions.rb +36 -0
  79. data/lib/ogr/feature_extensions.rb +31 -0
  80. data/lib/ogr/field.rb +91 -0
  81. data/lib/ogr/field_extensions.rb +23 -0
  82. data/lib/ogr/geocoding_session.rb +84 -0
  83. data/lib/ogr/geometry.rb +617 -0
  84. data/lib/ogr/geometry_extensions.rb +60 -0
  85. data/lib/ogr/geometry_types/collection.rb +45 -0
  86. data/lib/ogr/geometry_types/curve.rb +120 -0
  87. data/lib/ogr/geometry_types/surface.rb +20 -0
  88. data/lib/ogr/layer.rb +226 -0
  89. data/lib/ogr/layer_extensions.rb +55 -0
  90. data/lib/ogr/line_string.rb +7 -0
  91. data/lib/ogr/linear_ring.rb +6 -0
  92. data/lib/ogr/multi_line_string.rb +9 -0
  93. data/lib/ogr/multi_point.rb +7 -0
  94. data/lib/ogr/multi_polygon.rb +14 -0
  95. data/lib/ogr/point.rb +89 -0
  96. data/lib/ogr/polygon.rb +9 -0
  97. data/lib/ogr/spatial_reference.rb +723 -0
  98. data/lib/ogr/spatial_reference_extensions.rb +32 -0
  99. data/lib/ogr/style_table.rb +17 -0
  100. data/lib/ogr/style_table_extensions.rb +16 -0
  101. data/spec/{ffi-gdal/integration → integration}/color_table_info_spec.rb +1 -1
  102. data/spec/{ffi-gdal/integration → integration}/dataset_info_spec.rb +0 -0
  103. data/spec/{ffi-gdal/integration → integration}/driver_info_spec.rb +1 -1
  104. data/spec/{ffi-gdal/integration → integration}/geo_transform_info_spec.rb +0 -0
  105. data/spec/{ffi-gdal/integration → integration}/raster_attribute_table_info_spec.rb +1 -1
  106. data/spec/{ffi-gdal/integration → integration}/raster_band_info_spec.rb +5 -5
  107. data/spec/spec_helper.rb +4 -1
  108. data/spec/support/shapefiles/states_21basic/states.prj +1 -0
  109. data/spec/support/shapefiles/states_21basic/states.sbn +0 -0
  110. data/spec/support/shapefiles/states_21basic/states.sbx +0 -0
  111. data/spec/support/shapefiles/states_21basic/states.shp +0 -0
  112. data/spec/support/worldfiles/SR_50M/SR_50M.VERSION.txt +1 -0
  113. data/spec/support/worldfiles/SR_50M/SR_50M.prj +1 -0
  114. data/spec/support/worldfiles/SR_50M/SR_50M.tfw +6 -0
  115. data/spec/{ext/cpl_error_symbols_spec.rb → unit/ext/error_symbols_spec.rb} +1 -1
  116. data/spec/unit/gdal/color_table_spec.rb +146 -0
  117. data/spec/unit/ogr/layer_spec.rb +97 -0
  118. data/spec/unit/ogr/linear_ring_spec.rb +111 -0
  119. data/spec/unit/ogr/point_spec.rb +321 -0
  120. data/spec/{ffi-gdal/unit → unit}/version_info_spec.rb +1 -1
  121. data/testing_gdal.rb +168 -0
  122. data/testing_gdalwarp.rb +91 -0
  123. data/testing_layer_to_layer.rb +35 -0
  124. data/testing_ndvi.rb +76 -0
  125. data/testing_nir.rb +77 -0
  126. data/testing_ogr.rb +63 -0
  127. metadata +167 -59
  128. data/lib/ext/cpl_error_symbols.rb +0 -37
  129. data/lib/ffi-gdal/color_table.rb +0 -59
  130. data/lib/ffi-gdal/dataset.rb +0 -359
  131. data/lib/ffi-gdal/driver.rb +0 -151
  132. data/lib/ffi-gdal/geo_transform.rb +0 -137
  133. data/lib/ffi-gdal/raster_attribute_table.rb +0 -78
  134. data/lib/ffi/gdal/ogr_api.rb +0 -21
  135. data/lib/ffi/gdal/ogr_core.rb +0 -195
  136. data/lib/ffi/gdal/ogr_srs_api.rb +0 -44
  137. data/meow.rb +0 -144
  138. data/rubby.rb +0 -224
@@ -0,0 +1,27 @@
1
+ require 'ffi'
2
+
3
+
4
+ module FFI
5
+ module GDAL
6
+ class GDALRPCInfo < FFI::Struct
7
+ layout :line_off, :double,
8
+ :samp_off, :double,
9
+ :lat_off, :double,
10
+ :long_off, :double,
11
+ :height_off, :double,
12
+ :line_scale, :double,
13
+ :samp_scale, :double,
14
+ :lat_scale, :double,
15
+ :long_scale, :double,
16
+ :height_scale, :double,
17
+ :line_num_coeff, [:double, 20],
18
+ :line_den_coeff, [:double, 20],
19
+ :samp_num_coeff, [:double, 20],
20
+ :samp_den_coeff, [:double, 20],
21
+ :min_long, :double,
22
+ :min_lat, :double,
23
+ :max_long, :double,
24
+ :max_at, :double
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,14 @@
1
+ require 'ffi'
2
+
3
+
4
+ module FFI
5
+ module GDAL
6
+ class GDALTransformerInfo < FFI::Struct
7
+ layout :signature, :string,
8
+ :class_name, :string,
9
+ :transform, :GDALTransformerFunc,
10
+ :cleanup, :pointer,
11
+ :serialize, :pointer
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,43 @@
1
+ require 'ffi'
2
+
3
+ module FFI
4
+ module GDAL
5
+ class GDALWarpOptions < FFI::Struct
6
+ layout :warp_options, :pointer,
7
+ :warp_memory_limit, :double,
8
+ :resample_alg, FFI::GDAL::GDALResampleAlg,
9
+ :working_data_type, FFI::GDAL::GDALDataType,
10
+ :source_dataset, :GDALDatasetH,
11
+ :destination_dataset, :GDALDatasetH,
12
+ :band_count, :int,
13
+ :source_bands, :pointer,
14
+ :destination_bands, :pointer,
15
+ :source_alpha_band, :int,
16
+ :destination_alpha_band, :int,
17
+ :source_no_data_real, :pointer,
18
+ :source_no_data_imaginary, :pointer,
19
+ :destination_no_data_real, :pointer,
20
+ :destination_no_data_imaginary, :pointer,
21
+ :progress, :GDALProgressFunc,
22
+ :progress_arg, :pointer,
23
+ :transformer, :GDALTransformerFunc,
24
+ :transformer_arg, :pointer,
25
+ :source_per_band_validity_mask_function, :pointer,
26
+ :source_per_band_validity_mask_function_arg, :pointer,
27
+ :source_validity_mask_function, :pointer,
28
+ :source_validity_mask_function_arg, :pointer,
29
+ :source_density_mask_function, :pointer,
30
+ :source_density_mask_function_arg, :pointer,
31
+ :destination_density_mask_function, :pointer,
32
+ :destination_density_mask_function_arg, :pointer,
33
+ :destination_validity_mask_function, :pointer,
34
+ :destination_validity_mask_function_arg, :pointer,
35
+ :pre_warp_chunk_processor, :pointer,
36
+ :pre_warp_processor_arg, :pointer,
37
+ :post_warp_chunk_processor, :pointer,
38
+ :post_warp_processor_arg, :pointer,
39
+ :cutline, :pointer,
40
+ :cutline_blend_distance, :double
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,51 @@
1
+ module FFI
2
+ module GDAL
3
+
4
+ #------------------------------------------------------------------------
5
+ # Typedefs
6
+ #------------------------------------------------------------------------
7
+ callback :GDALGridFunction,
8
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
9
+ CPLErr
10
+
11
+ #------------------------------------------------------------------------
12
+ # Functions
13
+ #------------------------------------------------------------------------
14
+ attach_function :GDALGridInverseDistanceToAPower,
15
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
16
+ CPLErr
17
+ # attach_function :GDALGridInverseDistanceToAPointerNoSearch,
18
+ # %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
19
+ # CPLErr
20
+
21
+ attach_function :GDALGridMovingAverage,
22
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
23
+ CPLErr
24
+
25
+ attach_function :GDALGridNearestNeighbor,
26
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
27
+ CPLErr
28
+
29
+ attach_function :GDALGridDataMetricMinimum,
30
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
31
+ CPLErr
32
+ attach_function :GDALGridDataMetricMaximum,
33
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
34
+ CPLErr
35
+ attach_function :GDALGridDataMetricRange,
36
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
37
+ CPLErr
38
+ attach_function :GDALGridDataMetricCount,
39
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
40
+ CPLErr
41
+ attach_function :GDALGridDataMetricAverageDistance,
42
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
43
+ CPLErr
44
+ attach_function :GDALGridDataMetricAverageDistancePts,
45
+ %i[pointer GUInt32 pointer pointer pointer double double pointer pointer],
46
+ CPLErr
47
+ attach_function :ParseAlgorithmAndOptions,
48
+ [:string, GDALGridAlgorithm, :pointer],
49
+ CPLErr
50
+ end
51
+ end
@@ -1,5 +1,5 @@
1
1
  module FFI
2
2
  module GDAL
3
- VERSION = '0.0.4'
3
+ VERSION = '1.0.0.beta1'
4
4
  end
5
5
  end
@@ -0,0 +1,48 @@
1
+ module FFI
2
+ module GDAL
3
+ #------------------------------------------------------------------------
4
+ # Typedefs
5
+ #------------------------------------------------------------------------
6
+ typedef :pointer, :GDALWarpOperationH
7
+ callback :GDALMaskFunc,
8
+ [:pointer, :int, FFI::GDAL::GDALDataType, :int, :int, :int, :int, :pointer, :int, :pointer],
9
+ :pointer
10
+
11
+ #------------------------------------------------------------------------
12
+ # Enums
13
+ #------------------------------------------------------------------------
14
+ GDALResampleAlg = enum :GRA_NearestNeighbor, 0,
15
+ :GRA_Bilinear, 1,
16
+ :GRA_Cubic, 2,
17
+ :GRA_CubicSpline, 3,
18
+ :GRA_Lanczos, 4,
19
+ :GRA_Average, 5,
20
+ :GRA_Mode, 6
21
+
22
+ #------------------------------------------------------------------------
23
+ # Functions
24
+ #------------------------------------------------------------------------
25
+ attach_function :GDALCreateWarpOptions, [], FFI::GDAL::GDALWarpOptions.ptr
26
+ attach_function :GDALSerializeWarpOptions,
27
+ [FFI::GDAL::GDALWarpOptions.ptr],
28
+ FFI::GDAL::CPLXMLNode.ptr
29
+
30
+ attach_function :GDALCreateWarpOperation,
31
+ [FFI::GDAL::GDALWarpOptions.ptr],
32
+ :GDALWarpOperationH
33
+ attach_function :GDALDestroyWarpOperation, [:GDALWarpOperationH], :void
34
+
35
+ attach_function :GDALChunkAndWarpImage,
36
+ %i[GDALWarpOperationH int int int int],
37
+ CPLErr
38
+ attach_function :GDALChunkAndWarpMulti,
39
+ %i[GDALWarpOperationH int int int int],
40
+ CPLErr
41
+ attach_function :GDALWarpRegion,
42
+ %i[GDALWarpOperationH int int int int int int int int],
43
+ CPLErr
44
+ attach_function :GDALWarpRegionToBuffer,
45
+ [:GDALWarpOperationH, :int, :int, :int, :int, :pointer, GDALDataType, :int, :int, :int, :int],
46
+ CPLErr
47
+ end
48
+ end
data/lib/ffi/ogr.rb ADDED
@@ -0,0 +1,12 @@
1
+ require 'ffi'
2
+ require_relative 'gdal'
3
+
4
+ require_relative 'cpl/conv_h'
5
+ require_relative 'cpl/minixml_h'
6
+ require_relative 'ogr/core_h'
7
+ require_relative 'ogr/api_h'
8
+
9
+ # All of these depend on the above
10
+ require_relative 'ogr/srs_api_h'
11
+ require_relative 'ogr/featurestyle_h'
12
+ require_relative 'ogr/geocoding_h'
@@ -0,0 +1,553 @@
1
+ require_relative '../cpl/conv_h'
2
+ require_relative 'core_h'
3
+ require_relative 'ogr_envelope'
4
+ require_relative 'ogr_envelope_3d'
5
+ require_relative 'ogr_field'
6
+ require_relative 'srs_api_h'
7
+
8
+ module FFI
9
+ module GDAL
10
+
11
+ #------------------------------------------------------------------------
12
+ # Typedefs
13
+ #------------------------------------------------------------------------
14
+ typedef :pointer, :OGRGeometryH
15
+ typedef :pointer, :OGRFieldDefnH
16
+ typedef :pointer, :OGRFeatureDefnH
17
+ typedef :pointer, :OGRFeatureH
18
+ typedef :pointer, :OGRStyleTableH
19
+ typedef :pointer, :OGRGeomFieldDefnH
20
+ typedef :pointer, :OGRLayerH
21
+ typedef :pointer, :OGRDataSourceH
22
+ typedef :pointer, :OGRSFDriverH
23
+ typedef :pointer, :OGRStyleMgrH
24
+ typedef :pointer, :OGRStyleToolH
25
+
26
+ #------------------------------------------------------------------------
27
+ # Functions
28
+ #------------------------------------------------------------------------
29
+ attach_function :OGR_G_CreateFromWkb,
30
+ %i[string OGRSpatialReferenceH pointer int],
31
+ OGRErr
32
+ attach_function :OGR_G_CreateFromWkt,
33
+ %i[pointer OGRSpatialReferenceH pointer],
34
+ OGRErr
35
+ attach_function :OGR_G_CreateFromFgf,
36
+ %i[string OGRSpatialReferenceH pointer int pointer],
37
+ OGRErr
38
+
39
+ #~~~~~~~~~~~~~~~~~
40
+ # Geometry-related
41
+ #~~~~~~~~~~~~~~~~~
42
+ attach_function :OGR_G_DestroyGeometry, %i[OGRGeometryH], :void
43
+ attach_function :OGR_G_CreateGeometry, [OGRwkbGeometryType], :OGRGeometryH
44
+ attach_function :OGR_G_ApproximateArcAngles,
45
+ [
46
+ :double, :double, :double, # X, Y, Z
47
+ :double, :double, :double, # primary radius, 2nd Axis, rotation
48
+ :double, :double, :double # start angle, end angle, max angle step size
49
+ ],
50
+ :OGRGeometryH
51
+
52
+ attach_function :OGR_G_ForceToPolygon, %i[OGRGeometryH], :OGRGeometryH
53
+ attach_function :OGR_G_ForceToLineString, %i[OGRGeometryH], :OGRGeometryH
54
+ attach_function :OGR_G_ForceToMultiPolygon, %i[OGRGeometryH], :OGRGeometryH
55
+ attach_function :OGR_G_ForceToMultiPoint, %i[OGRGeometryH], :OGRGeometryH
56
+ attach_function :OGR_G_ForceToMultiLineString, %i[OGRGeometryH], :OGRGeometryH
57
+
58
+ attach_function :OGR_G_GetDimension, %i[OGRGeometryH], :int
59
+ attach_function :OGR_G_GetCoordinateDimension, %i[OGRGeometryH], :int
60
+ attach_function :OGR_G_SetCoordinateDimension, %i[OGRGeometryH int], :void
61
+ attach_function :OGR_G_Clone, %i[OGRGeometryH], :OGRGeometryH
62
+ attach_function :OGR_G_GetEnvelope,
63
+ [:OGRGeometryH, OGREnvelope.ptr],
64
+ :void
65
+ attach_function :OGR_G_GetEnvelope3D,
66
+ [:OGRGeometryH, OGREnvelope3D.ptr],
67
+ :void
68
+
69
+ attach_function :OGR_G_ImportFromWkb,
70
+ %i[OGRGeometryH string int],
71
+ OGRErr
72
+ attach_function :OGR_G_ExportToWkb,
73
+ [:OGRGeometryH, OGRwkbByteOrder, :buffer_out],
74
+ OGRErr
75
+ attach_function :OGR_G_WkbSize, %i[OGRGeometryH], :int
76
+
77
+ attach_function :OGR_G_ImportFromWkt, %i[OGRGeometryH pointer], OGRErr
78
+ attach_function :OGR_G_ExportToWkt, %i[OGRGeometryH pointer], OGRErr
79
+
80
+ attach_function :OGR_G_GetGeometryType, %i[OGRGeometryH], OGRwkbGeometryType
81
+ attach_function :OGR_G_GetGeometryName, %i[OGRGeometryH], :string
82
+ attach_function :OGR_G_DumpReadable,
83
+ %i[OGRGeometryH string string],
84
+ :void
85
+ attach_function :OGR_G_FlattenTo2D, %i[OGRGeometryH], :void
86
+ attach_function :OGR_G_CloseRings, %i[OGRGeometryH], :void
87
+
88
+ attach_function :OGR_G_CreateFromGML, %i[string], :OGRGeometryH
89
+ attach_function :OGR_G_ExportToGML, %i[OGRGeometryH], :string
90
+ attach_function :OGR_G_ExportToGMLEx, %i[OGRGeometryH pointer], :string
91
+ attach_function :OGR_G_CreateFromGMLTree,
92
+ [FFI::GDAL::CPLXMLNode.ptr],
93
+ :OGRGeometryH
94
+ attach_function :OGR_G_ExportToGMLTree,
95
+ %i[OGRGeometryH],
96
+ FFI::GDAL::CPLXMLNode.ptr
97
+ attach_function :OGR_G_ExportEnvelopeToGMLTree,
98
+ %i[OGRGeometryH],
99
+ FFI::GDAL::CPLXMLNode.ptr
100
+
101
+ attach_function :OGR_G_ExportToKML, %i[OGRGeometryH string], :string
102
+ attach_function :OGR_G_ExportToJson, %i[OGRGeometryH], :string
103
+ attach_function :OGR_G_ExportToJsonEx, %i[OGRGeometryH string], :string
104
+ attach_function :OGR_G_CreateGeometryFromJson, %i[string], :OGRGeometryH
105
+
106
+ attach_function :OGR_G_AssignSpatialReference,
107
+ %i[OGRGeometryH OGRSpatialReferenceH],
108
+ :void
109
+ attach_function :OGR_G_GetSpatialReference,
110
+ %i[OGRGeometryH],
111
+ :OGRSpatialReferenceH
112
+
113
+ attach_function :OGR_G_Transform,
114
+ %i[OGRGeometryH OGRCoordinateTransformationH],
115
+ OGRErr
116
+ attach_function :OGR_G_TransformTo,
117
+ %i[OGRGeometryH OGRSpatialReferenceH],
118
+ OGRErr
119
+ attach_function :OGR_G_Simplify, %i[OGRGeometryH double], :OGRGeometryH
120
+ attach_function :OGR_G_SimplifyPreserveTopology,
121
+ %i[OGRGeometryH double],
122
+ :OGRGeometryH
123
+ attach_function :OGR_G_Segmentize, %i[OGRGeometryH double], :void
124
+ attach_function :OGR_G_Intersects, %i[OGRGeometryH OGRGeometryH], :bool
125
+ attach_function :OGR_G_Equals, %i[OGRGeometryH OGRGeometryH], :bool
126
+ attach_function :OGR_G_Disjoint, %i[OGRGeometryH OGRGeometryH], :bool
127
+ attach_function :OGR_G_Touches, %i[OGRGeometryH OGRGeometryH], :bool
128
+ attach_function :OGR_G_Crosses, %i[OGRGeometryH OGRGeometryH], :bool
129
+ attach_function :OGR_G_Within, %i[OGRGeometryH OGRGeometryH], :bool
130
+ attach_function :OGR_G_Contains, %i[OGRGeometryH OGRGeometryH], :bool
131
+ attach_function :OGR_G_Overlaps, %i[OGRGeometryH OGRGeometryH], :bool
132
+
133
+ attach_function :OGR_G_Boundary, %i[OGRGeometryH], :OGRGeometryH
134
+ attach_function :OGR_G_ConvexHull, %i[OGRGeometryH], :OGRGeometryH
135
+ attach_function :OGR_G_Buffer, %i[OGRGeometryH double int], :OGRGeometryH
136
+ attach_function :OGR_G_Intersection,
137
+ %i[OGRGeometryH OGRGeometryH],
138
+ :OGRGeometryH
139
+ attach_function :OGR_G_Union,
140
+ %i[OGRGeometryH OGRGeometryH],
141
+ :OGRGeometryH
142
+ attach_function :OGR_G_UnionCascaded, %i[OGRGeometryH], :OGRGeometryH
143
+ attach_function :OGR_G_PointOnSurface, %i[OGRGeometryH], :OGRGeometryH
144
+ attach_function :OGR_G_Difference,
145
+ %i[OGRGeometryH OGRGeometryH],
146
+ :OGRGeometryH
147
+ attach_function :OGR_G_SymDifference,
148
+ %i[OGRGeometryH OGRGeometryH],
149
+ :OGRGeometryH
150
+ attach_function :OGR_G_Distance,
151
+ %i[OGRGeometryH OGRGeometryH],
152
+ :double
153
+ attach_function :OGR_G_Length,
154
+ %i[OGRGeometryH],
155
+ :double
156
+ attach_function :OGR_G_Area,
157
+ %i[OGRGeometryH],
158
+ :double
159
+ attach_function :OGR_G_Centroid,
160
+ %i[OGRGeometryH OGRGeometryH],
161
+ :int
162
+ attach_function :OGR_G_Empty, %i[OGRGeometryH], :void
163
+ attach_function :OGR_G_IsEmpty, %i[OGRGeometryH], :bool
164
+ attach_function :OGR_G_IsValid, %i[OGRGeometryH], :bool
165
+ attach_function :OGR_G_IsSimple, %i[OGRGeometryH], :bool
166
+ attach_function :OGR_G_IsRing, %i[OGRGeometryH], :bool
167
+
168
+ attach_function :OGR_G_Polygonize, %i[OGRGeometryH], :OGRGeometryH
169
+ attach_function :OGR_G_GetPointCount, %i[OGRGeometryH], :int
170
+ attach_function :OGR_G_GetPoints,
171
+ %i[OGRGeometryH buffer_out int buffer_out int buffer_out int],
172
+ :int
173
+ attach_function :OGR_G_GetX, %i[OGRGeometryH int], :double
174
+ attach_function :OGR_G_GetY, %i[OGRGeometryH int], :double
175
+ attach_function :OGR_G_GetZ, %i[OGRGeometryH int], :double
176
+ attach_function :OGR_G_GetPoint,
177
+ %i[OGRGeometryH int pointer pointer pointer],
178
+ :double
179
+ attach_function :OGR_G_SetPointCount,
180
+ %i[OGRGeometryH int],
181
+ :void
182
+ attach_function :OGR_G_SetPoint,
183
+ %i[OGRGeometryH int double double double],
184
+ :void
185
+ attach_function :OGR_G_SetPoint_2D,
186
+ %i[OGRGeometryH int double double],
187
+ :void
188
+ attach_function :OGR_G_AddPoint,
189
+ %i[OGRGeometryH double double double],
190
+ :void
191
+ attach_function :OGR_G_AddPoint_2D,
192
+ %i[OGRGeometryH double double],
193
+ :void
194
+ attach_function :OGR_G_SetPoints,
195
+ %i[OGRGeometryH int pointer int pointer int pointer int],
196
+ :void
197
+
198
+ attach_function :OGR_G_GetGeometryCount, %i[OGRGeometryH], :int
199
+ attach_function :OGR_G_GetGeometryRef, %i[OGRGeometryH int], :OGRGeometryH
200
+
201
+ attach_function :OGR_G_AddGeometry, %i[OGRGeometryH OGRGeometryH], OGRErr
202
+ attach_function :OGR_G_AddGeometryDirectly, %i[OGRGeometryH OGRGeometryH], OGRErr
203
+ attach_function :OGR_G_RemoveGeometry, %i[OGRGeometryH int bool], OGRErr
204
+
205
+ attach_function :OGRBuildPolygonFromEdges,
206
+ %i[OGRGeometryH bool bool double pointer],
207
+ :OGRGeometryH
208
+
209
+ #~~~~~~~~~~~~~~~~~
210
+ # Field-related
211
+ #~~~~~~~~~~~~~~~~~
212
+ attach_function :OGR_Fld_Create, [:string, OGRFieldType], :OGRFieldDefnH
213
+ attach_function :OGR_Fld_Destroy, %i[OGRFieldDefnH], :void
214
+ attach_function :OGR_Fld_SetName, %i[OGRFieldDefnH string], :void
215
+ attach_function :OGR_Fld_GetNameRef, %i[OGRFieldDefnH], :string
216
+ attach_function :OGR_Fld_GetType, %i[OGRFieldDefnH], OGRFieldType
217
+ attach_function :OGR_Fld_SetType, [:OGRFieldDefnH, OGRFieldType], :void
218
+ attach_function :OGR_Fld_GetJustify, %i[OGRFieldDefnH], OGRJustification
219
+ attach_function :OGR_Fld_SetJustify, [:OGRFieldDefnH, OGRJustification], :void
220
+ attach_function :OGR_Fld_GetWidth, %i[OGRFieldDefnH], :int
221
+ attach_function :OGR_Fld_SetWidth, %i[OGRFieldDefnH int], :void
222
+ attach_function :OGR_Fld_GetPrecision, %i[OGRFieldDefnH], :int
223
+ attach_function :OGR_Fld_SetPrecision, %i[OGRFieldDefnH int], :void
224
+
225
+ attach_function :OGR_Fld_Set,
226
+ [:OGRFieldDefnH, :string, OGRFieldType, :int, :int, OGRJustification],
227
+ :void
228
+ attach_function :OGR_Fld_IsIgnored, %i[OGRFieldDefnH], :bool
229
+ attach_function :OGR_Fld_SetIgnored, %i[OGRFieldDefnH bool], :void
230
+
231
+ attach_function :OGR_GetFieldTypeName, [OGRFieldType], :string
232
+
233
+ #~~~~~~~~~~~~~~~~~
234
+ # Geometry Field-related
235
+ #~~~~~~~~~~~~~~~~~
236
+ attach_function :OGR_GFld_Create,
237
+ [:string, OGRwkbGeometryType],
238
+ :OGRGeomFieldDefnH
239
+ attach_function :OGR_GFld_Destroy, %i[OGRGeomFieldDefnH], :void
240
+ attach_function :OGR_GFld_SetName, %i[OGRGeomFieldDefnH string], :void
241
+ attach_function :OGR_GFld_GetNameRef, %i[OGRGeomFieldDefnH], :string
242
+ attach_function :OGR_GFld_GetType, %i[OGRGeomFieldDefnH], OGRwkbGeometryType
243
+ attach_function :OGR_GFld_SetType,
244
+ [:OGRGeomFieldDefnH, OGRwkbGeometryType],
245
+ :void
246
+ attach_function :OGR_GFld_GetSpatialRef,
247
+ %i[OGRGeomFieldDefnH],
248
+ :OGRSpatialReferenceH
249
+ attach_function :OGR_GFld_SetSpatialRef,
250
+ %i[OGRGeomFieldDefnH OGRSpatialReferenceH],
251
+ :void
252
+ attach_function :OGR_GFld_IsIgnored, %i[OGRGeomFieldDefnH], :bool
253
+
254
+ #~~~~~~~~~~~~~~~~~
255
+ # Feature Definition-related
256
+ #~~~~~~~~~~~~~~~~~
257
+ attach_function :OGR_FD_Create, %i[string], :OGRFeatureDefnH
258
+ attach_function :OGR_FD_Destroy, %i[OGRFeatureDefnH], :void
259
+ attach_function :OGR_FD_Release, %i[OGRFeatureDefnH], :void
260
+ attach_function :OGR_FD_GetName, %i[OGRFeatureDefnH], :string
261
+ attach_function :OGR_FD_GetFieldCount, %i[OGRFeatureDefnH], :int
262
+ attach_function :OGR_FD_GetFieldDefn, %i[OGRFeatureDefnH int], :OGRFieldDefnH
263
+ attach_function :OGR_FD_GetFieldIndex, %i[OGRFeatureDefnH string], :int
264
+ attach_function :OGR_FD_AddFieldDefn,
265
+ %i[OGRFeatureDefnH OGRFieldDefnH],
266
+ :void
267
+ attach_function :OGR_FD_DeleteFieldDefn,
268
+ %i[OGRFeatureDefnH int],
269
+ OGRErr
270
+ # attach_function :OGR_FD_ReorderFieldDefns,
271
+ # %i[OGRFeatureDefnH pointer],
272
+ # OGRErr
273
+ attach_function :OGR_FD_GetGeomType, %i[OGRFeatureDefnH], OGRwkbGeometryType
274
+ attach_function :OGR_FD_SetGeomType,
275
+ [:OGRFeatureDefnH, OGRwkbGeometryType],
276
+ :void
277
+ attach_function :OGR_FD_IsGeometryIgnored, %i[OGRFeatureDefnH], :bool
278
+ attach_function :OGR_FD_SetGeometryIgnored, %i[OGRFeatureDefnH bool], :void
279
+ attach_function :OGR_FD_IsStyleIgnored, %i[OGRFeatureDefnH], :bool
280
+ attach_function :OGR_FD_SetStyleIgnored, %i[OGRFeatureDefnH bool], :void
281
+ attach_function :OGR_FD_Reference, %i[OGRFeatureDefnH], :int
282
+ attach_function :OGR_FD_Dereference, %i[OGRFeatureDefnH], :int
283
+ attach_function :OGR_FD_GetReferenceCount, %i[OGRFeatureDefnH], :int
284
+ attach_function :OGR_FD_GetGeomFieldCount, %i[OGRFeatureDefnH], :int
285
+ attach_function :OGR_FD_GetGeomFieldDefn,
286
+ %i[OGRFeatureDefnH int],
287
+ :OGRGeomFieldDefnH
288
+ attach_function :OGR_FD_GetGeomFieldIndex,
289
+ %i[OGRFeatureDefnH string],
290
+ :int
291
+ attach_function :OGR_FD_AddGeomFieldDefn,
292
+ %i[OGRFeatureDefnH OGRGeomFieldDefnH],
293
+ :void
294
+ attach_function :OGR_FD_DeleteGeomFieldDefn,
295
+ %i[OGRFeatureDefnH int],
296
+ OGRErr
297
+
298
+ attach_function :OGR_FD_IsSame,
299
+ %i[OGRFeatureDefnH OGRFeatureDefnH],
300
+ :bool
301
+
302
+ #~~~~~~~~~~~~~~~~~
303
+ # Feature-related
304
+ #~~~~~~~~~~~~~~~~~
305
+ attach_function :OGR_F_Create, %i[OGRFeatureDefnH], :OGRFeatureH
306
+ attach_function :OGR_F_Destroy, %i[OGRFeatureH], :void
307
+ attach_function :OGR_F_GetDefnRef, %i[OGRFeatureH], :OGRFeatureDefnH
308
+ attach_function :OGR_F_SetGeometryDirectly,
309
+ %i[OGRFeatureH OGRGeometryH],
310
+ OGRErr
311
+ attach_function :OGR_F_SetGeometry,
312
+ %i[OGRFeatureH OGRGeometryH],
313
+ OGRErr
314
+ attach_function :OGR_F_GetGeometryRef, %i[OGRFeatureH], :OGRGeometryH
315
+ attach_function :OGR_F_StealGeometry, %i[OGRFeatureH], :OGRGeometryH
316
+
317
+ attach_function :OGR_F_Clone, %i[OGRFeatureH], :OGRFeatureH
318
+ attach_function :OGR_F_Equal, %i[OGRFeatureH OGRFeatureH], :bool
319
+ attach_function :OGR_F_GetFieldCount, %i[OGRFeatureH], :int
320
+ attach_function :OGR_F_GetFieldDefnRef, %i[OGRFeatureH int], :OGRFieldDefnH
321
+ attach_function :OGR_F_GetFieldIndex, %i[OGRFeatureH string], :int
322
+ attach_function :OGR_F_IsFieldSet, %i[OGRFeatureH int], :bool
323
+ attach_function :OGR_F_UnsetField, %i[OGRFeatureH int], :void
324
+ attach_function :OGR_F_GetRawFieldRef, %i[OGRFeatureH int], OGRField.ptr
325
+
326
+ attach_function :OGR_F_GetFieldAsInteger, %i[OGRFeatureH int], :int
327
+ attach_function :OGR_F_GetFieldAsDouble, %i[OGRFeatureH int], :double
328
+ attach_function :OGR_F_GetFieldAsString, %i[OGRFeatureH int], :string
329
+ attach_function :OGR_F_GetFieldAsIntegerList, %i[OGRFeatureH int pointer], :pointer
330
+ attach_function :OGR_F_GetFieldAsDoubleList, %i[OGRFeatureH int pointer], :pointer
331
+ attach_function :OGR_F_GetFieldAsStringList, %i[OGRFeatureH int], :pointer
332
+ attach_function :OGR_F_GetFieldAsBinary, %i[OGRFeatureH int pointer], :pointer
333
+ attach_function :OGR_F_GetFieldAsDateTime,
334
+ %i[OGRFeatureH int pointer pointer pointer pointer pointer pointer pointer],
335
+ :int
336
+ attach_function :OGR_F_SetFieldInteger, %i[OGRFeatureH int int], :void
337
+ attach_function :OGR_F_SetFieldDouble, %i[OGRFeatureH int double], :void
338
+ attach_function :OGR_F_SetFieldString, %i[OGRFeatureH int string], :void
339
+ attach_function :OGR_F_SetFieldIntegerList, %i[OGRFeatureH int int pointer], :void
340
+ attach_function :OGR_F_SetFieldDoubleList, %i[OGRFeatureH int int pointer], :void
341
+ attach_function :OGR_F_SetFieldStringList, %i[OGRFeatureH int pointer], :void
342
+ attach_function :OGR_F_SetFieldRaw, [:OGRFeatureH, :int, OGRField.ptr], :void
343
+ attach_function :OGR_F_SetFieldBinary, %i[OGRFeatureH int int pointer], :void
344
+ attach_function :OGR_F_SetFieldDateTime,
345
+ %i[OGRFeatureH int int int int int int int int],
346
+ :void
347
+
348
+ attach_function :OGR_F_GetGeomFieldCount, %i[OGRFeatureH], :int
349
+ attach_function :OGR_F_GetGeomFieldDefnRef, %i[OGRFeatureH int], :OGRGeomFieldDefnH
350
+ attach_function :OGR_F_GetGeomFieldIndex, %i[OGRFeatureH string], :int
351
+ attach_function :OGR_F_GetGeomFieldRef, %i[OGRFeatureH int], :OGRGeometryH
352
+ attach_function :OGR_F_SetGeomFieldDirectly, %i[OGRFeatureH int OGRGeometryH], OGRErr
353
+ attach_function :OGR_F_SetGeomField, %i[OGRFeatureH int OGRGeometryH], OGRErr
354
+
355
+ attach_function :OGR_F_GetFID, %i[OGRFeatureH], :long
356
+ attach_function :OGR_F_SetFID, %i[OGRFeatureH long], OGRErr
357
+ attach_function :OGR_F_DumpReadable, %i[OGRFeatureH string], :void
358
+ attach_function :OGR_F_SetFrom, %i[OGRFeatureH OGRFeatureH int], OGRErr
359
+ attach_function :OGR_F_SetFromWithMap, %i[OGRFeatureH OGRFeatureH int pointer], OGRErr
360
+
361
+ attach_function :OGR_F_GetStyleString, %i[OGRFeatureH], :string
362
+ attach_function :OGR_F_SetStyleString, %i[OGRFeatureH string], :void
363
+ attach_function :OGR_F_SetStyleStringDirectly, %i[OGRFeatureH string], :void
364
+ attach_function :OGR_F_GetStyleTable, %i[OGRFeatureH], :OGRStyleTableH
365
+ attach_function :OGR_F_SetStyleTableDirectly, %i[OGRFeatureH OGRStyleTableH], :void
366
+ attach_function :OGR_F_SetStyleTable, %i[OGRFeatureH OGRStyleTableH], :void
367
+
368
+ #~~~~~~~~~~~~~~~~~
369
+ # Layer-related
370
+ #~~~~~~~~~~~~~~~~~
371
+ attach_function :OGR_L_GetName, %i[OGRLayerH], :string
372
+ attach_function :OGR_L_GetGeomType, %i[OGRLayerH], OGRwkbGeometryType
373
+ attach_function :OGR_L_GetSpatialFilter, %i[OGRLayerH], :OGRGeometryH
374
+ attach_function :OGR_L_SetSpatialFilter, %i[OGRLayerH OGRGeometryH], :void
375
+ attach_function :OGR_L_SetSpatialFilterRect,
376
+ %i[OGRLayerH double double double double],
377
+ :void
378
+ attach_function :OGR_L_SetSpatialFilterEx, %i[OGRLayerH int OGRGeometryH], :void
379
+ attach_function :OGR_L_SetSpatialFilterRectEx,
380
+ %i[OGRLayerH int double double double double],
381
+ :void
382
+ attach_function :OGR_L_SetAttributeFilter, %i[OGRLayerH string], OGRErr
383
+ attach_function :OGR_L_ResetReading, %i[OGRLayerH], :void
384
+
385
+ attach_function :OGR_L_GetNextFeature, %i[OGRLayerH], :OGRFeatureH
386
+ attach_function :OGR_L_SetNextByIndex, %i[OGRLayerH long], OGRErr
387
+ attach_function :OGR_L_GetFeature, %i[OGRLayerH long], :OGRFeatureH
388
+ attach_function :OGR_L_SetFeature, %i[OGRLayerH OGRFeatureH], OGRErr
389
+ attach_function :OGR_L_CreateFeature, %i[OGRLayerH OGRFeatureH], OGRErr
390
+ attach_function :OGR_L_DeleteFeature, %i[OGRLayerH long], OGRErr
391
+ attach_function :OGR_L_GetLayerDefn, %i[OGRLayerH], :OGRFeatureDefnH
392
+ attach_function :OGR_L_GetSpatialRef, %i[OGRLayerH], :OGRSpatialReferenceH
393
+ attach_function :OGR_L_FindFieldIndex, %i[OGRLayerH string int], :int
394
+ attach_function :OGR_L_GetFeatureCount, %i[OGRLayerH bool], :int
395
+
396
+ attach_function :OGR_L_GetExtent, [:OGRLayerH, OGREnvelope.ptr, :bool], OGRErr
397
+ attach_function :OGR_L_GetExtentEx,
398
+ [:OGRLayerH, :int, OGREnvelope.ptr, :bool],
399
+ OGRErr
400
+ attach_function :OGR_L_TestCapability, %i[OGRLayerH string], :bool
401
+ attach_function :OGR_L_CreateField, %i[OGRLayerH OGRFieldDefnH bool], OGRErr
402
+ attach_function :OGR_L_CreateGeomField,
403
+ %i[OGRLayerH OGRGeomFieldDefnH int],
404
+ OGRErr
405
+ attach_function :OGR_L_DeleteField, %i[OGRLayerH int], OGRErr
406
+ attach_function :OGR_L_ReorderFields, %i[OGRLayerH pointer], OGRErr
407
+ attach_function :OGR_L_ReorderField, %i[OGRLayerH int int], OGRErr
408
+ attach_function :OGR_L_AlterFieldDefn, %i[OGRLayerH int OGRFieldDefnH int], OGRErr
409
+
410
+ attach_function :OGR_L_StartTransaction, %i[OGRLayerH], OGRErr
411
+ attach_function :OGR_L_CommitTransaction, %i[OGRLayerH], OGRErr
412
+ attach_function :OGR_L_RollbackTransaction, %i[OGRLayerH], OGRErr
413
+
414
+ attach_function :OGR_L_Reference, %i[OGRLayerH], :int
415
+ attach_function :OGR_L_Dereference, %i[OGRLayerH], :int
416
+ attach_function :OGR_L_GetRefCount, %i[OGRLayerH], :int
417
+ attach_function :OGR_L_SyncToDisk, %i[OGRLayerH], OGRErr
418
+
419
+ attach_function :OGR_L_GetFeaturesRead, %i[OGRLayerH], :GIntBig
420
+ attach_function :OGR_L_GetFIDColumn, %i[OGRLayerH], :string
421
+ attach_function :OGR_L_GetGeometryColumn, %i[OGRLayerH], :string
422
+ attach_function :OGR_L_GetStyleTable, %i[OGRLayerH], :OGRStyleTableH
423
+ attach_function :OGR_L_SetStyleTableDirectly, %i[OGRLayerH OGRStyleTableH], :void
424
+ attach_function :OGR_L_SetStyleTable, %i[OGRLayerH OGRStyleTableH], :void
425
+ attach_function :OGR_L_SetIgnoredFields, %i[OGRLayerH pointer], OGRErr
426
+
427
+ attach_function :OGR_L_Intersection,
428
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
429
+ OGRErr
430
+ attach_function :OGR_L_Union,
431
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
432
+ OGRErr
433
+ attach_function :OGR_L_SymDifference,
434
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
435
+ OGRErr
436
+ attach_function :OGR_L_Identity,
437
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
438
+ OGRErr
439
+ attach_function :OGR_L_Update,
440
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
441
+ OGRErr
442
+ attach_function :OGR_L_Clip,
443
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
444
+ OGRErr
445
+ attach_function :OGR_L_Erase,
446
+ %i[OGRLayerH OGRLayerH OGRLayerH pointer GDALProgressFunc pointer],
447
+ OGRErr
448
+
449
+ #~~~~~~~~~~~~~~~~~
450
+ # DataSource-related
451
+ #~~~~~~~~~~~~~~~~~
452
+ attach_function :OGR_DS_Destroy, %i[OGRDataSourceH], :void
453
+ attach_function :OGR_DS_GetName, %i[OGRDataSourceH], :string
454
+ attach_function :OGR_DS_GetLayerCount, %i[OGRDataSourceH], :int
455
+ attach_function :OGR_DS_GetLayer, %i[OGRDataSourceH int], :OGRLayerH
456
+ attach_function :OGR_DS_GetLayerByName, %i[OGRDataSourceH string], :OGRLayerH
457
+ attach_function :OGR_DS_DeleteLayer, %i[OGRDataSourceH int], OGRErr
458
+ attach_function :OGR_DS_GetDriver, %i[OGRDataSourceH], :OGRSFDriverH
459
+ attach_function :OGR_DS_CreateLayer,
460
+ [:OGRDataSourceH, :string, :OGRSpatialReferenceH, OGRwkbGeometryType, :pointer],
461
+ :OGRLayerH
462
+ attach_function :OGR_DS_CopyLayer,
463
+ %i[OGRDataSourceH OGRLayerH string pointer],
464
+ :OGRLayerH
465
+ attach_function :OGR_DS_TestCapability, %i[OGRDataSourceH string], :bool
466
+ attach_function :OGR_DS_ExecuteSQL,
467
+ %i[OGRDataSourceH string OGRGeometryH string],
468
+ :OGRLayerH
469
+ attach_function :OGR_DS_ReleaseResultSet, %i[OGRDataSourceH OGRLayerH], :void
470
+
471
+ attach_function :OGR_DS_SyncToDisk, %i[OGRDataSourceH], OGRErr
472
+ attach_function :OGR_DS_GetStyleTable, %i[OGRDataSourceH], :OGRStyleTableH
473
+ attach_function :OGR_DS_SetStyleTableDirectly,
474
+ %i[OGRDataSourceH OGRStyleTableH],
475
+ :void
476
+ attach_function :OGR_DS_SetStyleTable, %i[OGRDataSourceH OGRStyleTableH], :void
477
+
478
+ #~~~~~~~~~~~~~~~~~
479
+ # Driver-related
480
+ #~~~~~~~~~~~~~~~~~
481
+ attach_function :OGR_Dr_GetName, %i[OGRSFDriverH], :string
482
+ attach_function :OGR_Dr_Open, %i[OGRSFDriverH string bool], :OGRDataSourceH
483
+ attach_function :OGR_Dr_TestCapability, %i[OGRSFDriverH string], :int
484
+ attach_function :OGR_Dr_CreateDataSource, %i[OGRSFDriverH string pointer], :OGRDataSourceH
485
+ attach_function :OGR_Dr_CopyDataSource,
486
+ %i[OGRSFDriverH OGRDataSourceH string pointer],
487
+ :OGRDataSourceH
488
+ attach_function :OGR_Dr_DeleteDataSource, %i[OGRSFDriverH string], OGRErr
489
+
490
+ #~~~~~~~~~~~~~~~~~
491
+ # Style Manager-related
492
+ #~~~~~~~~~~~~~~~~~
493
+ attach_function :OGR_SM_Create, %i[OGRStyleTableH], :OGRStyleMgrH
494
+ attach_function :OGR_SM_Destroy, %i[OGRStyleTableH], :void
495
+ attach_function :OGR_SM_InitFromFeature, %i[OGRStyleTableH OGRFeatureH], :string
496
+ attach_function :OGR_SM_InitStyleString, %i[OGRStyleTableH string], :int
497
+ attach_function :OGR_SM_GetPartCount, %i[OGRStyleTableH string], :int
498
+ attach_function :OGR_SM_GetPart,
499
+ %i[OGRStyleTableH int string],
500
+ :OGRStyleToolH
501
+ attach_function :OGR_SM_AddPart, %i[OGRStyleTableH OGRStyleToolH], :int
502
+ attach_function :OGR_SM_AddStyle, %i[OGRStyleTableH string string], :int
503
+
504
+ #~~~~~~~~~~~~~~~~~
505
+ # Style Tool-related
506
+ #~~~~~~~~~~~~~~~~~
507
+ attach_function :OGR_ST_Create, [OGRSTClassId], :OGRStyleToolH
508
+ attach_function :OGR_ST_Destroy, %i[OGRStyleToolH], :void
509
+ attach_function :OGR_ST_GetType, %i[OGRStyleToolH], OGRSTClassId
510
+ attach_function :OGR_ST_GetUnit, %i[OGRStyleToolH], OGRSTUnitId
511
+ attach_function :OGR_ST_SetUnit, [:OGRStyleToolH, OGRSTUnitId, :double], :void
512
+ attach_function :OGR_ST_GetParamStr, %i[OGRStyleToolH int pointer], :string
513
+ attach_function :OGR_ST_GetParamNum, %i[OGRStyleToolH int pointer], :int
514
+ attach_function :OGR_ST_GetParamDbl, %i[OGRStyleToolH int pointer], :double
515
+ attach_function :OGR_ST_SetParamStr, %i[OGRStyleToolH int string], :void
516
+ attach_function :OGR_ST_SetParamNum, %i[OGRStyleToolH int int], :void
517
+ attach_function :OGR_ST_SetParamDbl, %i[OGRStyleToolH int double], :void
518
+ attach_function :OGR_ST_GetStyleString, %i[OGRStyleToolH], :string
519
+ attach_function :OGR_ST_GetRGBFromString,
520
+ %i[OGRStyleToolH string pointer pointer pointer pointer],
521
+ :int
522
+
523
+ #~~~~~~~~~~~~~~~~~
524
+ # Style Table-related
525
+ #~~~~~~~~~~~~~~~~~
526
+ attach_function :OGR_STBL_Create, [], :OGRStyleTableH
527
+ attach_function :OGR_STBL_Destroy, %i[OGRStyleTableH], :void
528
+ attach_function :OGR_STBL_AddStyle, %i[OGRStyleTableH string string], :int
529
+ attach_function :OGR_STBL_SaveStyleTable, %i[OGRStyleTableH string], :int
530
+ attach_function :OGR_STBL_LoadStyleTable, %i[OGRStyleTableH string], :int
531
+ attach_function :OGR_STBL_Find, %i[OGRStyleTableH string], :string
532
+ attach_function :OGR_STBL_ResetStyleStringReading, %i[OGRStyleTableH], :void
533
+ attach_function :OGR_STBL_GetNextStyle, %i[OGRStyleTableH], :string
534
+ attach_function :OGR_STBL_GetLastStyleName, %i[OGRStyleTableH], :string
535
+
536
+ #~~~~~~~~~~~~~~~~~
537
+ # Main functions
538
+ #~~~~~~~~~~~~~~~~~
539
+ attach_function :OGROpen, %i[string bool OGRSFDriverH], :OGRDataSourceH
540
+ attach_function :OGROpenShared, %i[string bool OGRSFDriverH], :OGRDataSourceH
541
+ attach_function :OGRReleaseDataSource, %i[OGRDataSourceH], OGRErr
542
+ attach_function :OGRRegisterDriver, %i[OGRSFDriverH], :void
543
+ attach_function :OGRDeregisterDriver, %i[OGRSFDriverH], :void
544
+ attach_function :OGRGetDriverCount, [], :int
545
+ attach_function :OGRGetDriver, %i[int], :OGRSFDriverH
546
+ attach_function :OGRGetDriverByName, %i[string], :OGRSFDriverH
547
+ attach_function :OGRGetOpenDSCount, [], :int
548
+ attach_function :OGRGetOpenDS, %i[int], :OGRDataSourceH
549
+
550
+ attach_function :OGRRegisterAll, [], :void
551
+ attach_function :OGRCleanupAll, [], :void
552
+ end
553
+ end