pub trait Geometry {
    type Point;

    // Required method
    fn project<Proj>(&self, projection: &Proj) -> Option<Geom<Proj::OutPoint>>
       where Proj: Projection<InPoint = Self::Point> + ?Sized;
}
Expand description

Generic geometry.

This trait can be implemented manually for all geometry structs you use, or GeometryType trait can be used for auto-implementation.

Required Associated Types§

source

type Point

Type of points this geometry consists of.

Required Methods§

source

fn project<Proj>(&self, projection: &Proj) -> Option<Geom<Proj::OutPoint>>
where Proj: Projection<InPoint = Self::Point> + ?Sized,

Project the geometry using the given projection. Implementation of this method may choose to change type or properties of a geometry. For example a strait line in a projected CRS can be projected as curved line along the shortest path on the ellipsoid when projected into geographic coordinates.

If the geometry cannot be projected with the given projection, None is returned.

Object Safety§

This trait is not object safe.

Implementors§