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
impl GeometryBounder
Sourcepub fn with_wraparound_hint(self, wraparound_hint: impl Into<Interval>) -> Self
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.
Sourcepub fn x(&self) -> WraparoundInterval
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.
Sourcepub fn y(&self) -> Interval
pub fn y(&self) -> Interval
Calculate the final ymin and ymax for geometries encountered by this bounder
Sourcepub fn z(&self) -> Interval
pub fn z(&self) -> Interval
Calculate the final zmin and zmax for geometries encountered by this bounder
Sourcepub fn m(&self) -> Interval
pub fn m(&self) -> Interval
Calculate the final mmin and mmax values for geometries encountered by this bounder
Sourcepub fn geometry_types(&self) -> Vec<i32>
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.
Sourcepub fn update_wkb(&mut self, wkb: &[u8]) -> Result<(), ArrowError>
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.