Skip to main content

Module gdalio

Module gdalio 

Source
Available on crate feature encoder only.
Expand description

A thin safe wrapper over the handful of GDAL C entry points the encoder needs.

The Python encoder shells out to gdalinfo -json and gdal_translate -of ENVI -ot Float64; this reads the same numbers in process, which is the whole point of the experiment — a production GFS run wrote and re-read several gigabytes of intermediate ENVI files per build.

Only gdal-sys (georust’s GDAL FFI crate) is used, not the high-level gdal crate: as of gdal 0.19 the safe wrapper does not compile against GDAL 3.13, whose GDALDataType and GDALRasterIOExtraArg changed shape. The surface used here is a dozen stable C functions, so binding them directly costs less than pinning an older GDAL.

Structs§

BandInfo
One band’s default-domain metadata plus its description, the two things gdalinfo -json reports that record matching reads.
Dataset
An open GDAL dataset. Not Sync: GDAL dataset handles must not be shared between threads, so each worker opens its own.

Functions§

info_json
The subset of gdalinfo -json that xuebuild actually reads, from the linked GDAL rather than the CLI.
needs_serial_access
Whether a GDAL connection string names a dataset that must be read under netcdf_guard. NetCDF subdatasets are spelled NETCDF:"<file>":<var>.
netcdf_guard
Hold this for as long as a netCDF dataset is open and being read.