-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from georust/modernize
Modernize the GDAL crate
- Loading branch information
Showing
38 changed files
with
12,078 additions
and
742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
extern crate gdal; | ||
|
||
use std::path::Path; | ||
use gdal::raster::{Dataset, RasterBand}; | ||
use gdal::metadata::Metadata; | ||
|
||
fn main() { | ||
|
||
let path = Path::new("./fixtures/tinymarble.png"); | ||
let dataset = Dataset::open(path).unwrap(); | ||
println!("dataset description: {:?}", dataset.description()); | ||
|
||
let rasterband: RasterBand = dataset.rasterband(1).unwrap(); | ||
println!("rasterband description: {:?}", rasterband.description()); | ||
println!("rasterband no_data_value: {:?}", rasterband.no_data_value()); | ||
println!("rasterband type: {:?}", rasterband.band_type()); | ||
println!("rasterband scale: {:?}", rasterband.scale()); | ||
println!("rasterband offset: {:?}", rasterband.offset()); | ||
if let Ok(rv) = rasterband.read_as::<u8>( | ||
(20, 30), | ||
(2, 3), | ||
(2, 3) | ||
) { | ||
println!("{:?}", rv.data); | ||
} | ||
} | ||
use gdal::metadata::Metadata; | ||
use gdal::raster::{Dataset, RasterBand}; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
let path = Path::new("./fixtures/tinymarble.png"); | ||
let dataset = Dataset::open(path).unwrap(); | ||
println!("dataset description: {:?}", dataset.description()); | ||
|
||
let rasterband: RasterBand = dataset.rasterband(1).unwrap(); | ||
println!("rasterband description: {:?}", rasterband.description()); | ||
println!("rasterband no_data_value: {:?}", rasterband.no_data_value()); | ||
println!("rasterband type: {:?}", rasterband.band_type()); | ||
println!("rasterband scale: {:?}", rasterband.scale()); | ||
println!("rasterband offset: {:?}", rasterband.offset()); | ||
if let Ok(rv) = rasterband.read_as::<u8>((20, 30), (2, 3), (2, 3)) { | ||
println!("{:?}", rv.data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
extern crate gdal; | ||
|
||
use gdal::spatial_ref::{CoordTransform, SpatialRef}; | ||
use gdal::vector::Geometry; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ license = "MIT" | |
version = "0.2.4" | ||
repository = "https://github.com/georust/gdal" | ||
authors = ["Johannes Drönner <[email protected]>"] | ||
edition = "2018" | ||
|
||
[features] | ||
default = ["min_gdal_version_1_11"] | ||
|
@@ -14,10 +15,11 @@ min_gdal_version_2_1 = [] | |
min_gdal_version_2_2 = [] | ||
min_gdal_version_2_3 = [] | ||
min_gdal_version_2_4 = [] | ||
min_gdal_version_3_0 = [] | ||
|
||
[dependencies] | ||
libc = "0.2" | ||
|
||
[build-dependencies] | ||
bindgen = { version = "0.48", optional = true } | ||
bindgen = { version = "0.54", optional = true } | ||
pkg-config = "0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.