pub trait AreaStrategy<G: Geometry> {
type Out: CoordinateScalar;
// Required method
fn area(&self, g: &G) -> Self::Out;
}Expand description
A strategy for computing the area of a geometry.
Mirrors the per-CS area-strategy concept declared in
boost/geometry/strategies/area/services.hpp and refined per
coordinate system in strategies/area/{cartesian,spherical, geographic}.hpp. The Boost concept exposes a stateful apply(p1, p2, state) accumulator plus a final result(state) reduction;
the Rust analogue collapses the two phases into a single method
AreaStrategy::area keyed on the geometry type, because the
per-segment walk shape is identical for every CS — only the
per-segment kernel changes.
§Associated items
Self::Out— the scalar the area comes back as. Equivalent to Boost’sarea_result<Geometry, Strategies>::type(algorithms/area_result.hpp); typically the coordinate scalar ofG’s point type.
Required Associated Types§
Sourcetype Out: CoordinateScalar
type Out: CoordinateScalar
The output scalar type. Typically the geometry’s coordinate
scalar. Mirrors area_result<G, Strategies>::type from
algorithms/area_result.hpp.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl<B> AreaStrategy<B> for ShoelaceBoxAreawhere
B: Box,
<B::Point as Point>::Cs: CoordinateSystem,
<<B::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
impl<B> AreaStrategy<B> for ShoelaceBoxAreawhere
B: Box,
<B::Point as Point>::Cs: CoordinateSystem,
<<B::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
Source§impl<MPg> AreaStrategy<MPg> for ShoelaceMultiPolygonAreawhere
MPg: MultiPolygon,
ShoelacePolygonArea: AreaStrategy<MPg::ItemPolygon, Out = <MPg::Point as Point>::Scalar>,
impl<MPg> AreaStrategy<MPg> for ShoelaceMultiPolygonAreawhere
MPg: MultiPolygon,
ShoelacePolygonArea: AreaStrategy<MPg::ItemPolygon, Out = <MPg::Point as Point>::Scalar>,
Source§impl<P> AreaStrategy<P> for GeographicPolygonArea
Available on crate feature std only.
impl<P> AreaStrategy<P> for GeographicPolygonArea
std only.Source§impl<P> AreaStrategy<P> for ShoelacePolygonArea
impl<P> AreaStrategy<P> for ShoelacePolygonArea
Source§impl<P> AreaStrategy<P> for SphericalPolygonArea
Available on crate feature std only.
impl<P> AreaStrategy<P> for SphericalPolygonArea
std only.Source§impl<R> AreaStrategy<R> for GeographicAreawhere
R: Ring,
<R::Point as Point>::Cs: CoordinateSystem + HasAngularUnits,
<<R::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<GeographicFamily>,
R::Point: Point<Scalar = f64>,
Available on crate feature std only.
impl<R> AreaStrategy<R> for GeographicAreawhere
R: Ring,
<R::Point as Point>::Cs: CoordinateSystem + HasAngularUnits,
<<R::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<GeographicFamily>,
R::Point: Point<Scalar = f64>,
std only.Source§impl<R> AreaStrategy<R> for ShoelaceAreawhere
R: Ring,
<R::Point as Point>::Cs: CoordinateSystem,
<<R::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
impl<R> AreaStrategy<R> for ShoelaceAreawhere
R: Ring,
<R::Point as Point>::Cs: CoordinateSystem,
<<R::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<CartesianFamily>,
Source§impl<R> AreaStrategy<R> for SphericalAreawhere
R: Ring,
<R::Point as Point>::Cs: CoordinateSystem + HasAngularUnits,
<<R::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<SphericalFamily>,
R::Point: Point<Scalar = f64>,
Available on crate feature std only.
impl<R> AreaStrategy<R> for SphericalAreawhere
R: Ring,
<R::Point as Point>::Cs: CoordinateSystem + HasAngularUnits,
<<R::Point as Point>::Cs as CoordinateSystem>::Family: SameAs<SphericalFamily>,
R::Point: Point<Scalar = f64>,
std only.