Skip to content

[POC] feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings#678

Draft
Kontinuation wants to merge 8 commits intoapache:mainfrom
Kontinuation:feat/sedona-gdal
Draft

[POC] feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings#678
Kontinuation wants to merge 8 commits intoapache:mainfrom
Kontinuation:feat/sedona-gdal

Conversation

@Kontinuation
Copy link
Member

Summary

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-gdal crate with runtime-loaded GDAL API table, core wrappers (dataset/driver/raster/vector/VSI/VRT), and tests (behind gdal-sys).
  • Expose a gdal feature in the sedona crate to enable sedona-gdal/gdal-sys for 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.

@Kontinuation Kontinuation changed the title feat(gdal): add sedona-gdal crate with runtime-loaded GDAL bindings feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings Mar 3, 2026
@Kontinuation
Copy link
Member Author

This PR is pretty large. I think we can split it into 2 PRs:

  1. Dynamically loaded bindings exposing unsafe API
  2. High level safe APIs

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.
@Kontinuation Kontinuation changed the title feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings [POC] feat(c/sedona-gdal): add sedona-gdal crate with runtime-loaded GDAL bindings Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants