- Drop support for GDAL <3.4 (#578)
- Regenerate the pre-built bindings with
std::ffi
instead oflibc
for C types (#573) - Include OS-specific versions of the pre-built bindings (#574)
- Upgrade
ndarray
dependency to 0.16 (#569) - Upgrade
thiserror
dependency to 2.0 (#586) - Update
Feature::field
,Feature::set_field
,Feature::set_field_string
,Feature::set_field_string_list
,Feature::set_field_double
,Feature::set_field_double_list
,Feature::set_field_integer
,Feature::set_field_integer_list
,Feature::set_field_integer64
,Feature::set_field_integer64_list
,Feature::set_field_datetime
,Feature::set_field_null
,Feature::unset_field
to take a field index, not a name (#581) - Drop
Feature::field_as_integer_by_name
,Feature::field_as_integer64_by_name
,Feature::field_as_double_by_name
,Feature::field_as_string_by_name
,Feature::field_as_datetime_by_name
(#581) - Update
Feature::field_count
to returnusize
instead ofi32
(#581) - Update
Feature::field_as_integer
,Feature::field_as_integer64
,Feature::field_as_double
,Feature::field_as_string
,Feature::field_as_datetime
to take the field index asusize
instead ofi32
(#581) - Drop
LayerAccess::create_feature_fields
(#581) - Drop
Feature::geometry_by_name
(#594) - Update
SpatialRef::auth_name
,SpatialRef::name
,SpatialRef::angular_units_name
,SpatialRef::linear_units_name
to returnOption<String>
instead ofResult<String>
(#589)
- Add
Dataset::delete_layer
(#583) - Add
Dataset::has_capability
(#585) - Add a
bundled
feature forgdal-sys
for building and statically linking a minimal bundled version of GDAL (#517) - Add pre-built bindings for GDAL 3.10 (#573)
- Add methods
alternative_name
,is_nullable
,is_unique
,default_value
toField
(#561) - Add
Defn::geometry_type
(#562) - Add
Defn::field_index
andFeature::field_index
(#581) - Add
Defn::geometry_field_index
andFeature::geometry_field_index
(#594) - Add
Dataset::has_capability
for dataset capability check (#581)
- Fix conversion from
ndarray
when the data is offsetted from the start of the buffer (#569)
- Add
Buffer<T>::width
andBuffer<T>::height
(#550)
- Fix incorrect bounds check in
Buffer<T>
indexing (#550)
-
Added pre-built bindings for GDAL 3.9
-
Added
Rasterband::fill
-
Added
Dataset::rasterbands
. -
Added
no_data_value_u64
,set_no_data_value_u64
,no_data_value_i64
andset_no_data_value_i64
toRasterBand
. -
Breaking Removed
RasterCreationOption
and replaced usages of[RasterCreationOption]
withRasterCreationOptions
, a type alias forCplStringList
. -
Add
DriverIterator
format to iterate through drivers, as well asDriverManager::all()
method that provides the iterator. -
Breaking:
Feature::set_field_xxx
now take&mut self
-
Breaking: Drop support for GDAL 2.x
-
Added
DriverManager::get_output_driver_for_dataset_name
andDriverManager::get_output_drivers_for_dataset_name
for the ability to auto detect compatibleDriver
(s) for writing data. -
Added
Feature::unset_field
-
Added ability to convert between
Buffer<T>
andndarray::Array2<T>
. -
Implemented
IntoIterator
,Index
andIndexMut
forBuffer<T>
. -
Breaking:
Buffer<T>::size
is now private and accessed via `Buffer::shape(). -
Breaking:
Buffer<T>::data
is now private and accessed via `Buffer::data(). -
Breaking: Removed
Rasterband::read_as_array
, changed signature ofRasterband::read_block
to return aBuffer<T>
. -
Breaking:
Rasterband::write
andRasterband::write_block
now require a&mut Buffer<T>
to handle possible case of drivers temporarily mutating input buffer. -
Implemented
Feature::set_field_null
-
Breaking: Changed a number of APIs using
isize
whenusize
is semantically more appropriate:Driver::create.*
,Rasterband::overview
,Dataset::{layer|into_layer|layer_count}
. -
Created
enum AxisMappingStrategy
forOSRAxisMappingStrategy
ordinals. -
Breaking:
SpatialRef::{set_}axis_mapping_strategy
useAxisMappingStrategy
instead ofgdal_sys::OSRAxisMappingStrategy::Type
. -
Defers the
gdal_i.lib
missing message until after thepkg-config
check and outputspkg-config
metadata in case of a static build. -
Added
RasterBand::write_block
. -
RasterBand::read_block
now checks that the requested type matches the band type. -
Added
Geometry::difference
. -
Added support for digital elevation model raster processing:
aspect
,color_relief
,hillshade
,roughness
,slope
,terrain_ruggedness_index
,topographic_position_index
. -
Added pre-built bindings for GDAL 3.8
-
Added
{Display|FromStr} for ResampleAlg
andResampleAlg::iter
. -
Breaking: Replaced
TryFrom<&[(&str, &str); N]> for CslStringList
withimpl FromIterator<CslStringListEntry> for CslStringList
,impl FromIterator<String> for CslStringList
andimpl<'a> FromIterator<&'a str> for CslStringList
-
Added
Extend<CslStringListEntry> for CslStringList
, andCslStringList::merge
-
Breaking:
SpatialRef::set_axis_mapping_strategy
now takes&mut self
-
Breaking:
Dataset::raster_count
now returns anusize
andDataset::rasterband
now takesusize
instead ofisize
-
Breaking:
CslStringListIterator
returns aCslStringListEntry
instead of(String, String)
in order to differentiate betweenkey=value
entries vsflag
entries. -
Breaking:
CslStringList::fetch_name_value
returnsOption<String>
instead ofResult<Option<String>>
, better reflecting the semantics of GDAL C API. -
Added
CslStringList::get_field
,CslStringList::find_string
,CslStringList::partial_find_string
,CslStringList::find_string_case_sensitive
,CslStringList::into_ptr
,CslStringList::add_name_value
. -
Breaking:
ExtendedDataType
no longer implementsClone
,PartialEq
andEq
-
Breaking: Moved
LayerIterator
,LayerOptions
andTransaction
tocrate::vector
-
Accessors
MajorObject::gdal_object_ptr
andDataset::c_dataset()
are no longer marked asunsafe
(only using these is unsafe in idiomatic Rust) -
Fixed build script error with development GDAL versions
-
Added raster histogram methods (setter and getter)
-
Breaking:
Dataset::close
now consumesself
-
Gcp
andGcpRef
are now public -
Fixed build error with GDAL 3.1
-
Added
Geometry::flatten_to_2d
-
Breaking:
RasterBand::actual_block_size
now takes twousize
offsets instead of(isize, isize)
-
Added
GDT_Int8
support -
Added
Dataset::close
, changedDataset::flush_cache
to be fallible -
Added
SpatialRef::semi_major
,semi_minor
,set_proj_param
,get_proj_param
,get_proj_param_or_default
,set_attr_value
,get_attr_value
andgeog_cs
. -
Added
Dataset::gcp_projection
,Dataset::gcps
,Dataset::set_gcps
APIs -
Added pre-built bindings for GDAL 3.7
-
Added
SpatialRef::to_projjson
-
Added
Geometry::length
-
Added
Geometry::union
-
Added
Geometry::from_gml
-
Added
CoordTransform::new_with_options
andCoordTransformOptions
-
Set the link flag of gdal-sys to "libgdal". Emit the libgdal version via cargo:version_number. Remove wrong build-dependency on gdal-sys and remove docs_rs workaround.
-
Added
Geometry::from_geojson
-
Added
CslStringList::add_string
-
Possibly breaking: Set MSRV to 1.58.
-
Added a
TryFrom
array implementation forCslStringList
-
Added
Rasterband::c_rasterband
to obtain the raw C pointer toGDALRasterBandH
-
Breaking:
Feature::geometry
returns anOption<&Geometry>
instead of&Geometry
. Calls toFeature::geometry
will no longer panic. -
Breaking:
RasterBand::band_type
returns theGdalDataType
enum instead ofGDALDataType::Type
ordinal. Fixes #333 -
The default features of the
chrono
dependency are now disabled -
Added prebuilt bindings for GDAL 3.6 (released 6 November 2022).
-
Breaking:
Layer::spatial_ref
returnsOption
instead ofResult
, thereby better reflecting the semantics documented in the C++ API -
Exposed various functions on
Geometry
:make_valid
,geometry_name
, andpoint_count
. -
Exposed
read_arrow_stream
onLayer
to access OGR's columnar reading API. -
Exposed spatial predicates over
Geometry
:intersects
,contains
,disjoint
,touches
,crosses
,within
, andoverlaps
. -
Added
Geometry::envelope
andGeometry::envelope_3d
. -
Added support for getting the
SpatialRef
of embedded ground control points (GCPs) viaDataset::gcp_spatial_ref
.
-
Added new content to
README.md
and the root docs. -
Fixed a crash in
Group::dimensions
andMDArray::dimensions
when no dimensions exist -
Added a more ergonomic means of accessing GDAL version properties
-
Provided access to
gdal-sys
discriminant values inResampleAlg
enum. -
Breaking
RasterBand::set_no_data_value
takesOption<f64>
instead off64
so that no no-data can be set. Also makes it symmetric withRasterBand::no_data_value
which returnsOption<f64>
. -
Added quality-of-life features to
CslStringList
:len
,is_empty
,Debug
andIterator
implementations. -
Added ability to set color table for bands with palette color interpretation. Added ability to create a color ramp (interpolated) color table.
-
Added a wrapper for the
DriverManager
-
Added
GdalDataType
to provide access to metadata and supporting routines aroundGDALDataType
ordinals. -
Breaking:
GDALDataType
is no longerpub use
ingdal::raster
, asGdalType
andGdalDataType
sufficiently cover use cases in safe code. Still accessible viagdal_sys::GDALDataType
. -
Added
Metadata
iterator.
-
Add prebuilt bindings for GDAL 3.5
-
Breaking: Add
gdal::vector::OwnedLayer
,gdal::vector::LayerAccess
andgdal::vector::layer::OwnedFeatureIterator
. This requires importinggdal::vector::LayerAccess
for using most vector layer methods. -
Breaking:
SpatialRef::from_c_obj
is now unsafe. -
Breaking: Rename
Driver::get
toDriver::get_by_name
, addDriver::get(usize)
andDriver::count
-
Implemented wrapper for
OGR_L_SetFeature
-
Add
programs::raster::build_vrt
-
Add
GeoTransformEx
extension trait withapply
andinvert
-
Add
gdal::vector::geometry_type_to_name
andgdal::vector::field_type_to_name
-
Add
gdal::raster::rasterband::RasterBand::unit
as wrapper forGDALGetRasterUnitType
-
Add
gdal::vsi::read_dir
function. -
Add a
ColorTable
struct andRasterBand::color_table
method -
Add
GeometryRef<'a>
to reference owned nested geometry in a lifetime-safe way. -
Add support for MDArray API
-
Add
gdal::srs::CoordTransform::transform_bounds
as wrapper forOCTTransformBounds
for GDAL 3.4 -
Add
Feature::set_field_*_list
functions for list field types -
Deprecate
Transaction::dataset
andTransaction::dataset_mut
. AddDeref
andDerefMut
implementations instead. -
Add methods to access raster masks and get raster mask flags. (
open_mask_band
,create_mask_band
, andmask_flags
). -
Remove
PartialEq
fromGdalError
-
Prevent SIGGEGV when reading a string array on an MD Array that is not of type string.
-
Added
Geometry::to_geo
method for GDAL to geo-types Geometry conversions. -
Add
Rasterband::set_scale
andRasterband::set_offset
methods -
Added program wrapper for
GDALMultiDimTranslate
-
Test that
GdalError
isSend
-
Allow reading
Dimension
s fromGroup
s in multimensionalDataset
s. -
Added wrapper methods for
GDALGetRasterStatistics
,GDALComputeRasterMinMax
andGDALMDArrayGetStatistics
. -
Added a workaround in multi-dim tests to not access files multiple times
-
Bump Rust edition to 2021
-
Add prebuild bindings for GDAL 3.4
-
Remove the
datetime
feature -
Add
cpl::CslStringList
-
Make
gdal::rasters::OptimizeMode
public -
Added
rename
anddelete
togdal::Driver
-
Breaking: File paths must now implement
AsRef<Path>
-
Update types to fix build on ppc64le.
-
Upgrade
semver
to 1.0 and trim gdal version output inbuild.rs
. -
Breaking: Make
set_attribute_filter
andclear_attribute_filter
take&mut self
-
Breaking: Drop pre-build bindings for GDAL versions < 2.4. The bindgen feature can be used to generate bindings for older versions.
-
Fix memory leaks reported by Valgrind. This required re-generation of the pre-build bindings.
-
Breaking: Implement
TryFrom
instead ofFrom
to convert from gdal geometries togeo-types
. This avoids a possible panic on unsupported geometries and returns an error instead. -
Add
Feature::c_feature
that returns the OGR feature handle. -
Add wrapper for
OGR_G_Buffer
. -
Add support for raster dataset creation options. A new struct (
RasterCreationOption
) and function (driver.create_with_band_type_with_options()
) are now available for this.
let driver = Driver::get_by_name("GTiff").unwrap();
let options = &[
RasterCreationOption {
key: "COMPRESS",
value: "LZW",
},
RasterCreationOption {
key: "TILED",
value: "YES",
},
];
let mut dataset = driver
.create_with_band_type_with_options::<u8>("testing.tif", 2048, 2048, 1, options)
.unwrap();
-
Breaking: Add support to select a resampling algorithm when reading a raster
Now, it is necessary to provide a
Option<ResampleAlg>
when reading a raster. IfNone
, it usesResampleAlg::NearestNeighbour
which was the default behavior. -
Breaking: Make
Layer::features
iterator reset to beginning, and borrow mutably.- closes #159
-
Breaking: Enforce borrow semantics on methods of
Dataset
,RasterBand
, andLayer
.- Methods that do not modify the underlying structure take
&self
. - Methods that modify the underlying structure take
&mut self
.
let ds = Dataset::open(...); // ds need not be mutable to open layer let mut band = ds.rasterband(1)?; // band needs to be mutable to set no-data value band.set_no_data_value(0.0)?;
- Methods that do not modify the underlying structure take
-
Breaking: Upgrade to
ndarray 0.15
-
Implement wrapper for
OGR_L_TestCapability
-
Breaking: Use
DatasetOptions
to pass asDataset::open_ex
parameters and add support for extended open flags.use gdal::{ Dataset, DatasetOptions } let dataset = Dataset::open_ex( "roads.geojson", DatasetOptions { open_flags: GdalOpenFlags::GDAL_OF_UPDATE|GdalOpenFlags::GDAL_OF_VECTOR, ..DatasetOptions::default() } ) .unwrap();
GDALAccess
values are supported using [From
] implementationDataset::open_ex( "roads.geojson", DatasetOptions { open_flags: GDALAccess::GA_Update.into(), ..DatasetOptions::default() }, ) .unwrap();
-
Add more functions to SpatialRef implementation
-
Breaking: Change
Feature::field
return type fromResult<FieldValue>
toResult<Option<FieldValue>>
. Fields can be null. Before this change, if a field was null, the value returned was the default value for the underlying type. However, this made it impossible to distinguish between null fields and legitimate values which happen to be default value, for example, an Integer field that is absent (null) from a 0, which can be a valid value. After this change, if a field is null,None
is returned, rather than the default value.If you happened to rely on this behavior, you can fix your code by explicitly choosing a default value when the field is null. For example, if you had this before:
let str_var = feature.field("string_field")? .into_string() .unwrap();
You could maintain the old behavior with:
use gdal::vector::FieldValue; let str_var = feature.field("string_field")? .unwrap_or(FieldValue::StringValue("".into())) .into_string() .unwrap();
-
Fixed potential race condition wrt. GDAL driver initialization
-
Add basic support to read overviews
-
Added a
Dataset::build_overviews
method -
BREAKING: update geo-types to 0.7.0. geo-types Coordinate now implement
Debug
-
Deprecated
SpatialRef::get_axis_mapping_strategy
- migrate toSpatialRef::axis_mapping_strategy
instead. -
Add support for reading and setting rasterband colour interpretations
-
Add
Geometry::from_wkb
andGeometry::wkb
functions to convert from/to Well-Known Binary -
Fixed memory leak in
Geometry::from_wkt
-
Breaking: Changed
Dataset::create_layer
to take a newLayerOptions
struct instead of separate arguments.Before:
ds.create_layer("roads", None, wkbLineString)
After (all fields have usable default values):
use gdal::LayerOptions; ds.create_layer(LayerOptions { name: "roads", ty: wkbLineString, ..Default::default() });
This change also removed
Dataset::create_layer_blank()
. UseDataset::create_layer(Default::default())
instead. -
Wrapper functions for
OGR_F_GetFieldAs…
methods -
Wrapper functions for
OGR_L_SetAttributeFilter
andOGR_L_SetSpatialFilterRect
-
Wrappers for
CPLSetThreadLocalConfigOption
andCPLGetThreadLocalConfigOption
-
Wrappers for
VSIFileFromMemBuffer
,VSIUnlink
andVSIGetMemFileBuffer
-
Add
set_description
to theMetadata
trait -
Wrappers for
GDALRasterizeGeometries
provided in a newrasters::rasterize
function -
Added
set_error_handler
andremove_error_handler
to the config module that wrapsCPLSetErrorHandlerEx
-
Breaking: Changed
Dataset::create_copy
to take a slice ofRasterCreationOption
s which was previously not included.Before:
dataset.create_copy(&driver, "output_file");
After:
dataset.create_copy(&driver, "output_file", &[]);
- fix docs.rs build for gdal-sys
- Dataset layer iteration and FieldValue types
- Fix i8 ptr instead of c_char ptr passed to OSRImportFromESRI()
- Rename spatial_reference to spatial_ref
- Replace get_extent force flag by get_extent and try_get_extent
- Add support for transactions on datasets
- Add feature_count{,_force} and implement Iterator::size_hint
- Replace failure with thiserror
- Ability to read into preallocated slice for rasterband
- Datasets are Send (requires GDAL >= 2.3)
- User GDALOpenEx
- GDAL 2.0 conform structure / drop GDAL 1.x
- Inplace functions use mutable refs
- Detect GDAL version at build time / remove version features
- Add support for delaunay_triangulation and simplify functions
- Add support for 3d points
- Additional metadata retrieval options
- Support for GDAL 3 in CI
- Support for Integer64
- Geometry Intersection trait
- Rust 2018
- support for date and time fields
- Prebuild bindings
- Support for ndarray
- Bump geo-types from 0.3 -> 0.4
- Allow reading block-size of Rasters
- Add prebuilt-bindings GDAL 2.3 and GDAL 2.4
- Make GdalType trait public
- RasterBand to Ndarray, with failure
- Migrate to the
geo-types
crate - Replace
error-chain
withfailure
- Use
bindgen
to generate the low-level bindings