[POC] feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings#678
Draft
Kontinuation wants to merge 8 commits intoapache:mainfrom
Draft
[POC] feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings#678Kontinuation wants to merge 8 commits intoapache:mainfrom
Kontinuation wants to merge 8 commits intoapache:mainfrom
Conversation
4c42ff5 to
fd8a2c9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new sedona-gdal crate that provides safe Rust wrappers over selected GDAL C APIs via runtime dynamic loading (libloading), and wires it into the workspace + sedona crate feature flags/CI.
Changes:
- Add
c/sedona-gdalcrate with runtime-loaded GDAL API table, core wrappers (dataset/driver/raster/vector/VSI/VRT), and tests (behindgdal-sys). - Expose a
gdalfeature in thesedonacrate to enablesedona-gdal/gdal-sysfor downstream consumers. - Update workspace/lockfile and Linux CI to install GDAL development headers.
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/sedona/Cargo.toml | Adds gdal feature and workspace dependency on sedona-gdal. |
| c/sedona-gdal/src/vsi.rs | Adds /vsimem file create/unlink/read helpers + tests. |
| c/sedona-gdal/src/vrt.rs | Adds VRT dataset/band wrappers and VRT source helpers + tests. |
| c/sedona-gdal/src/vector/mod.rs | Introduces vector module namespace + re-exports. |
| c/sedona-gdal/src/vector/layer.rs | Adds OGR layer wrapper + feature iteration. |
| c/sedona-gdal/src/vector/geometry.rs | Adds owned geometry wrapper with WKB/WKT helpers. |
| c/sedona-gdal/src/vector/feature.rs | Adds owned feature wrapper and field/geometry accessors. |
| c/sedona-gdal/src/spatial_ref.rs | Adds spatial reference wrapper and PROJJSON export + tests. |
| c/sedona-gdal/src/register.rs | Adds global GDAL API initialization + (optional) version check. |
| c/sedona-gdal/src/raster/types.rs | Adds raster type enums, buffer type, dataset options, resampling. |
| c/sedona-gdal/src/raster/rasterize_affine.rs | Adds fast affine transformer path for rasterize + tests. |
| c/sedona-gdal/src/raster/rasterize.rs | Adds GDALRasterizeGeometries wrapper + option builder + tests. |
| c/sedona-gdal/src/raster/rasterband.rs | Adds raster band wrapper with typed read/write + nodata helpers + tests. |
| c/sedona-gdal/src/raster/polygonize.rs | Adds GDALPolygonize wrapper + options + tests. |
| c/sedona-gdal/src/raster/mod.rs | Defines raster module exports. |
| c/sedona-gdal/src/mem.rs | Adds high-level MEM dataset builder for zero-copy band attachment + tests. |
| c/sedona-gdal/src/lib.rs | Declares crate modules and public re-exports. |
| c/sedona-gdal/src/geo_transform.rs | Adds pure-Rust geotransform apply/invert helpers + tests. |
| c/sedona-gdal/src/gdal_dyn_bindgen.rs | Adds bindgen-like GDAL/OGR handle/types/constants + API table struct. |
| c/sedona-gdal/src/gdal_api.rs | Adds GdalApi wrapper around function table + CPL error extraction. |
| c/sedona-gdal/src/errors.rs | Adds GdalError + init errors used across the crate. |
| c/sedona-gdal/src/dyn_load.rs | Adds libloading-based symbol resolver for GDAL + C++ mangling handling. |
| c/sedona-gdal/src/driver.rs | Adds driver wrapper/lookup and dataset creation helpers + tests. |
| c/sedona-gdal/src/dataset.rs | Adds dataset wrapper, open/create/copy/layer creation + band attachment helpers + tests. |
| c/sedona-gdal/src/cpl.rs | Adds pure-Rust CSL string list compatible with GDAL’s char** options. |
| c/sedona-gdal/src/config.rs | Adds thread-local config option setter wrapper. |
| c/sedona-gdal/Cargo.toml | Adds new crate manifest, gdal-sys feature, and dev-deps. |
| Cargo.toml | Registers c/sedona-gdal as a workspace member + workspace dependency. |
| Cargo.lock | Adds gdal-sys and sedona-gdal entries to the lockfile. |
| .github/workflows/rust.yml | Installs libgdal-dev on Linux CI to support gdal-sys builds/tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
This PR is pretty large. I think we can split it into 2 PRs:
|
Add file-level doc comments to all safe GDAL API wrappers in c/sedona-gdal/src that were ported from georust/gdal v0.19.0, noting the original source URL and MIT license.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sedona-gdalcrate (c/sedona-gdal) providing safe Rust wrappers over GDAL C API functions, loaded dynamically at runtime vialibloading— following the same practice as the PROJ dynamic library binding introduced in refactor(c/sedona-proj): replace C dynamic loading with pure Rust using libloading #672.gdal-sysfeature flag from thesedonacrate for downstream consumers.