Skip to main content

Proj

Struct Proj 

Source
pub struct Proj { /* private fields */ }
Expand description

Lightweight compatibility facade for downstream code that currently expects a proj::Proj-like flow:

  1. parse a CRS definition with Proj::new
  2. build a CRS-to-CRS transform with Proj::create_crs_to_crs_from_pj
  3. convert coordinates with Proj::convert

Implementations§

Source§

impl Proj

Source

pub fn new(definition: &str) -> Result<Self>

Parse a single CRS definition in any supported format.

Source

pub fn new_known_crs(from: &str, to: &str, _area: Option<&str>) -> Result<Self>

Build a transform directly from two CRS strings.

Source

pub fn create_crs_to_crs_from_pj( &self, target: &Self, _area: Option<&str>, _options: Option<&str>, ) -> Result<Self>

Build a transform from two parsed CRS definitions.

Source

pub fn convert<T: Transformable>(&self, coord: T) -> Result<T>

Transform a coordinate using a CRS-to-CRS transform.

Source

pub fn convert_3d<T: Transformable3D>(&self, coord: T) -> Result<T>

Transform a 3D coordinate using a CRS-to-CRS transform.

Source

pub fn convert_coord(&self, coord: Coord) -> Result<Coord>

Transform a coordinate using the native Coord type.

Source

pub fn convert_coord_3d(&self, coord: Coord3D) -> Result<Coord3D>

Transform a 3D coordinate using the native Coord3D type.

Source

pub fn inverse(&self) -> Result<Self>

Return the inverse of a CRS-to-CRS transform.

Source

pub fn transform_bounds( &self, bounds: Bounds, densify_points: usize, ) -> Result<Bounds>

Reproject an axis-aligned bounding box by sampling its perimeter.

Auto Trait Implementations§

§

impl Freeze for Proj

§

impl !RefUnwindSafe for Proj

§

impl Send for Proj

§

impl Sync for Proj

§

impl Unpin for Proj

§

impl UnsafeUnpin for Proj

§

impl !UnwindSafe for Proj

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.