gdal-sys
Low level GDAL bindings for Rust. The build script will try to auto-detect the installed GDAL version.
Contains:
- mapping of data types
- raster (GDAL) and vector (OGR) operations
- error handling
- spatial reference operations
Build
The build script should work an Linux and Windows systems. It can be configured with a couple of environment variables:
- if
GDAL_INCLUDE_DIRorGDAL_LIB_DIRare defined, they will be used. You should also setGDAL_VERSIONtoX.Y.Z - otherwise, if
GDAL_HOMEis defined, the build script looks forGDAL_HOME/include,GDAL_HOME/libandGDAL_HOME/bin - finally,
pkg-configis queried to determine theGDALlocation - you can define
GDAL_STATICto linkGDALstatically
The include directories are only used if you choose to generate the bindings at build time.
On Linux, building should work out-of-the-box.
On Windows, the easiest solution is to point the GDAL_HOME environment variable to the GDAL folder.
windows-msvcrequiresgdal_i.libto be found in%GDAL_HOME%\lib.windows-gnurequires eithergdal_i.libin%GDAL_HOME%\libORgdal{version}.dllin%GDAL_HOME%\bin.
Generated bindings
By default, gdal-sys will detect the version of libgdal you have installed and
attempt to use prebuilt bindings corresponding to that version. Alternatively,
you can generate your own bindings from your libgdal installation by specifying
the bindgen feature.
