Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/georust/gdal into pr/spad…
Browse files Browse the repository at this point in the history
…arian/141
  • Loading branch information
jdroenner committed Apr 25, 2021
2 parents 969a187 + dba29c9 commit c0babcd
Show file tree
Hide file tree
Showing 21 changed files with 329 additions and 200 deletions.
280 changes: 159 additions & 121 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,74 @@

## Unreleased

* **Breaking**: Add support to select a resampling algorithm when reading a raster
* <https://github.com/georust/gdal/pull/141>

Now, it is necessary to provide a `Option<ResampleAlg>` when reading a raster.
If `None`, it uses `ResampleAlg::NearestNeighbour` which was the
default behavior.

* Implement wrapper for `OGR_L_TestCapability`
* <https://github.com/georust/gdal/pull/160>
* **Breaking**: Use `DatasetOptions` to pass as `Dataset::open_ex` parameters and
add support for extended open flags.

```rust
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 usinf [`From`] implementation

```rust
Dataset::open_ex(
"roads.geojson",
DatasetOptions {
open_flags: GDALAccess::GA_Update.into(),
..DatasetOptions::default()
},
)
.unwrap();
```

* Add more functions to SpatialRef implementation
* <https://github.com/georust/gdal/pull/145>
* **Breaking**: Change `Feature::field` return type from
- **Breaking**: Add support to select a resampling algorithm when reading a raster

- <https://github.com/georust/gdal/pull/141>

Now, it is necessary to provide a `Option<ResampleAlg>` when reading a raster.
If `None`, it uses `ResampleAlg::NearestNeighbour` which was the
default behavior.

- **Breaking**: Make `Layer::features` iterator reset to
beginning, and borrow mutably.

- closes <https://github.com/georust/gdal/issues/159>

- **Breaking**: [Enforce borrow
semantics](https://github.com/georust/gdal/pull/161) on
methods of `Dataset`, `RasterBand`, and `Layer`.

1. Methods that do not modify the underlying structure take `&self`.
1. Methods that modify the underlying structure take `&mut self`.

```rust
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)?;
```

- **Breaking**: Upgrade to `ndarray 0.15`
- <https://github.com/georust/gdal/pull/175>
- Implement wrapper for `OGR_L_TestCapability`

- <https://github.com/georust/gdal/pull/160>

- **Breaking**: Use `DatasetOptions` to pass as `Dataset::open_ex` parameters and
add support for extended open flags.

```rust
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`] implementation

```rust
Dataset::open_ex(
"roads.geojson",
DatasetOptions {
open_flags: GDALAccess::GA_Update.into(),
..DatasetOptions::default()
},
)
.unwrap();
```

- Add more functions to SpatialRef implementation
- <https://github.com/georust/gdal/pull/145>
- **Breaking**: Change `Feature::field` return type from
`Result<FieldValue>` to `Result<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.
Expand Down Expand Up @@ -72,99 +99,110 @@
.into_string()
.unwrap();
```
* <https://github.com/georust/gdal/pull/134>
* Fixed potential race condition wrt. GDAL driver initialization
* <https://github.com/georust/gdal/pull/166>
* Add basic support to read overviews
* Added a `Dataset::build_overviews` method
* <https://github.com/georust/gdal/pull/164>
* BREAKING: update geo-types to 0.7.0. geo-types Coordinate<T> now implement `Debug`
* <https://github.com/georust/gdal/pull/146>
* Deprecated `SpatialRef::get_axis_mapping_strategy` - migrate to

- <https://github.com/georust/gdal/pull/134>

- Fixed potential race condition wrt. GDAL driver initialization
- <https://github.com/georust/gdal/pull/166>
- Add basic support to read overviews
- Added a `Dataset::build_overviews` method
- <https://github.com/georust/gdal/pull/164>
- BREAKING: update geo-types to 0.7.0. geo-types Coordinate<T> now implement `Debug`
- <https://github.com/georust/gdal/pull/146>
- Deprecated `SpatialRef::get_axis_mapping_strategy` - migrate to
`SpatialRef::axis_mapping_strategy` instead.
* Add support for reading and setting rasterband colour interpretations
* <https://github.com/georust/gdal/pull/144>
<<<<<<< HEAD
* Fixed memory leak in `Geometry::from_wkt`
* <https://github.com/georust/gdal/pull/172>
=======
>>>>>>> Added entry to CHANGES
<<<<<<< HEAD

* Add support for reading and setting rasterband colour interpretations \* <https://github.com/georust/gdal/pull/144>
<<<<<<< HEAD
* Fixed memory leak in `Geometry::from_wkt` \* <https://github.com/georust/gdal/pull/172>
=======
> > > > > > > # Added entry to CHANGES
- Add support for reading and setting rasterband colour interpretations
- <https://github.com/georust/gdal/pull/144>
- Fixed memory leak in `Geometry::from_wkt`
- <https://github.com/georust/gdal/pull/172>
> > > > > > > dba29c99c99c590caa906912fdbb56273c717897
## 0.7.1
* fix docs.rs build for gdal-sys
* <https://github.com/georust/gdal/pull/128>

- fix docs.rs build for gdal-sys
- <https://github.com/georust/gdal/pull/128>

## 0.6.0 - 0.7.0
* Dataset layer iteration and FieldValue types
* https://github.com/georust/gdal/pull/126
* Fix i8 ptr instead of c_char ptr passed to OSRImportFromESRI()
* <https://github.com/georust/gdal/pull/123>
* Rename spatial_reference to spatial_ref
* <https://github.com/georust/gdal/pull/114>
* Replace get_extent force flag by get_extent and try_get_extent
* <https://github.com/georust/gdal/pull/113>
* Add support for transactions on datasets
* <https://github.com/georust/gdal/pull/109>
* Add feature_count{,_force} and implement Iterator::size_hint
* <https://github.com/georust/gdal/pull/108>
* Replace failure with thiserror
* <https://github.com/georust/gdal/pull/103>
* Ability to read into preallocated slice for rasterband
* <https://github.com/georust/gdal/pull/100>
* Datasets are Send (requires GDAL >= 2.3)
* <https://github.com/georust/gdal/pull/99>
* User GDALOpenEx
* <https://github.com/georust/gdal/pull/97>
* GDAL 2.0 conform structure / drop GDAL 1.x
* <https://github.com/georust/gdal/pull/96>
* Inplace functions use mutable refs
* <https://github.com/georust/gdal/pull/93>
* Detect GDAL version at build time / remove version features
* <https://github.com/georust/gdal/pull/92>
* Add support for delaunay_triangulation and simplify functions
* <https://github.com/georust/gdal/pull/91>
* Add support for 3d points
* <https://github.com/georust/gdal/pull/90>
* Additional metadata retrieval options
* <https://github.com/georust/gdal/pull/88>
* Support for GDAL 3 in CI
* <https://github.com/georust/gdal/pull/86>
* Support for Integer64
* <https://github.com/georust/gdal/pull/80>
* Geometry Intersection trait
* <https://github.com/georust/gdal/pull/78>
* Rust 2018
* <https://github.com/georust/gdal/pull/75>
* support for date and time fields
* <https://github.com/georust/gdal/pull/72>
* Prebuild bindings
* <https://github.com/georust/gdal/pull/69>
* Support for ndarray
* <https://github.com/georust/gdal/pull/68>

- Dataset layer iteration and FieldValue types
- https://github.com/georust/gdal/pull/126
- Fix i8 ptr instead of c_char ptr passed to OSRImportFromESRI()
- <https://github.com/georust/gdal/pull/123>
- Rename spatial_reference to spatial_ref
- <https://github.com/georust/gdal/pull/114>
- Replace get_extent force flag by get_extent and try_get_extent
- <https://github.com/georust/gdal/pull/113>
- Add support for transactions on datasets
- <https://github.com/georust/gdal/pull/109>
- Add feature_count{,\_force} and implement Iterator::size_hint
- <https://github.com/georust/gdal/pull/108>
- Replace failure with thiserror
- <https://github.com/georust/gdal/pull/103>
- Ability to read into preallocated slice for rasterband
- <https://github.com/georust/gdal/pull/100>
- Datasets are Send (requires GDAL >= 2.3)
- <https://github.com/georust/gdal/pull/99>
- User GDALOpenEx
- <https://github.com/georust/gdal/pull/97>
- GDAL 2.0 conform structure / drop GDAL 1.x
- <https://github.com/georust/gdal/pull/96>
- Inplace functions use mutable refs
- <https://github.com/georust/gdal/pull/93>
- Detect GDAL version at build time / remove version features
- <https://github.com/georust/gdal/pull/92>
- Add support for delaunay_triangulation and simplify functions
- <https://github.com/georust/gdal/pull/91>
- Add support for 3d points
- <https://github.com/georust/gdal/pull/90>
- Additional metadata retrieval options
- <https://github.com/georust/gdal/pull/88>
- Support for GDAL 3 in CI
- <https://github.com/georust/gdal/pull/86>
- Support for Integer64
- <https://github.com/georust/gdal/pull/80>
- Geometry Intersection trait
- <https://github.com/georust/gdal/pull/78>
- Rust 2018
- <https://github.com/georust/gdal/pull/75>
- support for date and time fields
- <https://github.com/georust/gdal/pull/72>
- Prebuild bindings
- <https://github.com/georust/gdal/pull/69>
- Support for ndarray
- <https://github.com/georust/gdal/pull/68>

## 0.5.0

* [Bump geo-types from 0.3 -> 0.4](https://github.com/georust/gdal/pull/71)
* [Allow reading block-size of Rasters](https://github.com/georust/gdal/pull/67)
* [Add prebuilt-bindings GDAL 2.3 and GDAL 2.4](https://github.com/georust/gdal/pull/69)
* [Make GdalType trait public](https://github.com/georust/gdal/pull/66)
* [RasterBand to Ndarray, with failure](https://github.com/georust/gdal/pull/68)
- [Bump geo-types from 0.3 -> 0.4](https://github.com/georust/gdal/pull/71)
- [Allow reading block-size of Rasters](https://github.com/georust/gdal/pull/67)
- [Add prebuilt-bindings GDAL 2.3 and GDAL 2.4](https://github.com/georust/gdal/pull/69)
- [Make GdalType trait public](https://github.com/georust/gdal/pull/66)
- [RasterBand to Ndarray, with failure](https://github.com/georust/gdal/pull/68)

## 0.4.0
* [Migrate to the `geo-types` crate](https://github.com/georust/gdal/pull/60)
* [Replace `error-chain` with `failure`](https://github.com/georust/gdal/pull/58)
* [Use `bindgen` to generate the low-level bindings](https://github.com/georust/gdal/pull/55)

- [Migrate to the `geo-types` crate](https://github.com/georust/gdal/pull/60)
- [Replace `error-chain` with `failure`](https://github.com/georust/gdal/pull/58)
- [Use `bindgen` to generate the low-level bindings](https://github.com/georust/gdal/pull/55)

## 0.3.0

* [Add support for creating a SpatialRef from a esri "wkt" definition](https://github.com/georust/gdal/pull/37)
* [Travis now uses GDAL 2.x](https://github.com/georust/gdal/pull/36)
* [API extensions](https://github.com/georust/gdal/pull/35)
* [Extend the existing possibilities of writing ogr datasets](https://github.com/georust/gdal/pull/31)
* [Allow to transform ogr geometries to other SRS](https://github.com/georust/gdal/pull/29)
* [Move ffi into a seperate crate](https://github.com/georust/gdal/pull/26)
* [Added rasterband.rs and moved all band functions](https://github.com/georust/gdal/pull/24)
- [Add support for creating a SpatialRef from a esri "wkt" definition](https://github.com/georust/gdal/pull/37)
- [Travis now uses GDAL 2.x](https://github.com/georust/gdal/pull/36)
- [API extensions](https://github.com/georust/gdal/pull/35)
- [Extend the existing possibilities of writing ogr datasets](https://github.com/georust/gdal/pull/31)
- [Allow to transform ogr geometries to other SRS](https://github.com/georust/gdal/pull/29)
- [Move ffi into a seperate crate](https://github.com/georust/gdal/pull/26)
- [Added rasterband.rs and moved all band functions](https://github.com/georust/gdal/pull/24)

## 0.2.1

* [First version of metadata handling](https://github.com/georust/gdal/pull/21)
- [First version of metadata handling](https://github.com/georust/gdal/pull/21)
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ thiserror = "1.0"
libc = "0.2"
geo-types = { version = "0.7.0" }
gdal-sys = { path = "gdal-sys", version = "^0.3"}
ndarray = {version = "0.14", optional = true }
ndarray = {version = "0.15", optional = true }
chrono = { version = "0.4", optional = true }
bitflags = "1.2"

Expand All @@ -31,6 +31,7 @@ semver = "0.11"

[dev-dependencies]
tempfile = "3.1"
trybuild = "1.0.39"

[workspace]
members = ["gdal-sys"]
Expand Down
4 changes: 2 additions & 2 deletions examples/read_write_ogr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::fs;
use std::path::Path;

fn run() -> Result<()> {
let mut dataset_a = Dataset::open(Path::new("fixtures/roads.geojson"))?;
let layer_a = dataset_a.layer(0)?;
let dataset_a = Dataset::open(Path::new("fixtures/roads.geojson"))?;
let mut layer_a = dataset_a.layer(0)?;
let fields_defn = layer_a
.defn()
.fields()
Expand Down
4 changes: 2 additions & 2 deletions examples/read_write_ogr_datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ fn run() -> gdal::errors::Result<()> {

println!("gdal crate was build with datetime support");

let mut dataset_a = Dataset::open(Path::new("fixtures/points_with_datetime.json"))?;
let layer_a = dataset_a.layer(0)?;
let dataset_a = Dataset::open(Path::new("fixtures/points_with_datetime.json"))?;
let mut layer_a = dataset_a.layer(0)?;

// Create a new dataset:
let path = std::env::temp_dir().join("later.geojson");
Expand Down
2 changes: 1 addition & 1 deletion gdal-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ edition = "2018"
libc = "0.2"

[build-dependencies]
bindgen = { version = "0.57", optional = true }
bindgen = { version = "0.58", optional = true }
pkg-config = "0.3"
semver = "0.11"
12 changes: 6 additions & 6 deletions gdal-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ pub fn write_bindings(include_paths: Vec<String>, out_path: &Path) {
.header("wrapper.h")
.constified_enum_module(".*")
.ctypes_prefix("libc")
.whitelist_function("CPL.*")
.whitelist_function("GDAL.*")
.whitelist_function("OGR.*")
.whitelist_function("OSR.*")
.whitelist_function("OCT.*")
.whitelist_function("VSI.*");
.allowlist_function("CPL.*")
.allowlist_function("GDAL.*")
.allowlist_function("OGR.*")
.allowlist_function("OSR.*")
.allowlist_function("OCT.*")
.allowlist_function("VSI.*");

for path in include_paths {
builder = builder.clang_arg("-I");
Expand Down
1 change: 1 addition & 0 deletions gdal-sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(clippy::upper_case_acronyms)]

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
Loading

0 comments on commit c0babcd

Please sign in to comment.