-
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 #24 from jdroenner/rasterband
Add RasterBand
- Loading branch information
Showing
12 changed files
with
297 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
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()); | ||
let 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
use libc::{c_void}; | ||
|
||
pub trait MajorObject { | ||
unsafe fn get_gdal_object_ptr(&self) -> *const c_void; | ||
unsafe fn gdal_object_ptr(&self) -> *const c_void; | ||
} |
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
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
Oops, something went wrong.