pub struct GeoTransform(pub Affine);Expand description
Newtype wrapping raffine::Affine as a GeoTransform.
from_gdal(&[c, a, b, f, d, e]) accepts the same 6-tuple format used by GDAL
and rasterio. Forward maps pixel → world; inverse() maps world → pixel.
Tuple Fields§
§0: AffineImplementations§
Source§impl GeoTransform
impl GeoTransform
Sourcepub fn from_gdal(gt: &[f64; 6]) -> Self
pub fn from_gdal(gt: &[f64; 6]) -> Self
Construct from GDAL coefficients [x_origin, x_scale, x_skew, y_origin, y_skew, y_scale].
Sourcepub fn forward(&self, col: f64, row: f64) -> (f64, f64)
pub fn forward(&self, col: f64, row: f64) -> (f64, f64)
Transform pixel coordinates, with integer coordinates at pixel corners.
Sourcepub fn translated(&self, col_off: f64, row_off: f64) -> Self
pub fn translated(&self, col_off: f64, row_off: f64) -> Self
Shift the pixel-space origin by the given column and row offsets.
Sourcepub fn scaled(&self, sx: f64, sy: f64) -> Self
pub fn scaled(&self, sx: f64, sy: f64) -> Self
Scale pixel-space column and row coordinates before mapping to the CRS.
Sourcepub fn inverse(&self) -> Option<GeoTransform>
pub fn inverse(&self) -> Option<GeoTransform>
Return the world-to-pixel transform, or None for a singular transform.
Trait Implementations§
Source§impl Clone for GeoTransform
impl Clone for GeoTransform
impl Copy for GeoTransform
Auto Trait Implementations§
impl Freeze for GeoTransform
impl RefUnwindSafe for GeoTransform
impl Send for GeoTransform
impl Sync for GeoTransform
impl Unpin for GeoTransform
impl UnsafeUnpin for GeoTransform
impl UnwindSafe for GeoTransform
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more