Trait galileo_types::geometry::Geometry
source · 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§
Required Methods§
sourcefn project<Proj>(&self, projection: &Proj) -> Option<Geom<Proj::OutPoint>>
fn project<Proj>(&self, projection: &Proj) -> Option<Geom<Proj::OutPoint>>
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.