Skip to main content

y_from_row

Function y_from_row 

Source
pub fn y_from_row(gt: &GeoTransform, row: f64) -> f64
Expand description

Geographic y-coordinate of a pixel row centre.

§Arguments

  • gt — geotransform
  • row — 0-based row index (can be fractional)

§Example

use vaster::{extent_dim_to_gt, y_from_row};

let gt = extent_dim_to_gt(&[0.0, 10.0, 0.0, 5.0], &[10, 5]);
assert!((y_from_row(&gt, 0.0) - 4.5).abs() < 1e-10);  // top row
assert!((y_from_row(&gt, 4.0) - 0.5).abs() < 1e-10);  // bottom row