GeometryBounder

Struct GeometryBounder 

Source
pub struct GeometryBounder {
    x_left: Interval,
    x_mid: Interval,
    x_right: Interval,
    y: Interval,
    z: Interval,
    m: Interval,
    geometry_types: HashSet<i32>,
    wraparound_hint: Interval,
}
Expand description

Geometry bounder

Utility to accumulate statistics for geometries as they are written. This bounder is designed to output statistics accumulated according to the Parquet specification such that the output can be written to Parquet statistics with minimal modification.

See the IntervalTrait for an in-depth discussion of wraparound bounding (which adds some complexity to this implementation).

Fields§

§x_left: Interval

Union of all contiguous x intervals to the left of the wraparound midpoint

§x_mid: Interval

Union of all contiguous x intervals that intersect the wraparound midpoint

§x_right: Interval

Union of all contiguous x intervals to the right of the wraparound midpoint

§y: Interval

Union of all y intervals

§z: Interval

Union of all z intervals

§m: Interval

Union of all m intervals

§geometry_types: HashSet<i32>

Unique geometry type codes encountered by the bounder

The integer codes are identical to the ISO WKB geometry type codes and are documented as part of the Parquet specification: https://github.com/apache/parquet-format/blob/master/Geospatial.md#geospatial-types

§wraparound_hint: Interval

Implementations§

Source§

impl GeometryBounder

Source

pub fn empty() -> Self

Create a new, empty bounder that represents empty input

Source

pub fn with_wraparound_hint(self, wraparound_hint: impl Into<Interval>) -> Self

Set the hint to use for generation of potential wraparound xmin/xmax output

Usually this value should be set to (-180, 180), as wraparound is primarily targeted at lon/lat coordinate systems where collections of features with components at the very far left and very far right of the coordinate system are actually very close to each other.

It is safe to set this value even when the actual coordinate system of the input is unknown: if the input has coordinate values that are outside the range of the wraparound hint, wraparound xmin/xmax values will not be generated. If the input has coordinate values that are well inside of the range of the wraparound hint, the wraparound xmin/xmax value will be substantially wider than the non-wraparound version and will not be returned.

Source

pub fn x(&self) -> WraparoundInterval

Calculate the final xmin and xmax for geometries encountered by this bounder

The interval returned may wraparound if a hint was set and the input encountered by this bounder were exclusively at the far left and far right of the input range. See IntervalTrait for an in-depth description of wraparound intervals.

Source

pub fn y(&self) -> Interval

Calculate the final ymin and ymax for geometries encountered by this bounder

Source

pub fn z(&self) -> Interval

Calculate the final zmin and zmax for geometries encountered by this bounder

Source

pub fn m(&self) -> Interval

Calculate the final mmin and mmax values for geometries encountered by this bounder

Source

pub fn geometry_types(&self) -> Vec<i32>

Calculate the final geometry type set

Returns a copy of the unique geometry type/dimension combinations encountered by this bounder. These identifiers are ISO WKB identifiers (e.g., 1001 for PointZ). The output is always returned sorted.

Source

pub fn update_wkb(&mut self, wkb: &[u8]) -> Result<(), ArrowError>

Update this bounder with one WKB-encoded geometry

Parses and accumulates the bounds of one WKB-encoded geometry. This function will error for invalid WKB input; however, clients may wish to ignore such an error for the purposes of writing statistics.

Source

fn update_geometry( &mut self, geom: &impl GeometryTrait<T = f64>, ) -> Result<(), ArrowError>

Source

fn update_x(&mut self, x: &Interval)

Trait Implementations§

Source§

impl Debug for GeometryBounder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.