Skip to content

Commit

Permalink
Without reproject test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rochamatcomp committed Mar 14, 2019
1 parent c68ab7a commit 5246812
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/raster/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,27 +365,3 @@ fn test_get_offset() {
let offset = rasterband.offset();
assert_eq!(offset, Some(0.0));
}

#[test]
fn test_reproject() {
let driver = Driver::get("MEM").unwrap();
let size_x = 100;
let size_y = 50;
let bands = 3;
let filename = ""; // Don't need concrete filename because is a file in memory
let destiny = driver.create(filename, size_x, size_y, bands).unwrap();
let source = Dataset::open(fixture!("tinybluemarble.tif")).unwrap();

println!("{:?}", source.geo_transform().expect("Geotransform vector."));

// c = x-coordinate of the upper-left corner of the upper-left pixel
// a = width of a pixel
// b = row rotation (typically zero)
// f = y-coordinate of the of the upper-left corner of the upper-left pixel
// d = column rotation (typically zero)
// e = height of a pixel (typically negative)
let transform = [0.0, 10.0, 0.0, 0.0, 0.0, -10.0];
assert!(destiny.set_geo_transform(&transform).is_ok());
assert!(warp::reproject(&source, &destiny).is_ok());
println!("{:?}", destiny.geo_transform().expect("Geotransform vector."));
}

0 comments on commit 5246812

Please sign in to comment.