Struct h3ron_ndarray::transform::Transform
source · [−]pub struct Transform { /* private fields */ }Expand description
Affine Geotransform
Ported from affine library (used by rasterio).
a, b, c, d, e and f are typed as f64 and are coefficients of an augmented affine
transformation matrix:
| x' | | a b c | | x |
| y' | = | d e f | | y |
| 1 | | 0 0 1 | | 1 |a, b, and c are the elements of the first row of the matrix. d, e, and f are the elements of the second row.
Other sources:
Implementations
sourceimpl Transform
impl Transform
pub const fn new(a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) -> Self
sourcepub const fn from_rasterio(transform: &[f64; 6]) -> Self
pub const fn from_rasterio(transform: &[f64; 6]) -> Self
create from an f64 slice in the ordering used by rasterio
sourcepub const fn from_gdal(transform: &[f64; 6]) -> Self
pub const fn from_gdal(transform: &[f64; 6]) -> Self
create from an f64 slice in the ordering used by gdal
sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
The determinant of the transform matrix
sourcepub fn is_degenerate(&self) -> bool
pub fn is_degenerate(&self) -> bool
True if this transform is degenerate.
Which means that it will collapse a shape to an effective area of zero. Degenerate transforms cannot be inverted.
pub fn invert(&self) -> Result<Self, Error>
sourcepub fn transform_coordinate(
&self,
coordinate: &Coordinate<f64>
) -> Coordinate<f64>
pub fn transform_coordinate(
&self,
coordinate: &Coordinate<f64>
) -> Coordinate<f64>
Apply the transformation to a coordinate
Trait Implementations
sourceimpl Mul<&Coordinate<f64>> for &Transform
impl Mul<&Coordinate<f64>> for &Transform
apply the transformation to a coordinate
type Output = Coordinate<f64>
type Output = Coordinate<f64>
The resulting type after applying the
* operator.sourceimpl Mul<Coordinate<f64>> for &Transform
impl Mul<Coordinate<f64>> for &Transform
apply the transformation to a coordinate
type Output = Coordinate<f64>
type Output = Coordinate<f64>
The resulting type after applying the
* operator.impl StructuralPartialEq for Transform
Auto Trait Implementations
impl RefUnwindSafe for Transform
impl Send for Transform
impl Sync for Transform
impl Unpin for Transform
impl UnwindSafe for Transform
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more