pub struct CoordTransformOptions { /* private fields */ }
Expand description

Implementations§

source§

impl CoordTransformOptions

source

pub fn new() -> Result<CoordTransformOptions>

Creation options for CoordTransform.

source

pub fn set_area_of_interest( &mut self, west_longitude_deg: f64, south_latitude_deg: f64, east_longitude_deg: f64, north_latitude_deg: f64 ) -> Result<()>

Sets an area of interest.

The west longitude is generally lower than the east longitude, except for areas of interest that go across the anti-meridian.

For more information, see Advanced Coordinate Transformation Tutorial.

Arguments
  • west_longitude_deg – West longitude (in degree). Must be in [-180,180]
  • south_latitude_deg – South latitude (in degree). Must be in [-90,90]
  • east_longitude_deg – East longitude (in degree). Must be in [-180,180]
  • north_latitude_deg – North latitude (in degree). Must be in [-90,90]
source

pub fn desired_accuracy(&mut self, accuracy: f64) -> Result<()>

Sets the desired accuracy for coordinate operations.

Only coordinate operations that offer an accuracy of at least the one specified will be considered.

An accuracy of 0 is valid and means a coordinate operation made only of one or several conversions (map projections, unit conversion, etc.) Operations involving ballpark transformations have a unknown accuracy, and will be filtered out by any dfAccuracy >= 0 value.

If this option is specified with PROJ < 8, the OGR_CT_OP_SELECTION configuration option will default to BEST_ACCURACY.

source

pub fn set_ballpark_allowed(&mut self, ballpark_allowed: bool) -> Result<()>

Sets whether ballpark transformations are allowed.

By default, PROJ may generate “ballpark transformations” (see Glossary) when precise datum transformations are missing. For high accuracy use cases, such transformations might not be allowed.

If this option is specified with PROJ < 8, the OGR_CT_OP_SELECTION configuration option will default to BEST_ACCURACY.

source

pub fn set_coordinate_operation( &mut self, co: &str, reverse: bool ) -> Result<()>

Sets a coordinate operation.

This is a user override to be used instead of the normally computed pipeline.

The pipeline must take into account the axis order of the source and target SRS.

The pipeline may be provided as a PROJ string (single step operation or multiple step string starting with +proj=pipeline), a WKT2 string describing a CoordinateOperation, or a "urn:ogc:def:coordinateOperation:EPSG::XXXX" URN.

For more information, see Advanced Coordinate Transformation Tutorial.

Arguments
  • co: PROJ or WKT string describing a coordinate operation
  • reverse: Whether the PROJ or WKT string should be evaluated in the reverse path

Trait Implementations§

source§

impl Debug for CoordTransformOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for CoordTransformOptions

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.