Trait geo::algorithm::map_coords::MapCoordsInplace
[−]
[src]
pub trait MapCoordsInplace<T> { fn map_coords_inplace(&mut self, func: &Fn(&(T, T)) -> (T, T))
where
T: CoordinateType; }
Map all the coordinates in an object in place
Required Methods
fn map_coords_inplace(&mut self, func: &Fn(&(T, T)) -> (T, T)) where
T: CoordinateType,
T: CoordinateType,
Apply a function to all the coordinates in a geometric object, in place
use geo::Point; use geo::algorithm::map_coords::MapCoordsInplace; let mut p = Point::new(10., 20.); p.map_coords_inplace(&|&(x, y)| (x+1000., y*2.)); assert_eq!(p, Point::new(1010., 40.));
Implementors
impl<T: CoordinateType> MapCoordsInplace<T> for Point<T>
impl<T: CoordinateType> MapCoordsInplace<T> for Line<T>
impl<T: CoordinateType> MapCoordsInplace<T> for LineString<T>
impl<T: CoordinateType> MapCoordsInplace<T> for Polygon<T>
impl<T: CoordinateType> MapCoordsInplace<T> for MultiPoint<T>
impl<T: CoordinateType> MapCoordsInplace<T> for MultiLineString<T>
impl<T: CoordinateType> MapCoordsInplace<T> for MultiPolygon<T>
impl<T: CoordinateType> MapCoordsInplace<T> for Geometry<T>
impl<T: CoordinateType> MapCoordsInplace<T> for GeometryCollection<T>