ffi-gdal 1.0.0.beta16 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (324) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +17 -0
  3. data/.github/workflows/codacy.yml +61 -0
  4. data/.github/workflows/codeql.yml +74 -0
  5. data/.github/workflows/continuous-integration.yml +36 -0
  6. data/.github/workflows/dependency-review.yml +20 -0
  7. data/.github/workflows/specs-in-docker.yml +27 -0
  8. data/.gitignore +3 -0
  9. data/.rspec +1 -0
  10. data/.rubocop.yml +10 -80
  11. data/.rubocop_todo.yml +23 -40
  12. data/.ruby-version +1 -1
  13. data/Changelog-0.x.md +512 -0
  14. data/Changelog.md +12 -0
  15. data/Dockerfile.gdal2 +110 -0
  16. data/Dockerfile.gdal3 +73 -0
  17. data/README.md +25 -14
  18. data/Rakefile +0 -8
  19. data/Tiltfile +91 -0
  20. data/bin/bundle +123 -0
  21. data/bin/docker-clean +8 -0
  22. data/bin/rake +29 -0
  23. data/bin/rspec +29 -0
  24. data/bin/rubocop +29 -0
  25. data/docker-compose.yml +25 -0
  26. data/examples/extract_and_colorize.rb +0 -13
  27. data/examples/geometries.rb +14 -14
  28. data/examples/ogr_layer_to_layer.rb +1 -3
  29. data/examples/raster_erasing.rb +1 -0
  30. data/examples/remove_small_polygons.rb +1 -1
  31. data/examples/testing_gdal.rb +20 -17
  32. data/examples/warping.rb +9 -7
  33. data/ffi-gdal.gemspec +12 -6
  34. data/lib/ext/ffi_library_function_checks.rb +2 -2
  35. data/lib/ext/to_bool.rb +5 -3
  36. data/lib/ffi/cpl/conv.rb +27 -25
  37. data/lib/ffi/cpl/error.rb +19 -20
  38. data/lib/ffi/cpl/hash_set.rb +4 -4
  39. data/lib/ffi/cpl/http.rb +3 -3
  40. data/lib/ffi/cpl/http_result.rb +8 -8
  41. data/lib/ffi/cpl/list.rb +1 -1
  42. data/lib/ffi/cpl/mime_part.rb +2 -2
  43. data/lib/ffi/cpl/minixml.rb +7 -7
  44. data/lib/ffi/cpl/progress.rb +8 -8
  45. data/lib/ffi/cpl/quad_tree.rb +14 -14
  46. data/lib/ffi/cpl/rect_obj.rb +3 -3
  47. data/lib/ffi/cpl/string.rb +17 -20
  48. data/lib/ffi/cpl/vsi.rb +13 -13
  49. data/lib/ffi/cpl/xml_node.rb +3 -3
  50. data/lib/ffi/extensions/gdal/extensions/all.rb +4 -0
  51. data/lib/ffi/extensions/gdal/extensions/version.rb +9 -0
  52. data/lib/ffi/extensions/gdal/extensions.rb +12 -0
  53. data/lib/ffi/extensions/rttopo/gbox.rb +19 -0
  54. data/lib/ffi/extensions/rttopo/geom.rb +16 -0
  55. data/lib/ffi/extensions/rttopo.rb +41 -0
  56. data/lib/ffi/gdal/alg.rb +277 -277
  57. data/lib/ffi/gdal/color_entry.rb +3 -3
  58. data/lib/ffi/gdal/gcp.rb +6 -6
  59. data/lib/ffi/gdal/gdal.rb +349 -349
  60. data/lib/ffi/gdal/grid.rb +134 -134
  61. data/lib/ffi/gdal/grid_data_metrics_options.rb +4 -4
  62. data/lib/ffi/gdal/grid_inverse_distance_to_a_power_options.rb +9 -9
  63. data/lib/ffi/gdal/grid_moving_average_options.rb +4 -4
  64. data/lib/ffi/gdal/grid_nearest_neighbor_options.rb +3 -3
  65. data/lib/ffi/gdal/matching.rb +3 -3
  66. data/lib/ffi/gdal/rpc_info.rb +17 -17
  67. data/lib/ffi/gdal/transformer_info.rb +4 -4
  68. data/lib/ffi/gdal/version.rb +1 -1
  69. data/lib/ffi/gdal/vrt.rb +39 -39
  70. data/lib/ffi/gdal/warp_options.rb +34 -34
  71. data/lib/ffi/gdal/warper.rb +90 -90
  72. data/lib/ffi/gdal.rb +2 -31
  73. data/lib/ffi/ogr/api.rb +175 -167
  74. data/lib/ffi/ogr/contour_writer_info.rb +4 -4
  75. data/lib/ffi/ogr/core.rb +107 -107
  76. data/lib/ffi/ogr/envelope.rb +3 -3
  77. data/lib/ffi/ogr/envelope_3d.rb +5 -5
  78. data/lib/ffi/ogr/featurestyle.rb +3 -3
  79. data/lib/ffi/ogr/field.rb +22 -22
  80. data/lib/ffi/ogr/geocoding.rb +4 -4
  81. data/lib/ffi/ogr/srs_api.rb +154 -155
  82. data/lib/ffi/ogr/style_param.rb +3 -3
  83. data/lib/ffi/ogr/style_value.rb +4 -4
  84. data/lib/gdal/color_entry.rb +1 -5
  85. data/lib/gdal/color_interpretation.rb +7 -3
  86. data/lib/gdal/color_table.rb +46 -27
  87. data/lib/gdal/cpl_error_handler.rb +26 -6
  88. data/lib/gdal/data_type.rb +10 -3
  89. data/lib/gdal/dataset.rb +171 -85
  90. data/lib/gdal/dataset_mixins/algorithm_methods.rb +44 -44
  91. data/lib/gdal/dataset_mixins/matching.rb +1 -1
  92. data/lib/gdal/dataset_mixins/warp_methods.rb +4 -2
  93. data/lib/gdal/driver.rb +38 -21
  94. data/lib/gdal/environment_methods.rb +6 -6
  95. data/lib/gdal/extensions/all.rb +3 -0
  96. data/lib/gdal/{color_entry_mixins → extensions/color_entry}/extensions.rb +4 -1
  97. data/lib/gdal/{color_table_mixins → extensions/color_table}/extensions.rb +3 -0
  98. data/lib/gdal/extensions/dataset/extensions.rb +205 -0
  99. data/lib/gdal/{driver_mixins → extensions/driver}/extensions.rb +6 -2
  100. data/lib/gdal/{geo_transform_mixins → extensions/geo_transform}/extensions.rb +10 -8
  101. data/lib/gdal/{gridder → extensions/gridder}/point_extracting.rb +7 -5
  102. data/lib/gdal/{gridder.rb → extensions/gridder.rb} +33 -33
  103. data/lib/gdal/{gridder_options.rb → extensions/gridder_options.rb} +13 -14
  104. data/lib/gdal/{raster_attribute_table_mixins → extensions/raster_attribute_table}/extensions.rb +8 -6
  105. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/algorithm_extensions.rb +8 -6
  106. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/coloring_extensions.rb +6 -4
  107. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/extensions.rb +9 -5
  108. data/lib/gdal/{raster_band_mixins → extensions/raster_band}/io_extensions.rb +18 -14
  109. data/lib/gdal/{raster_band_classifier.rb → extensions/raster_band_classifier.rb} +3 -5
  110. data/lib/gdal/geo_transform.rb +1 -6
  111. data/lib/gdal/grid.rb +3 -2
  112. data/lib/gdal/grid_algorithms.rb +9 -9
  113. data/lib/gdal/internal_helpers.rb +46 -9
  114. data/lib/gdal/major_object.rb +11 -3
  115. data/lib/gdal/options.rb +26 -32
  116. data/lib/gdal/raster_attribute_table.rb +63 -37
  117. data/lib/gdal/raster_band.rb +164 -116
  118. data/lib/gdal/raster_band_mixins/algorithm_methods.rb +26 -25
  119. data/lib/gdal/rpc_info.rb +3 -2
  120. data/lib/gdal/transformers/approximate_transformer.rb +12 -3
  121. data/lib/gdal/transformers/base_general_image_projection_transformer.rb +15 -2
  122. data/lib/gdal/transformers/gcp_transformer.rb +27 -19
  123. data/lib/gdal/transformers/general_image_projection_transformer.rb +8 -6
  124. data/lib/gdal/transformers/general_image_projection_transformer2.rb +9 -6
  125. data/lib/gdal/transformers/general_image_projection_transformer3.rb +6 -2
  126. data/lib/gdal/transformers/geolocation_transformer.rb +12 -4
  127. data/lib/gdal/transformers/reprojection_transformer.rb +11 -3
  128. data/lib/gdal/transformers/rpc_transformer.rb +11 -2
  129. data/lib/gdal/transformers/tps_transformer.rb +12 -4
  130. data/lib/gdal/version_info.rb +2 -2
  131. data/lib/gdal/virtual_dataset.rb +2 -0
  132. data/lib/gdal/warp_operation.rb +65 -54
  133. data/lib/gdal/warp_options.rb +9 -11
  134. data/lib/ogr/coordinate_transformation.rb +23 -9
  135. data/lib/ogr/data_source.rb +68 -37
  136. data/lib/ogr/driver.rb +18 -17
  137. data/lib/ogr/envelope.rb +0 -3
  138. data/lib/ogr/error_handling.rb +22 -24
  139. data/lib/ogr/extensions/all.rb +3 -0
  140. data/lib/ogr/{data_source_mixins → extensions/data_source}/capability_methods.rb +2 -0
  141. data/lib/ogr/extensions/data_source/data_source_extensions.rb +16 -0
  142. data/lib/ogr/{driver_mixins → extensions/driver}/capability_methods.rb +5 -1
  143. data/lib/ogr/extensions/envelope/extensions.rb +114 -0
  144. data/lib/ogr/extensions/feature/extensions.rb +87 -0
  145. data/lib/ogr/extensions/feature_definition/extensions.rb +43 -0
  146. data/lib/ogr/extensions/geometries/point/extensions.rb +19 -0
  147. data/lib/ogr/extensions/geometry/container_mixins.rb +56 -0
  148. data/lib/ogr/extensions/geometry/ewkb_io_extensions.rb +44 -0
  149. data/lib/ogr/extensions/geometry/ewkb_record.rb +94 -0
  150. data/lib/ogr/{geometry_mixins → extensions/geometry}/extensions.rb +16 -9
  151. data/lib/ogr/extensions/geometry/rttopo_extensions.rb +48 -0
  152. data/lib/ogr/extensions/geometry/wkb_record.rb +63 -0
  153. data/lib/ogr/extensions/geometry_types/curve/extensions.rb +68 -0
  154. data/lib/ogr/{layer_mixins → extensions/layer}/capability_methods.rb +4 -0
  155. data/lib/ogr/{layer_mixins → extensions/layer}/extensions.rb +11 -6
  156. data/lib/ogr/extensions/spatial_reference/extensions.rb +38 -0
  157. data/lib/ogr/extensions/spatial_reference/initializers.rb +138 -0
  158. data/lib/ogr/extensions/style_table/extensions.rb +31 -0
  159. data/lib/ogr/feature.rb +173 -88
  160. data/lib/ogr/feature_definition.rb +53 -45
  161. data/lib/ogr/field.rb +17 -19
  162. data/lib/ogr/field_definition.rb +30 -18
  163. data/lib/ogr/geocoder.rb +11 -4
  164. data/lib/ogr/geometries/line_string.rb +1 -0
  165. data/lib/ogr/geometries/line_string_25d.rb +0 -9
  166. data/lib/ogr/geometries/linear_ring.rb +2 -2
  167. data/lib/ogr/geometries/point.rb +0 -9
  168. data/lib/ogr/geometry.rb +116 -49
  169. data/lib/ogr/geometry_field_definition.rb +31 -15
  170. data/lib/ogr/geometry_types/container.rb +26 -28
  171. data/lib/ogr/geometry_types/curve.rb +5 -61
  172. data/lib/ogr/geometry_types/surface.rb +1 -1
  173. data/lib/ogr/internal_helpers.rb +2 -2
  174. data/lib/ogr/layer.rb +12 -10
  175. data/lib/ogr/layer_mixins/ogr_feature_methods.rb +39 -27
  176. data/lib/ogr/layer_mixins/ogr_field_methods.rb +66 -50
  177. data/lib/ogr/layer_mixins/ogr_layer_method_methods.rb +17 -8
  178. data/lib/ogr/layer_mixins/ogr_query_filter_methods.rb +7 -6
  179. data/lib/ogr/layer_mixins/ogr_sql_methods.rb +15 -7
  180. data/lib/ogr/spatial_reference.rb +79 -42
  181. data/lib/ogr/spatial_reference_mixins/coordinate_system_getter_setters.rb +149 -118
  182. data/lib/ogr/spatial_reference_mixins/exporters.rb +87 -51
  183. data/lib/ogr/spatial_reference_mixins/importers.rb +88 -43
  184. data/lib/ogr/spatial_reference_mixins/morphers.rb +12 -8
  185. data/lib/ogr/spatial_reference_mixins/parameter_getter_setters.rb +27 -13
  186. data/lib/ogr/style_table.rb +15 -5
  187. data/lib/ogr/style_tool.rb +29 -15
  188. data/lib/ogr.rb +1 -0
  189. data/rakelib/docker.rake +10 -0
  190. data/sorbet/rbi/hidden-definitions/errors.txt +21790 -0
  191. data/tilt/gdal2.yml +22 -0
  192. data/tilt/gdal3.yml +22 -0
  193. metadata +116 -280
  194. data/History.md +0 -360
  195. data/lib/ext/error_symbols.rb +0 -7
  196. data/lib/gdal/dataset_mixins/extensions.rb +0 -380
  197. data/lib/gdal/merger.rb +0 -132
  198. data/lib/ogr/data_source_extensions.rb +0 -10
  199. data/lib/ogr/envelope_extensions.rb +0 -110
  200. data/lib/ogr/feature_definition_extensions.rb +0 -39
  201. data/lib/ogr/feature_extensions.rb +0 -87
  202. data/lib/ogr/geometry_mixins/container_mixins.rb +0 -25
  203. data/lib/ogr/spatial_reference_extensions.rb +0 -34
  204. data/lib/ogr/style_table_extensions.rb +0 -26
  205. data/spec/ffi-gdal_spec.rb +0 -24
  206. data/spec/integration/gdal/color_table_info_spec.rb +0 -78
  207. data/spec/integration/gdal/dataset_info_spec.rb +0 -342
  208. data/spec/integration/gdal/driver_info_spec.rb +0 -170
  209. data/spec/integration/gdal/geo_transform_info_spec.rb +0 -226
  210. data/spec/integration/gdal/gridder_spec.rb +0 -331
  211. data/spec/integration/gdal/raster_attribute_table_info_spec.rb +0 -229
  212. data/spec/integration/gdal/raster_band_algorithms_spec.rb +0 -35
  213. data/spec/integration/gdal/raster_band_info_spec.rb +0 -320
  214. data/spec/integration/ogr/layer_spec.rb +0 -95
  215. data/spec/spec_helper.rb +0 -116
  216. data/spec/support/images/123.tiff +0 -0
  217. data/spec/support/images/osgeo/gdal/data/hfa/float-rle.img +0 -0
  218. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.lgo +0 -31
  219. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif +0 -0
  220. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.tif.msk +0 -0
  221. data/spec/support/images/osgeo/geotiff/GeogToWGS84GeoKey/GeogToWGS84GeoKey5.txt +0 -10
  222. data/spec/support/images/osgeo/geotiff/gdal_eg/cea.tif +0 -0
  223. data/spec/support/images/osgeo/geotiff/gdal_eg/cea.txt +0 -84
  224. data/spec/support/images/osgeo/geotiff/zi_imaging/image0.lgo +0 -45
  225. data/spec/support/images/osgeo/geotiff/zi_imaging/image0.tif +0 -0
  226. data/spec/support/integration_help.rb +0 -34
  227. data/spec/support/shapefiles/states_21basic/states.dbf +0 -0
  228. data/spec/support/shapefiles/states_21basic/states.prj +0 -1
  229. data/spec/support/shapefiles/states_21basic/states.sbn +0 -0
  230. data/spec/support/shapefiles/states_21basic/states.sbx +0 -0
  231. data/spec/support/shapefiles/states_21basic/states.shp +0 -0
  232. data/spec/support/shapefiles/states_21basic/states.shp.xml +0 -3
  233. data/spec/support/shapefiles/states_21basic/states.shx +0 -0
  234. data/spec/support/shared_contexts.rb +0 -28
  235. data/spec/support/shared_examples/gdal/major_object_examples.rb +0 -55
  236. data/spec/support/shared_examples/ogr/a_25d_geometry.rb +0 -9
  237. data/spec/support/shared_examples/ogr/a_container_geometry.rb +0 -49
  238. data/spec/support/shared_examples/ogr/a_geometry.rb +0 -406
  239. data/spec/support/shared_examples/ogr/a_line_string.rb +0 -18
  240. data/spec/support/test_style_table.txt +0 -3
  241. data/spec/support/worldfiles/SR_50M/SR_50M.VERSION.txt +0 -1
  242. data/spec/support/worldfiles/SR_50M/SR_50M.prj +0 -1
  243. data/spec/support/worldfiles/SR_50M/SR_50M.tfw +0 -6
  244. data/spec/support/worldfiles/SR_50M/SR_50M.tif +0 -0
  245. data/spec/unit/ext/error_symbols_spec.rb +0 -69
  246. data/spec/unit/ext/numeric_as_data_type_spec.rb +0 -115
  247. data/spec/unit/ffi/gdal_spec.rb +0 -73
  248. data/spec/unit/gdal/color_entry_spec.rb +0 -8
  249. data/spec/unit/gdal/color_interpretation_spec.rb +0 -8
  250. data/spec/unit/gdal/color_table_mixins/extensions_spec.rb +0 -62
  251. data/spec/unit/gdal/color_table_spec.rb +0 -146
  252. data/spec/unit/gdal/data_type_spec.rb +0 -74
  253. data/spec/unit/gdal/dataset_mixins/warp_methods_spec.rb +0 -55
  254. data/spec/unit/gdal/dataset_spec.rb +0 -148
  255. data/spec/unit/gdal/driver_mixins/extensions_spec.rb +0 -24
  256. data/spec/unit/gdal/driver_spec.rb +0 -51
  257. data/spec/unit/gdal/environment_methods_spec.rb +0 -8
  258. data/spec/unit/gdal/geo_transform_mixins/extensions_spec.rb +0 -69
  259. data/spec/unit/gdal/geo_transform_spec.rb +0 -265
  260. data/spec/unit/gdal/grid_spec.rb +0 -98
  261. data/spec/unit/gdal/gridder/point_extracting_spec.rb +0 -101
  262. data/spec/unit/gdal/gridder_options_spec.rb +0 -185
  263. data/spec/unit/gdal/gridder_spec.rb +0 -182
  264. data/spec/unit/gdal/internal_helpers_spec.rb +0 -278
  265. data/spec/unit/gdal/major_object_spec.rb +0 -10
  266. data/spec/unit/gdal/options_spec.rb +0 -33
  267. data/spec/unit/gdal/raster_attribute_table_spec.rb +0 -7
  268. data/spec/unit/gdal/raster_band_classifier_spec.rb +0 -260
  269. data/spec/unit/gdal/raster_band_mixins/extensions_spec.rb +0 -73
  270. data/spec/unit/gdal/raster_band_mixins/io_extensions_spec.rb +0 -135
  271. data/spec/unit/gdal/raster_band_spec.rb +0 -8
  272. data/spec/unit/gdal/rpc_info_spec.rb +0 -8
  273. data/spec/unit/gdal/version_info_spec.rb +0 -10
  274. data/spec/unit/gdal/virtual_dataset_spec.rb +0 -34
  275. data/spec/unit/gdal/warp_operation_spec.rb +0 -8
  276. data/spec/unit/gdal/warp_options_spec.rb +0 -338
  277. data/spec/unit/ogr/coordinate_transformation_spec.rb +0 -104
  278. data/spec/unit/ogr/data_source_mixins/capability_methods_spec.rb +0 -32
  279. data/spec/unit/ogr/data_source_spec.rb +0 -223
  280. data/spec/unit/ogr/driver_mixins/capability_methods_spec.rb +0 -20
  281. data/spec/unit/ogr/driver_spec.rb +0 -152
  282. data/spec/unit/ogr/envelope_spec.rb +0 -324
  283. data/spec/unit/ogr/feature_definition_spec.rb +0 -296
  284. data/spec/unit/ogr/feature_extensions_spec.rb +0 -90
  285. data/spec/unit/ogr/feature_spec.rb +0 -363
  286. data/spec/unit/ogr/field_definition_spec.rb +0 -118
  287. data/spec/unit/ogr/field_spec.rb +0 -195
  288. data/spec/unit/ogr/geometries/geometry_collection_25d_spec.rb +0 -25
  289. data/spec/unit/ogr/geometries/geometry_collection_spec.rb +0 -188
  290. data/spec/unit/ogr/geometries/line_string_25d_spec.rb +0 -25
  291. data/spec/unit/ogr/geometries/line_string_spec.rb +0 -107
  292. data/spec/unit/ogr/geometries/linear_ring_spec.rb +0 -92
  293. data/spec/unit/ogr/geometries/multi_line_string_25d_spec.rb +0 -25
  294. data/spec/unit/ogr/geometries/multi_line_string_spec.rb +0 -16
  295. data/spec/unit/ogr/geometries/multi_point_25d_spec.rb +0 -25
  296. data/spec/unit/ogr/geometries/multi_point_spec.rb +0 -16
  297. data/spec/unit/ogr/geometries/multi_polygon_25d_spec.rb +0 -25
  298. data/spec/unit/ogr/geometries/multi_polygon_spec.rb +0 -43
  299. data/spec/unit/ogr/geometries/none_geometry_spec.rb +0 -14
  300. data/spec/unit/ogr/geometries/point_25d_spec.rb +0 -25
  301. data/spec/unit/ogr/geometries/point_spec.rb +0 -307
  302. data/spec/unit/ogr/geometries/polygon_25d_spec.rb +0 -25
  303. data/spec/unit/ogr/geometries/polygon_spec.rb +0 -19
  304. data/spec/unit/ogr/geometries/unknown_geometry_spec.rb +0 -12
  305. data/spec/unit/ogr/geometry_field_definition_spec.rb +0 -73
  306. data/spec/unit/ogr/geometry_spec.rb +0 -711
  307. data/spec/unit/ogr/internal_helpers_spec.rb +0 -70
  308. data/spec/unit/ogr/layer_mixins/capability_methods_spec.rb +0 -90
  309. data/spec/unit/ogr/layer_mixins/ogr_feature_methods_spec.rb +0 -155
  310. data/spec/unit/ogr/layer_mixins/ogr_field_methods_spec.rb +0 -434
  311. data/spec/unit/ogr/layer_mixins/ogr_layer_method_methods_spec.rb +0 -22
  312. data/spec/unit/ogr/layer_mixins/ogr_query_filter_methods_spec.rb +0 -44
  313. data/spec/unit/ogr/layer_mixins/ogr_sql_methods_spec.rb +0 -14
  314. data/spec/unit/ogr/layer_spec.rb +0 -98
  315. data/spec/unit/ogr/spatial_reference_mixins/coordinate_system_getter_setters_spec.rb +0 -48
  316. data/spec/unit/ogr/spatial_reference_mixins/exporters_spec.rb +0 -151
  317. data/spec/unit/ogr/spatial_reference_mixins/importers_spec.rb +0 -40
  318. data/spec/unit/ogr/spatial_reference_mixins/morphers_spec.rb +0 -38
  319. data/spec/unit/ogr/spatial_reference_mixins/parameter_getter_setters_spec.rb +0 -105
  320. data/spec/unit/ogr/spatial_reference_mixins/type_checks_spec.rb +0 -159
  321. data/spec/unit/ogr/spatial_reference_spec.rb +0 -44
  322. data/spec/unit/ogr/style_table_spec.rb +0 -108
  323. data/spec/unit/ogr/style_tool_spec.rb +0 -159
  324. data/spec/unit/version_info_spec.rb +0 -50
data/lib/ffi/ogr/api.rb CHANGED
@@ -30,14 +30,14 @@ module FFI
30
30
  # Functions
31
31
  # -----------------------------------------------------------------------
32
32
  attach_function :OGR_G_CreateFromWkb,
33
- [:pointer, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH), :pointer, :int],
34
- FFI::OGR::Core::Err
33
+ [:pointer, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH), :pointer, :int],
34
+ FFI::OGR::Core::Err
35
35
  attach_function :OGR_G_CreateFromWkt,
36
- [:pointer, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH), :pointer],
37
- FFI::OGR::Core::Err
36
+ [:pointer, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH), :pointer],
37
+ FFI::OGR::Core::Err
38
38
  attach_function :OGR_G_CreateFromFgf,
39
- [:string, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH), :pointer, :int, :pointer],
40
- FFI::OGR::Core::Err
39
+ [:string, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH), :pointer, :int, :pointer],
40
+ FFI::OGR::Core::Err
41
41
 
42
42
  # ~~~~~~~~~~~~~~~~
43
43
  # Geometry-related
@@ -45,12 +45,12 @@ module FFI
45
45
  attach_function :OGR_G_DestroyGeometry, %i[OGRGeometryH], :void
46
46
  attach_function :OGR_G_CreateGeometry, [FFI::OGR::Core::WKBGeometryType], :OGRGeometryH
47
47
  attach_function :OGR_G_ApproximateArcAngles,
48
- [
49
- :double, :double, :double, # X, Y, Z
50
- :double, :double, :double, # primary radius, 2nd Axis, rotation
51
- :double, :double, :double # start angle, end angle, max angle step size
52
- ],
53
- :OGRGeometryH
48
+ [
49
+ :double, :double, :double, # X, Y, Z
50
+ :double, :double, :double, # primary radius, 2nd Axis, rotation
51
+ :double, :double, :double # start angle, end angle, max angle step size
52
+ ],
53
+ :OGRGeometryH
54
54
 
55
55
  attach_function :OGR_G_ForceToPolygon, %i[OGRGeometryH], :OGRGeometryH
56
56
  attach_function :OGR_G_ForceToLineString, %i[OGRGeometryH], :OGRGeometryH
@@ -63,66 +63,67 @@ module FFI
63
63
  attach_function :OGR_G_SetCoordinateDimension, %i[OGRGeometryH int], :void
64
64
  attach_function :OGR_G_Clone, %i[OGRGeometryH], :OGRGeometryH
65
65
  attach_function :OGR_G_GetEnvelope,
66
- [:OGRGeometryH, FFI::OGR::Envelope.ptr],
67
- :void
66
+ [:OGRGeometryH, FFI::OGR::Envelope.ptr],
67
+ :void
68
68
  attach_function :OGR_G_GetEnvelope3D,
69
- [:OGRGeometryH, FFI::OGR::Envelope3D.ptr],
70
- :void
69
+ [:OGRGeometryH, FFI::OGR::Envelope3D.ptr],
70
+ :void
71
71
 
72
72
  attach_function :OGR_G_ImportFromWkb,
73
- %i[OGRGeometryH string int],
74
- FFI::OGR::Core::Err
73
+ %i[OGRGeometryH string int],
74
+ FFI::OGR::Core::Err
75
75
  attach_function :OGR_G_ExportToWkb,
76
- [:OGRGeometryH, FFI::OGR::Core::WKBByteOrder, :buffer_out],
77
- FFI::OGR::Core::Err
76
+ [:OGRGeometryH, FFI::OGR::Core::WKBByteOrder, :buffer_out],
77
+ FFI::OGR::Core::Err
78
78
  attach_function :OGR_G_WkbSize, %i[OGRGeometryH], :int
79
79
 
80
80
  attach_function :OGR_G_ImportFromWkt, %i[OGRGeometryH pointer], FFI::OGR::Core::Err
81
81
  attach_function :OGR_G_ExportToWkt, %i[OGRGeometryH pointer], FFI::OGR::Core::Err
82
+ attach_function :OGR_G_ExportToIsoWkt, %i[OGRGeometryH pointer], FFI::OGR::Core::Err
82
83
 
83
84
  attach_function :OGR_G_GetGeometryType, %i[OGRGeometryH], FFI::OGR::Core::WKBGeometryType
84
- attach_function :OGR_G_GetGeometryName, %i[OGRGeometryH], :string
85
+ attach_function :OGR_G_GetGeometryName, %i[OGRGeometryH], :strptr
85
86
  attach_function :OGR_G_DumpReadable,
86
- %i[OGRGeometryH pointer string],
87
- :void
87
+ %i[OGRGeometryH pointer string],
88
+ :void
88
89
  attach_function :OGR_G_FlattenTo2D, %i[OGRGeometryH], :void
89
90
  attach_function :OGR_G_CloseRings, %i[OGRGeometryH], :void
90
91
 
91
92
  attach_function :OGR_G_CreateFromGML, %i[string], :OGRGeometryH
92
- attach_function :OGR_G_ExportToGML, %i[OGRGeometryH], :string
93
- attach_function :OGR_G_ExportToGMLEx, %i[OGRGeometryH pointer], :string
93
+ attach_function :OGR_G_ExportToGML, %i[OGRGeometryH], :strptr
94
+ attach_function :OGR_G_ExportToGMLEx, %i[OGRGeometryH pointer], :strptr
94
95
  attach_function :OGR_G_CreateFromGMLTree,
95
- [FFI::CPL::XMLNode.ptr],
96
- :OGRGeometryH
96
+ [FFI::CPL::XMLNode.ptr],
97
+ :OGRGeometryH
97
98
  attach_function :OGR_G_ExportToGMLTree,
98
- %i[OGRGeometryH],
99
- FFI::CPL::XMLNode.ptr
99
+ %i[OGRGeometryH],
100
+ FFI::CPL::XMLNode.ptr
100
101
  attach_function :OGR_G_ExportEnvelopeToGMLTree,
101
- %i[OGRGeometryH],
102
- FFI::CPL::XMLNode.ptr
102
+ %i[OGRGeometryH],
103
+ FFI::CPL::XMLNode.ptr
103
104
 
104
- attach_function :OGR_G_ExportToKML, %i[OGRGeometryH string], :string
105
- attach_function :OGR_G_ExportToJson, %i[OGRGeometryH], :string
106
- attach_function :OGR_G_ExportToJsonEx, %i[OGRGeometryH string], :string
105
+ attach_function :OGR_G_ExportToKML, %i[OGRGeometryH string], :strptr
106
+ attach_function :OGR_G_ExportToJson, %i[OGRGeometryH], :strptr
107
+ attach_function :OGR_G_ExportToJsonEx, %i[OGRGeometryH pointer], :strptr
107
108
  attach_function :OGR_G_CreateGeometryFromJson, %i[string], :OGRGeometryH
108
109
 
109
110
  attach_function :OGR_G_AssignSpatialReference,
110
- [:OGRGeometryH, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)],
111
- :void
111
+ [:OGRGeometryH, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)],
112
+ :void
112
113
  attach_function :OGR_G_GetSpatialReference,
113
- %i[OGRGeometryH],
114
- FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)
114
+ %i[OGRGeometryH],
115
+ FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)
115
116
 
116
117
  attach_function :OGR_G_Transform,
117
- [:OGRGeometryH, FFI::OGR::SRSAPI.find_type(:OGRCoordinateTransformationH)],
118
- FFI::OGR::Core::Err
118
+ [:OGRGeometryH, FFI::OGR::SRSAPI.find_type(:OGRCoordinateTransformationH)],
119
+ FFI::OGR::Core::Err
119
120
  attach_function :OGR_G_TransformTo,
120
- [:OGRGeometryH, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)],
121
- FFI::OGR::Core::Err
121
+ [:OGRGeometryH, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)],
122
+ FFI::OGR::Core::Err
122
123
  attach_function :OGR_G_Simplify, %i[OGRGeometryH double], :OGRGeometryH
123
124
  attach_function :OGR_G_SimplifyPreserveTopology,
124
- %i[OGRGeometryH double],
125
- :OGRGeometryH
125
+ %i[OGRGeometryH double],
126
+ :OGRGeometryH
126
127
  attach_function :OGR_G_Segmentize, %i[OGRGeometryH double], :void
127
128
  attach_function :OGR_G_Intersects, %i[OGRGeometryH OGRGeometryH], :bool
128
129
  attach_function :OGR_G_Equals, %i[OGRGeometryH OGRGeometryH], :bool
@@ -137,31 +138,31 @@ module FFI
137
138
  attach_function :OGR_G_ConvexHull, %i[OGRGeometryH], :OGRGeometryH
138
139
  attach_function :OGR_G_Buffer, %i[OGRGeometryH double int], :OGRGeometryH
139
140
  attach_function :OGR_G_Intersection,
140
- %i[OGRGeometryH OGRGeometryH],
141
- :OGRGeometryH
141
+ %i[OGRGeometryH OGRGeometryH],
142
+ :OGRGeometryH
142
143
  attach_function :OGR_G_Union,
143
- %i[OGRGeometryH OGRGeometryH],
144
- :OGRGeometryH
144
+ %i[OGRGeometryH OGRGeometryH],
145
+ :OGRGeometryH
145
146
  attach_function :OGR_G_UnionCascaded, %i[OGRGeometryH], :OGRGeometryH
146
147
  attach_function :OGR_G_PointOnSurface, %i[OGRGeometryH], :OGRGeometryH
147
148
  attach_function :OGR_G_Difference,
148
- %i[OGRGeometryH OGRGeometryH],
149
- :OGRGeometryH
149
+ %i[OGRGeometryH OGRGeometryH],
150
+ :OGRGeometryH
150
151
  attach_function :OGR_G_SymDifference,
151
- %i[OGRGeometryH OGRGeometryH],
152
- :OGRGeometryH
152
+ %i[OGRGeometryH OGRGeometryH],
153
+ :OGRGeometryH
153
154
  attach_function :OGR_G_Distance,
154
- %i[OGRGeometryH OGRGeometryH],
155
- :double
155
+ %i[OGRGeometryH OGRGeometryH],
156
+ :double
156
157
  attach_function :OGR_G_Length,
157
- %i[OGRGeometryH],
158
- :double
158
+ %i[OGRGeometryH],
159
+ :double
159
160
  attach_function :OGR_G_Area,
160
- %i[OGRGeometryH],
161
- :double
161
+ %i[OGRGeometryH],
162
+ :double
162
163
  attach_function :OGR_G_Centroid,
163
- %i[OGRGeometryH OGRGeometryH],
164
- :int
164
+ %i[OGRGeometryH OGRGeometryH],
165
+ :int
165
166
  attach_function :OGR_G_Empty, %i[OGRGeometryH], :void
166
167
  attach_function :OGR_G_IsEmpty, %i[OGRGeometryH], :bool
167
168
  attach_function :OGR_G_IsValid, %i[OGRGeometryH], :bool
@@ -171,32 +172,32 @@ module FFI
171
172
  attach_function :OGR_G_Polygonize, %i[OGRGeometryH], :OGRGeometryH
172
173
  attach_function :OGR_G_GetPointCount, %i[OGRGeometryH], :int
173
174
  attach_function :OGR_G_GetPoints,
174
- %i[OGRGeometryH buffer_out int buffer_out int buffer_out int],
175
- :int
175
+ %i[OGRGeometryH buffer_out int buffer_out int buffer_out int],
176
+ :int
176
177
  attach_function :OGR_G_GetX, %i[OGRGeometryH int], :double
177
178
  attach_function :OGR_G_GetY, %i[OGRGeometryH int], :double
178
179
  attach_function :OGR_G_GetZ, %i[OGRGeometryH int], :double
179
180
  attach_function :OGR_G_GetPoint,
180
- %i[OGRGeometryH int pointer pointer pointer],
181
- :double
181
+ %i[OGRGeometryH int pointer pointer pointer],
182
+ :double
182
183
  attach_function :OGR_G_SetPointCount,
183
- %i[OGRGeometryH int],
184
- :void
184
+ %i[OGRGeometryH int],
185
+ :void
185
186
  attach_function :OGR_G_SetPoint,
186
- %i[OGRGeometryH int double double double],
187
- :void
187
+ %i[OGRGeometryH int double double double],
188
+ :void
188
189
  attach_function :OGR_G_SetPoint_2D,
189
- %i[OGRGeometryH int double double],
190
- :void
190
+ %i[OGRGeometryH int double double],
191
+ :void
191
192
  attach_function :OGR_G_AddPoint,
192
- %i[OGRGeometryH double double double],
193
- :void
193
+ %i[OGRGeometryH double double double],
194
+ :void
194
195
  attach_function :OGR_G_AddPoint_2D,
195
- %i[OGRGeometryH double double],
196
- :void
196
+ %i[OGRGeometryH double double],
197
+ :void
197
198
  attach_function :OGR_G_SetPoints,
198
- %i[OGRGeometryH int pointer int pointer int pointer int],
199
- :void
199
+ %i[OGRGeometryH int pointer int pointer int pointer int],
200
+ :void
200
201
 
201
202
  attach_function :OGR_G_GetGeometryCount, %i[OGRGeometryH], :int
202
203
  attach_function :OGR_G_GetGeometryRef, %i[OGRGeometryH int], :OGRGeometryH
@@ -206,8 +207,8 @@ module FFI
206
207
  attach_function :OGR_G_RemoveGeometry, %i[OGRGeometryH int bool], FFI::OGR::Core::Err
207
208
 
208
209
  attach_function :OGRBuildPolygonFromEdges,
209
- %i[OGRGeometryH bool bool double pointer],
210
- :OGRGeometryH
210
+ %i[OGRGeometryH bool bool double pointer],
211
+ :OGRGeometryH
211
212
 
212
213
  # ~~~~~~~~~~~~~~~~
213
214
  # Field-related
@@ -215,7 +216,7 @@ module FFI
215
216
  attach_function :OGR_Fld_Create, [:string, FFI::OGR::Core::FieldType], :OGRFieldDefnH
216
217
  attach_function :OGR_Fld_Destroy, %i[OGRFieldDefnH], :void
217
218
  attach_function :OGR_Fld_SetName, %i[OGRFieldDefnH string], :void
218
- attach_function :OGR_Fld_GetNameRef, %i[OGRFieldDefnH], :string
219
+ attach_function :OGR_Fld_GetNameRef, %i[OGRFieldDefnH], :strptr
219
220
  attach_function :OGR_Fld_GetType, %i[OGRFieldDefnH], FFI::OGR::Core::FieldType
220
221
  attach_function :OGR_Fld_SetType, [:OGRFieldDefnH, FFI::OGR::Core::FieldType], :void
221
222
  attach_function :OGR_Fld_GetJustify, %i[OGRFieldDefnH], FFI::OGR::Core::Justification
@@ -226,32 +227,32 @@ module FFI
226
227
  attach_function :OGR_Fld_SetPrecision, %i[OGRFieldDefnH int], :void
227
228
 
228
229
  attach_function :OGR_Fld_Set,
229
- [:OGRFieldDefnH, :string, FFI::OGR::Core::FieldType, :int, :int, FFI::OGR::Core::Justification],
230
- :void
230
+ [:OGRFieldDefnH, :string, FFI::OGR::Core::FieldType, :int, :int, FFI::OGR::Core::Justification],
231
+ :void
231
232
  attach_function :OGR_Fld_IsIgnored, %i[OGRFieldDefnH], :bool
232
233
  attach_function :OGR_Fld_SetIgnored, %i[OGRFieldDefnH bool], :void
233
234
 
234
- attach_function :OGR_GetFieldTypeName, [FFI::OGR::Core::FieldType], :string
235
+ attach_function :OGR_GetFieldTypeName, [FFI::OGR::Core::FieldType], :strptr
235
236
 
236
237
  # ~~~~~~~~~~~~~~~~
237
238
  # Geometry Field-related
238
239
  # ~~~~~~~~~~~~~~~~
239
240
  attach_function :OGR_GFld_Create,
240
- [:string, FFI::OGR::Core::WKBGeometryType],
241
- :OGRGeomFieldDefnH
241
+ [:string, FFI::OGR::Core::WKBGeometryType],
242
+ :OGRGeomFieldDefnH
242
243
  attach_function :OGR_GFld_Destroy, %i[OGRGeomFieldDefnH], :void
243
244
  attach_function :OGR_GFld_SetName, %i[OGRGeomFieldDefnH string], :void
244
- attach_function :OGR_GFld_GetNameRef, %i[OGRGeomFieldDefnH], :string
245
+ attach_function :OGR_GFld_GetNameRef, %i[OGRGeomFieldDefnH], :strptr
245
246
  attach_function :OGR_GFld_GetType, %i[OGRGeomFieldDefnH], FFI::OGR::Core::WKBGeometryType
246
247
  attach_function :OGR_GFld_SetType,
247
- [:OGRGeomFieldDefnH, FFI::OGR::Core::WKBGeometryType],
248
- :void
248
+ [:OGRGeomFieldDefnH, FFI::OGR::Core::WKBGeometryType],
249
+ :void
249
250
  attach_function :OGR_GFld_GetSpatialRef,
250
- %i[OGRGeomFieldDefnH],
251
- FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)
251
+ %i[OGRGeomFieldDefnH],
252
+ FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)
252
253
  attach_function :OGR_GFld_SetSpatialRef,
253
- [:OGRGeomFieldDefnH, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)],
254
- :void
254
+ [:OGRGeomFieldDefnH, FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH)],
255
+ :void
255
256
  attach_function :OGR_GFld_IsIgnored, %i[OGRGeomFieldDefnH], :bool
256
257
  attach_function :OGR_GFld_SetIgnored, %i[OGRGeomFieldDefnH bool], :void
257
258
 
@@ -261,20 +262,20 @@ module FFI
261
262
  attach_function :OGR_FD_Create, %i[string], :OGRFeatureDefnH
262
263
  attach_function :OGR_FD_Destroy, %i[OGRFeatureDefnH], :void
263
264
  attach_function :OGR_FD_Release, %i[OGRFeatureDefnH], :void
264
- attach_function :OGR_FD_GetName, %i[OGRFeatureDefnH], :string
265
+ attach_function :OGR_FD_GetName, %i[OGRFeatureDefnH], :strptr
265
266
  attach_function :OGR_FD_GetFieldCount, %i[OGRFeatureDefnH], :int
266
267
  attach_function :OGR_FD_GetFieldDefn, %i[OGRFeatureDefnH int], :OGRFieldDefnH
267
268
  attach_function :OGR_FD_GetFieldIndex, %i[OGRFeatureDefnH string], :int
268
269
  attach_function :OGR_FD_AddFieldDefn,
269
- %i[OGRFeatureDefnH OGRFieldDefnH],
270
- :void
270
+ %i[OGRFeatureDefnH OGRFieldDefnH],
271
+ :void
271
272
  attach_function :OGR_FD_DeleteFieldDefn,
272
- %i[OGRFeatureDefnH int],
273
- FFI::OGR::Core::Err
273
+ %i[OGRFeatureDefnH int],
274
+ FFI::OGR::Core::Err
274
275
  attach_function :OGR_FD_GetGeomType, %i[OGRFeatureDefnH], FFI::OGR::Core::WKBGeometryType
275
276
  attach_function :OGR_FD_SetGeomType,
276
- [:OGRFeatureDefnH, FFI::OGR::Core::WKBGeometryType],
277
- :void
277
+ [:OGRFeatureDefnH, FFI::OGR::Core::WKBGeometryType],
278
+ :void
278
279
  attach_function :OGR_FD_IsGeometryIgnored, %i[OGRFeatureDefnH], :bool
279
280
  attach_function :OGR_FD_SetGeometryIgnored, %i[OGRFeatureDefnH bool], :void
280
281
  attach_function :OGR_FD_IsStyleIgnored, %i[OGRFeatureDefnH], :bool
@@ -284,21 +285,21 @@ module FFI
284
285
  attach_function :OGR_FD_GetReferenceCount, %i[OGRFeatureDefnH], :int
285
286
  attach_function :OGR_FD_GetGeomFieldCount, %i[OGRFeatureDefnH], :int
286
287
  attach_function :OGR_FD_GetGeomFieldDefn,
287
- %i[OGRFeatureDefnH int],
288
- :OGRGeomFieldDefnH
288
+ %i[OGRFeatureDefnH int],
289
+ :OGRGeomFieldDefnH
289
290
  attach_function :OGR_FD_GetGeomFieldIndex,
290
- %i[OGRFeatureDefnH string],
291
- :int
291
+ %i[OGRFeatureDefnH string],
292
+ :int
292
293
  attach_function :OGR_FD_AddGeomFieldDefn,
293
- %i[OGRFeatureDefnH OGRGeomFieldDefnH],
294
- :void
294
+ %i[OGRFeatureDefnH OGRGeomFieldDefnH],
295
+ :void
295
296
  attach_function :OGR_FD_DeleteGeomFieldDefn,
296
- %i[OGRFeatureDefnH int],
297
- FFI::OGR::Core::Err
297
+ %i[OGRFeatureDefnH int],
298
+ FFI::OGR::Core::Err
298
299
 
299
300
  attach_function :OGR_FD_IsSame,
300
- %i[OGRFeatureDefnH OGRFeatureDefnH],
301
- :bool
301
+ %i[OGRFeatureDefnH OGRFeatureDefnH],
302
+ :bool
302
303
 
303
304
  # ~~~~~~~~~~~~~~~~
304
305
  # Feature-related
@@ -307,11 +308,11 @@ module FFI
307
308
  attach_function :OGR_F_Destroy, %i[OGRFeatureH], :void
308
309
  attach_function :OGR_F_GetDefnRef, %i[OGRFeatureH], :OGRFeatureDefnH
309
310
  attach_function :OGR_F_SetGeometryDirectly,
310
- %i[OGRFeatureH OGRGeometryH],
311
- FFI::OGR::Core::Err
311
+ %i[OGRFeatureH OGRGeometryH],
312
+ FFI::OGR::Core::Err
312
313
  attach_function :OGR_F_SetGeometry,
313
- %i[OGRFeatureH OGRGeometryH],
314
- FFI::OGR::Core::Err
314
+ %i[OGRFeatureH OGRGeometryH],
315
+ FFI::OGR::Core::Err
315
316
  attach_function :OGR_F_GetGeometryRef, %i[OGRFeatureH], :OGRGeometryH
316
317
  attach_function :OGR_F_StealGeometry, %i[OGRFeatureH], :OGRGeometryH
317
318
 
@@ -326,14 +327,14 @@ module FFI
326
327
 
327
328
  attach_function :OGR_F_GetFieldAsInteger, %i[OGRFeatureH int], :int
328
329
  attach_function :OGR_F_GetFieldAsDouble, %i[OGRFeatureH int], :double
329
- attach_function :OGR_F_GetFieldAsString, %i[OGRFeatureH int], :string
330
+ attach_function :OGR_F_GetFieldAsString, %i[OGRFeatureH int], :strptr
330
331
  attach_function :OGR_F_GetFieldAsIntegerList, %i[OGRFeatureH int pointer], :pointer
331
332
  attach_function :OGR_F_GetFieldAsDoubleList, %i[OGRFeatureH int pointer], :pointer
332
333
  attach_function :OGR_F_GetFieldAsStringList, %i[OGRFeatureH int], :pointer
333
334
  attach_function :OGR_F_GetFieldAsBinary, %i[OGRFeatureH int pointer], :pointer
334
335
  attach_function :OGR_F_GetFieldAsDateTime,
335
- %i[OGRFeatureH int pointer pointer pointer pointer pointer pointer pointer],
336
- :int
336
+ %i[OGRFeatureH int pointer pointer pointer pointer pointer pointer pointer],
337
+ :int
337
338
  attach_function :OGR_F_SetFieldInteger, %i[OGRFeatureH int int], :void
338
339
  attach_function :OGR_F_SetFieldDouble, %i[OGRFeatureH int double], :void
339
340
  attach_function :OGR_F_SetFieldString, %i[OGRFeatureH int string], :void
@@ -343,8 +344,8 @@ module FFI
343
344
  attach_function :OGR_F_SetFieldRaw, [:OGRFeatureH, :int, FFI::OGR::Field.ptr], :void
344
345
  attach_function :OGR_F_SetFieldBinary, %i[OGRFeatureH int int pointer], :void
345
346
  attach_function :OGR_F_SetFieldDateTime,
346
- %i[OGRFeatureH int int int int int int int int],
347
- :void
347
+ %i[OGRFeatureH int int int int int int int int],
348
+ :void
348
349
 
349
350
  attach_function :OGR_F_GetGeomFieldCount, %i[OGRFeatureH], :int
350
351
  attach_function :OGR_F_GetGeomFieldDefnRef, %i[OGRFeatureH int], :OGRGeomFieldDefnH
@@ -359,7 +360,7 @@ module FFI
359
360
  attach_function :OGR_F_SetFrom, %i[OGRFeatureH OGRFeatureH int], FFI::OGR::Core::Err
360
361
  attach_function :OGR_F_SetFromWithMap, %i[OGRFeatureH OGRFeatureH int pointer], FFI::OGR::Core::Err
361
362
 
362
- attach_function :OGR_F_GetStyleString, %i[OGRFeatureH], :string
363
+ attach_function :OGR_F_GetStyleString, %i[OGRFeatureH], :strptr
363
364
  attach_function :OGR_F_SetStyleString, %i[OGRFeatureH string], :void
364
365
  attach_function :OGR_F_SetStyleStringDirectly, %i[OGRFeatureH string], :void
365
366
  attach_function :OGR_F_GetStyleTable, %i[OGRFeatureH], :OGRStyleTableH
@@ -369,17 +370,17 @@ module FFI
369
370
  # ~~~~~~~~~~~~~~~~
370
371
  # Layer-related
371
372
  # ~~~~~~~~~~~~~~~~
372
- attach_function :OGR_L_GetName, %i[OGRLayerH], :string
373
+ attach_function :OGR_L_GetName, %i[OGRLayerH], :strptr
373
374
  attach_function :OGR_L_GetGeomType, %i[OGRLayerH], FFI::OGR::Core::WKBGeometryType
374
375
  attach_function :OGR_L_GetSpatialFilter, %i[OGRLayerH], :OGRGeometryH
375
376
  attach_function :OGR_L_SetSpatialFilter, %i[OGRLayerH OGRGeometryH], :void
376
377
  attach_function :OGR_L_SetSpatialFilterRect,
377
- %i[OGRLayerH double double double double],
378
- :void
378
+ %i[OGRLayerH double double double double],
379
+ :void
379
380
  attach_function :OGR_L_SetSpatialFilterEx, %i[OGRLayerH int OGRGeometryH], :void
380
381
  attach_function :OGR_L_SetSpatialFilterRectEx,
381
- %i[OGRLayerH int double double double double],
382
- :void
382
+ %i[OGRLayerH int double double double double],
383
+ :void
383
384
  attach_function :OGR_L_SetAttributeFilter, %i[OGRLayerH string], FFI::OGR::Core::Err
384
385
  attach_function :OGR_L_ResetReading, %i[OGRLayerH], :void
385
386
 
@@ -396,13 +397,13 @@ module FFI
396
397
 
397
398
  attach_function :OGR_L_GetExtent, [:OGRLayerH, FFI::OGR::Envelope.ptr, :bool], FFI::OGR::Core::Err
398
399
  attach_function :OGR_L_GetExtentEx,
399
- [:OGRLayerH, :int, FFI::OGR::Envelope.ptr, :bool],
400
- FFI::OGR::Core::Err
400
+ [:OGRLayerH, :int, FFI::OGR::Envelope.ptr, :bool],
401
+ FFI::OGR::Core::Err
401
402
  attach_function :OGR_L_TestCapability, %i[OGRLayerH string], :bool
402
403
  attach_function :OGR_L_CreateField, %i[OGRLayerH OGRFieldDefnH bool], FFI::OGR::Core::Err
403
404
  attach_function :OGR_L_CreateGeomField,
404
- %i[OGRLayerH OGRGeomFieldDefnH bool],
405
- FFI::OGR::Core::Err
405
+ %i[OGRLayerH OGRGeomFieldDefnH bool],
406
+ FFI::OGR::Core::Err
406
407
  attach_function :OGR_L_DeleteField, %i[OGRLayerH int], FFI::OGR::Core::Err
407
408
  attach_function :OGR_L_ReorderFields, %i[OGRLayerH pointer], FFI::OGR::Core::Err
408
409
  attach_function :OGR_L_ReorderField, %i[OGRLayerH int int], FFI::OGR::Core::Err
@@ -418,79 +419,86 @@ module FFI
418
419
  attach_function :OGR_L_SyncToDisk, %i[OGRLayerH], FFI::OGR::Core::Err
419
420
 
420
421
  attach_function :OGR_L_GetFeaturesRead, %i[OGRLayerH], CPL::Port.find_type(:GIntBig)
421
- attach_function :OGR_L_GetFIDColumn, %i[OGRLayerH], :string
422
- attach_function :OGR_L_GetGeometryColumn, %i[OGRLayerH], :string
422
+ attach_function :OGR_L_GetFIDColumn, %i[OGRLayerH], :strptr
423
+ attach_function :OGR_L_GetGeometryColumn, %i[OGRLayerH], :strptr
423
424
  attach_function :OGR_L_GetStyleTable, %i[OGRLayerH], :OGRStyleTableH
424
425
  attach_function :OGR_L_SetStyleTableDirectly, %i[OGRLayerH OGRStyleTableH], :void
425
426
  attach_function :OGR_L_SetStyleTable, %i[OGRLayerH OGRStyleTableH], :void
426
427
  attach_function :OGR_L_SetIgnoredFields, %i[OGRLayerH pointer], FFI::OGR::Core::Err
427
428
 
428
429
  attach_function :OGR_L_Intersection,
429
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
430
- FFI::OGR::Core::Err
430
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
431
+ :pointer],
432
+ FFI::OGR::Core::Err
431
433
  attach_function :OGR_L_Union,
432
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
433
- FFI::OGR::Core::Err
434
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
435
+ :pointer],
436
+ FFI::OGR::Core::Err
434
437
  attach_function :OGR_L_SymDifference,
435
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
436
- FFI::OGR::Core::Err
438
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
439
+ :pointer],
440
+ FFI::OGR::Core::Err
437
441
  attach_function :OGR_L_Identity,
438
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
439
- FFI::OGR::Core::Err
442
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
443
+ :pointer],
444
+ FFI::OGR::Core::Err
440
445
  attach_function :OGR_L_Update,
441
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
442
- FFI::OGR::Core::Err
446
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
447
+ :pointer],
448
+ FFI::OGR::Core::Err
443
449
  attach_function :OGR_L_Clip,
444
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
445
- FFI::OGR::Core::Err
450
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
451
+ :pointer],
452
+ FFI::OGR::Core::Err
446
453
  attach_function :OGR_L_Erase,
447
- [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc), :pointer],
448
- FFI::OGR::Core::Err
454
+ [:OGRLayerH, :OGRLayerH, :OGRLayerH, :pointer, FFI::GDAL::GDAL.find_type(:GDALProgressFunc),
455
+ :pointer],
456
+ FFI::OGR::Core::Err
449
457
 
450
458
  # ~~~~~~~~~~~~~~~~
451
459
  # DataSource-related
452
460
  # ~~~~~~~~~~~~~~~~
453
461
  attach_function :OGR_DS_Destroy, %i[OGRDataSourceH], :void
454
- attach_function :OGR_DS_GetName, %i[OGRDataSourceH], :string
462
+ attach_function :OGR_DS_GetName, %i[OGRDataSourceH], :pointer
455
463
  attach_function :OGR_DS_GetLayerCount, %i[OGRDataSourceH], :int
456
464
  attach_function :OGR_DS_GetLayer, %i[OGRDataSourceH int], :OGRLayerH
457
465
  attach_function :OGR_DS_GetLayerByName, %i[OGRDataSourceH string], :OGRLayerH
458
466
  attach_function :OGR_DS_DeleteLayer, %i[OGRDataSourceH int], FFI::OGR::Core::Err
459
467
  attach_function :OGR_DS_GetDriver, %i[OGRDataSourceH], :OGRSFDriverH
460
468
  attach_function :OGR_DS_CreateLayer,
461
- [
462
- :OGRDataSourceH,
463
- :string,
464
- FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH),
465
- FFI::OGR::Core::WKBGeometryType, :pointer
466
- ],
467
- :OGRLayerH
469
+ [
470
+ :OGRDataSourceH,
471
+ :string,
472
+ FFI::OGR::SRSAPI.find_type(:OGRSpatialReferenceH),
473
+ FFI::OGR::Core::WKBGeometryType, :pointer
474
+ ],
475
+ :OGRLayerH
468
476
  attach_function :OGR_DS_CopyLayer,
469
- %i[OGRDataSourceH OGRLayerH string pointer],
470
- :OGRLayerH
477
+ %i[OGRDataSourceH OGRLayerH string pointer],
478
+ :OGRLayerH
471
479
  attach_function :OGR_DS_TestCapability, %i[OGRDataSourceH string], :bool
472
480
  attach_function :OGR_DS_ExecuteSQL,
473
- %i[OGRDataSourceH string OGRGeometryH string],
474
- :OGRLayerH
481
+ %i[OGRDataSourceH string OGRGeometryH string],
482
+ :OGRLayerH
475
483
  attach_function :OGR_DS_ReleaseResultSet, %i[OGRDataSourceH OGRLayerH], :void
476
484
 
477
485
  attach_function :OGR_DS_SyncToDisk, %i[OGRDataSourceH], FFI::OGR::Core::Err
478
486
  attach_function :OGR_DS_GetStyleTable, %i[OGRDataSourceH], :OGRStyleTableH
479
487
  attach_function :OGR_DS_SetStyleTableDirectly,
480
- %i[OGRDataSourceH OGRStyleTableH],
481
- :void
488
+ %i[OGRDataSourceH OGRStyleTableH],
489
+ :void
482
490
  attach_function :OGR_DS_SetStyleTable, %i[OGRDataSourceH OGRStyleTableH], :void
483
491
 
484
492
  # ~~~~~~~~~~~~~~~~
485
493
  # Driver-related
486
494
  # ~~~~~~~~~~~~~~~~
487
- attach_function :OGR_Dr_GetName, %i[OGRSFDriverH], :string
495
+ attach_function :OGR_Dr_GetName, %i[OGRSFDriverH], :strptr
488
496
  attach_function :OGR_Dr_Open, %i[OGRSFDriverH string bool], :OGRDataSourceH
489
497
  attach_function :OGR_Dr_TestCapability, %i[OGRSFDriverH string], :bool
490
498
  attach_function :OGR_Dr_CreateDataSource, %i[OGRSFDriverH string pointer], :OGRDataSourceH
491
499
  attach_function :OGR_Dr_CopyDataSource,
492
- %i[OGRSFDriverH OGRDataSourceH string pointer],
493
- :OGRDataSourceH
500
+ %i[OGRSFDriverH OGRDataSourceH string pointer],
501
+ :OGRDataSourceH
494
502
  attach_function :OGR_Dr_DeleteDataSource, %i[OGRSFDriverH string], FFI::OGR::Core::Err
495
503
 
496
504
  # ~~~~~~~~~~~~~~~~
@@ -498,12 +506,12 @@ module FFI
498
506
  # ~~~~~~~~~~~~~~~~
499
507
  attach_function :OGR_SM_Create, %i[OGRStyleTableH], :OGRStyleMgrH
500
508
  attach_function :OGR_SM_Destroy, %i[OGRStyleTableH], :void
501
- attach_function :OGR_SM_InitFromFeature, %i[OGRStyleTableH OGRFeatureH], :string
509
+ attach_function :OGR_SM_InitFromFeature, %i[OGRStyleTableH OGRFeatureH], :strptr
502
510
  attach_function :OGR_SM_InitStyleString, %i[OGRStyleTableH string], :int
503
511
  attach_function :OGR_SM_GetPartCount, %i[OGRStyleTableH string], :int
504
512
  attach_function :OGR_SM_GetPart,
505
- %i[OGRStyleTableH int string],
506
- :OGRStyleToolH
513
+ %i[OGRStyleTableH int string],
514
+ :OGRStyleToolH
507
515
  attach_function :OGR_SM_AddPart, %i[OGRStyleTableH OGRStyleToolH], :int
508
516
  attach_function :OGR_SM_AddStyle, %i[OGRStyleTableH string string], :int
509
517
 
@@ -515,16 +523,16 @@ module FFI
515
523
  attach_function :OGR_ST_GetType, %i[OGRStyleToolH], FFI::OGR::Core::STClassId
516
524
  attach_function :OGR_ST_GetUnit, %i[OGRStyleToolH], FFI::OGR::Core::STUnitId
517
525
  attach_function :OGR_ST_SetUnit, [:OGRStyleToolH, FFI::OGR::Core::STUnitId, :double], :void
518
- attach_function :OGR_ST_GetParamStr, %i[OGRStyleToolH int pointer], :string
526
+ attach_function :OGR_ST_GetParamStr, %i[OGRStyleToolH int pointer], :strptr
519
527
  attach_function :OGR_ST_GetParamNum, %i[OGRStyleToolH int pointer], :int
520
528
  attach_function :OGR_ST_GetParamDbl, %i[OGRStyleToolH int pointer], :double
521
529
  attach_function :OGR_ST_SetParamStr, %i[OGRStyleToolH int string], :void
522
530
  attach_function :OGR_ST_SetParamNum, %i[OGRStyleToolH int int], :void
523
531
  attach_function :OGR_ST_SetParamDbl, %i[OGRStyleToolH int double], :void
524
- attach_function :OGR_ST_GetStyleString, %i[OGRStyleToolH], :string
532
+ attach_function :OGR_ST_GetStyleString, %i[OGRStyleToolH], :strptr
525
533
  attach_function :OGR_ST_GetRGBFromString,
526
- %i[OGRStyleToolH string pointer pointer pointer pointer],
527
- :bool
534
+ %i[OGRStyleToolH string pointer pointer pointer pointer],
535
+ :bool
528
536
 
529
537
  # ~~~~~~~~~~~~~~~~
530
538
  # Style Table-related
@@ -6,10 +6,10 @@ module FFI
6
6
  module OGR
7
7
  class ContourWriterInfo < FFI::Struct
8
8
  layout :layer, :pointer,
9
- :geo_transform, [:double, 6],
10
- :elev_field, :int,
11
- :id_field, :int,
12
- :next_id, :int
9
+ :geo_transform, [:double, 6],
10
+ :elev_field, :int,
11
+ :id_field, :int,
12
+ :next_id, :int
13
13
  end
14
14
  end
15
15
  end