Skip to main content

EnvelopeStrategy

Trait EnvelopeStrategy 

Source
pub trait EnvelopeStrategy<G> {
    type Output;

    // Required method
    fn envelope(&self, g: &G) -> Self::Output;
}
Expand description

A strategy for computing the axis-aligned bounding box of a geometry.

Mirrors the per-CS envelope-strategy concept declared in boost/geometry/strategies/envelope/services.hpp and refined per coordinate system in strategies/envelope/{cartesian,spherical, geographic}.hpp. The Boost concept exposes a family of per-tag sub-strategies (envelope::cartesian_point, envelope::cartesian_box, …) keyed off the geometry’s tag; the Rust analogue keeps that family as one per-kind strategy struct each (EnvelopePoint, EnvelopeBox, …), selected by the tag-keyed [EnvelopeStrategyForKind] picker.

§Associated items

  • Self::Output — the bounding-box type. For the Cartesian implementation this is always geometry_model::Box<G::Point>, matching Boost’s default_envelope_result<Geometry>::type (strategies/default_envelope_result.hpp).

Required Associated Types§

Source

type Output

The output box type. Mirrors boost::geometry::default_envelope_result<G>::type from strategies/default_envelope_result.hpp.

Required Methods§

Source

fn envelope(&self, g: &G) -> Self::Output

Compute the axis-aligned bounding box of g.

Mirrors boost::geometry::dispatch::envelope<G, Tag>::apply from algorithms/detail/envelope/interface.hpp, with the Box returned by value instead of mutated by reference.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeBox

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeLinestring

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeMultiLinestring

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeMultiPoint

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeMultiPolygon

Source§

impl<G> EnvelopeStrategy<G> for EnvelopePoint

Source§

impl<G> EnvelopeStrategy<G> for EnvelopePolygon

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeRing

Source§

impl<G> EnvelopeStrategy<G> for EnvelopeSegment