Skip to main content

Project

Trait Project 

Source
pub trait Project {
    // Required methods
    fn forward(&self, xy: &(f64, f64)) -> Result<(f64, f64), &'static str>;
    fn inverse(&self, xy: &(f64, f64)) -> Result<(f64, f64), &'static str>;
    fn a(&self) -> &f64;
    fn lam0(&self) -> &f64;

    // Provided method
    fn project(
        &self,
        xy: &(f64, f64),
        inverse: bool,
    ) -> Result<(f64, f64), &'static str> { ... }
}
Expand description

Map projection functionality.

Required Methods§

Source

fn forward(&self, xy: &(f64, f64)) -> Result<(f64, f64), &'static str>

Source

fn inverse(&self, xy: &(f64, f64)) -> Result<(f64, f64), &'static str>

Source

fn a(&self) -> &f64

Source

fn lam0(&self) -> &f64

Provided Methods§

Source

fn project( &self, xy: &(f64, f64), inverse: bool, ) -> Result<(f64, f64), &'static str>

Performs a projection.

For forward transformation (inverse = false), xy is treated as (lambda, phi), where lambda represents longitude and phi represents latitude, both expressed in degrees. The return value should be considered to be (x, y), and both x and y are values in meters.

For inverse transformation (inverse = true), xy is treated as (x, y) and both x and y are values in meters. The return value should be considered to be (lambda, phi), where lambda represents longitude and phi represents latitude, both expressed in degrees.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Project for grib::projection::Lcc

Source§

impl Project for grib::projection::Merc