telus-agcg / ffi-gdal

MIT License
80 stars 1 forks source link

feat: GDAL 3.8 support #103

Closed oleksii-leonov closed 3 months ago

oleksii-leonov commented 3 months ago

Adding support for GDAL 3.8 (and GDAL 3.6, which was not tested previously).

Major changes

Fixes GDAL Grid Options for GDAL 3.6+.

C structures for GDAL Grid Options were changed in GDAL 3.6.0 (and more changes are expected to be added in the next versions).

// https://gdal.org/api/gdal_alg.html#_CPPv426GDALGridDataMetricsOptions

struct GDALGridDataMetricsOptions
//  Public Members
    size_t nSizeOfStructure
//         Added in GDAL 3.6 to detect potential ABI issues. Should be set to sizeof(GDALGridDataMetricsOptions)
    double dfRadius1
//         The first radius (X axis if rotation angle is 0) of search ellipse.
// ...

To handle different GDAL Grid Options C structs for different GDAL versions, I have added LayoutVersionResolver and made minor refactoring for GridAlgorithms.

Minor changes

Breaking changes

None

Note

For the Ubuntu 24.04 GitHub Actions CI I got one flaky spec (randomly failing for any Ruby version; not happening on Ubuntu 20.04 or 22.04):

 Failures:

  1) OGR::DataSource#sync_to_disk 
     Failure/Error:
       OGR::ErrorHandling.handle_ogr_err("Unable to syn datasource to disk") do
         FFI::OGR::API.OGR_DS_SyncToDisk(@c_pointer)
       end

     OGR::Failure:
       Unable to syn datasource to disk
     # ./lib/ogr/data_source.rb:239:in `sync_to_disk'
     # ./spec/unit/ogr/data_source_spec.rb:227:in `block (3 levels) in <top (required)>'

So, some CI runs may fail on Ubuntu 24.04 due to this flaky spec. But I didn't manage to reproduce it easily, so I would prefer to fix it later as a separate PR.

oleksii-leonov commented 3 months ago

@tindron @turboladen

This one is ready to merge.