pub trait DefaultArea<Family> {
type Strategy: Default;
}Expand description
“Which (polygon) area strategy do we pick by default for this CS family?”
Mirrors v1’s DefaultDistance
and DefaultLength — the Rust
analogue of Boost’s services::default_strategy<Geometry, cs_tag>
in strategies/area/services.hpp, specialised per CS in
strategies/area/{cartesian,spherical,geographic}.hpp.
Keyed on the polygon area strategy, since the area(&polygon)
free function is the entry point that dispatches through it:
impl DefaultArea<CartesianFamily> for CartesianFamily { type Strategy = ShoelacePolygonArea; }
impl DefaultArea<SphericalFamily> for SphericalFamily { type Strategy = SphericalPolygonArea; }
impl DefaultArea<GeographicFamily> for GeographicFamily { type Strategy = GeographicPolygonArea; }Required Associated Types§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl DefaultArea<CartesianFamily> for CartesianFamily
Cartesian family defaults to ShoelacePolygonArea.
impl DefaultArea<CartesianFamily> for CartesianFamily
Cartesian family defaults to ShoelacePolygonArea.
Source§impl DefaultArea<GeographicFamily> for GeographicFamily
Geographic family defaults to GeographicPolygonArea
— the authalic-sphere approximation (see its docs for the precision
caveat).
impl DefaultArea<GeographicFamily> for GeographicFamily
Geographic family defaults to GeographicPolygonArea
— the authalic-sphere approximation (see its docs for the precision
caveat).
Source§impl DefaultArea<SphericalFamily> for SphericalFamily
Spherical family defaults to SphericalPolygonArea.
impl DefaultArea<SphericalFamily> for SphericalFamily
Spherical family defaults to SphericalPolygonArea.