Skip to main content

DistortionRaster

Struct DistortionRaster 

Source
pub struct DistortionRaster {
    pub lon_min: f64,
    pub lon_max: f64,
    pub lat_min: f64,
    pub lat_max: f64,
    pub ncols: usize,
    pub nrows: usize,
    pub cells: Vec<TissotCell>,
}
Expand description

A distortion-field raster: Tissot parameters on a regular lon/lat grid.

Fields§

§lon_min: f64§lon_max: f64§lat_min: f64§lat_max: f64§ncols: usize§nrows: usize§cells: Vec<TissotCell>

Flattened row-major grid of TissotCell (len = nrows * ncols).

Implementations§

Source§

impl DistortionRaster

Source

pub fn compute( pj: &Pj, lon_min: f64, lat_min: f64, lon_max: f64, lat_max: f64, step_deg: f64, ) -> Self

Compute a distortion raster for the given projection over the given extent.

All lon/lat values are in degrees. The raster has:

  • ncols = ((lon_max - lon_min) / step_deg).ceil() as usize + 1
  • nrows = ((lat_max - lat_min) / step_deg).ceil() as usize + 1
Source

pub fn get(&self, row: usize, col: usize) -> Option<&TissotCell>

Get a cell by row and column index.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.