9 releases (breaking)

0.8.0 Nov 10, 2022
0.6.0 Jan 19, 2022
0.5.0 Aug 6, 2021
0.4.0 Apr 27, 2021
0.1.0 Oct 8, 2017

#95 in Build Utils

Download history 404/week @ 2022-08-19 536/week @ 2022-08-26 747/week @ 2022-09-02 963/week @ 2022-09-09 355/week @ 2022-09-16 413/week @ 2022-09-23 502/week @ 2022-09-30 611/week @ 2022-10-07 436/week @ 2022-10-14 796/week @ 2022-10-21 528/week @ 2022-10-28 616/week @ 2022-11-04 983/week @ 2022-11-11 671/week @ 2022-11-18 401/week @ 2022-11-25 444/week @ 2022-12-02

2,617 downloads per month
Used in 13 crates (4 directly)

MIT license

2.5MB
85K SLoC

gdal-sys

Build Status

Low level GDAL bindings for Rust. The build script will try to auto-dectect 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_DIR or GDAL_LIB_DIR are defined, they will be used
  • otherwise, if GDAL_HOME is defined, the build script looks for GDAL_HOME/include, GDAL_HOME/lib and GDAL_HOME/bin
  • finally, pkg-config is queried to determine the GDAL location
  • you can define GDAL_STATIC to link GDAL statically

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-msvc requires gdal_i.lib to be found in %GDAL_HOME%\lib.
  • windows-gnu requires either gdal_i.lib in %GDAL_HOME%\lib OR gdal{version}.dll in %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.

Dependencies