Skip to main content

CrsTransformer

Struct CrsTransformer 

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

Transformer for coordinate reference system conversions

This is a placeholder structure. In a full implementation, this would integrate with oxigdal-proj or proj4rs for actual transformations.

Implementations§

Source§

impl CrsTransformer

Source

pub fn new( source_crs: impl Into<String>, target_crs: impl Into<String>, ) -> Result<Self>

Creates a new CRS transformer

§Arguments
  • source_crs - Source CRS (e.g., “EPSG:4326”)
  • target_crs - Target CRS (e.g., “EPSG:3857”)
§Returns

A new transformer

§Errors

Returns error if CRS definitions are invalid

Source

pub fn from_common(source: CommonCrs, target: CommonCrs) -> Result<Self>

Creates a transformer from common CRS types

Source

pub fn transform_coordinate(&self, coord: &Coordinate) -> Result<Coordinate>

Transforms a single coordinate

§Arguments
  • coord - Input coordinate in source CRS
§Returns

Transformed coordinate in target CRS

§Errors

Returns error if transformation fails

Source

pub fn transform_coordinates( &self, coords: &[Coordinate], ) -> Result<Vec<Coordinate>>

Transforms multiple coordinates efficiently

Source

pub fn transform_point(&self, point: &Point) -> Result<Point>

Transforms a point

Source

pub fn transform_linestring( &self, linestring: &LineString, ) -> Result<LineString>

Transforms a linestring

Source

pub fn transform_polygon(&self, polygon: &Polygon) -> Result<Polygon>

Transforms a polygon

Source

pub fn transform_geometry(&self, geometry: &Geometry) -> Result<Geometry>

Transforms a geometry

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.