Skip to main content

Globe

Struct Globe 

Source
pub struct Globe;
Expand description

Geocentric globe projection using the WGS-84 ellipsoid.

Output coordinates are Earth-centered Earth-fixed style Cartesian meters:

  • x: intersects the equator at longitude 0
  • y: intersects the equator at longitude 90E
  • z: north pole axis

Implementations§

Source§

impl Globe

Source

pub fn project(geo: &GeoCoord) -> WorldCoord

Project geographic coordinates to globe-centered Cartesian meters.

Source

pub fn unproject(world: &WorldCoord) -> GeoCoord

Inverse-project globe-centered Cartesian meters to geographic coordinates.

Source

pub fn radius() -> f64

Mean Earth radius used for simple scale queries.

Trait Implementations§

Source§

impl Projection for Globe

Source§

fn project(&self, geo: &GeoCoord) -> WorldCoord

Project a geographic coordinate to world space (meters).
Source§

fn unproject(&self, world: &WorldCoord) -> GeoCoord

Inverse-project world coordinates back to geographic.
Source§

fn scale_factor(&self, _geo: &GeoCoord) -> f64

Local linear scale factor at the given geographic coordinate. Read more
Source§

fn projection_bounds(&self) -> GeoBounds

The geographic bounding box of valid input for this projection. Read more

Auto Trait Implementations§

§

impl Freeze for Globe

§

impl RefUnwindSafe for Globe

§

impl Send for Globe

§

impl Sync for Globe

§

impl Unpin for Globe

§

impl UnsafeUnpin for Globe

§

impl UnwindSafe for Globe

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.