Skip to main content

ReprojectPoints

Trait ReprojectPoints 

Source
pub trait ReprojectPoints {
    // Required method
    fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
       where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>;
}
Expand description

A geometry whose points can be enumerated and rewritten — the hook reprojection needs.

Implemented for the kernel’s mutable areal / linear / point model types. The single method visits every point, letting the caller replace its (x, y).

Required Methods§

Source

fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>,

Visit each point, replacing it with f(x, y). f may fail; the first failure stops the walk and is propagated.

§Errors

Whatever error f returns for the first point it rejects.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<Cs: CoordinateSystem> ReprojectPoints for Linestring<Point2D<f64, Cs>>

Source§

fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>,

Source§

impl<Cs: CoordinateSystem> ReprojectPoints for MultiPolygon<Polygon<Point2D<f64, Cs>>>

Source§

fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>,

Source§

impl<Cs: CoordinateSystem> ReprojectPoints for Point2D<f64, Cs>

Source§

fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>,

Source§

impl<Cs: CoordinateSystem> ReprojectPoints for Polygon<Point2D<f64, Cs>>

Source§

fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>,

Source§

impl<Cs: CoordinateSystem> ReprojectPoints for Ring<Point2D<f64, Cs>>

Source§

fn map_points<F>(&mut self, f: &mut F) -> Result<(), CrsError>
where F: FnMut(f64, f64) -> Result<(f64, f64), CrsError>,

Implementors§