GeoStatistics

Struct GeoStatistics 

Source
pub struct GeoStatistics { /* private fields */ }
Expand description

Statistics specific to spatial data types

These statistics are an abstraction to provide sedonadb the ability to perform generic pruning and optimization for datasources that have the ability to provide this information. This may evolve to support more fields; however, can currently express Parquet built-in GeoStatistics, GeoParquet metadata, and GDAL OGR (via GetExtent() and GetGeomType()). This struct can also represent partial or missing information.

Implementations§

Source§

impl GeoStatistics

Source

pub const UNSPECIFIED: GeoStatistics

Statistics representing unspecified information

Source

pub fn unspecified() -> Self

Create statistics representing unspecified information

Source

pub fn empty() -> Self

Create statistics representing empty information (with zero values instead of None)

Source

pub fn with_bbox(self, bbox: Option<BoundingBox>) -> Self

Update the bounding box and return self

Source

pub fn with_geometry_types( self, types: Option<GeometryTypeAndDimensionsSet>, ) -> Self

Update the geometry types and return self

Source

pub fn bbox(&self) -> Option<&BoundingBox>

Get the bounding box if available

Source

pub fn geometry_types(&self) -> Option<&GeometryTypeAndDimensionsSet>

Get the geometry types if available

Source

pub fn total_geometries(&self) -> Option<i64>

Get the total number of geometries if available

Source

pub fn total_size_bytes(&self) -> Option<i64>

Get the total size in bytes if available

Source

pub fn total_points(&self) -> Option<i64>

Get the total number of points if available

Source

pub fn puntal_count(&self) -> Option<i64>

Get the count of puntal geometries if available

Source

pub fn lineal_count(&self) -> Option<i64>

Get the count of lineal geometries if available

Source

pub fn polygonal_count(&self) -> Option<i64>

Get the count of polygonal geometries if available

Source

pub fn collection_count(&self) -> Option<i64>

Get the count of geometry collections if available

Source

pub fn total_envelope_width(&self) -> Option<f64>

Get the total envelope width if available

Source

pub fn total_envelope_height(&self) -> Option<f64>

Get the total envelope height if available

Source

pub fn mean_envelope_width(&self) -> Option<f64>

Calculate the mean envelope width if possible

Source

pub fn mean_envelope_height(&self) -> Option<f64>

Calculate the mean envelope height if possible

Source

pub fn mean_envelope_area(&self) -> Option<f64>

Calculate the mean envelope area if possible

Source

pub fn mean_size_bytes(&self) -> Option<f64>

Calculate the mean size in bytes if possible

Source

pub fn mean_points_per_geometry(&self) -> Option<f64>

Calculate the mean points per geometry if possible

Source

pub fn with_total_geometries(self, count: i64) -> Self

Update the total geometries count and return self

Source

pub fn with_total_size_bytes(self, bytes: i64) -> Self

Update the total size in bytes and return self

Source

pub fn with_total_points(self, points: i64) -> Self

Update the total points count and return self

Source

pub fn with_puntal_count(self, count: i64) -> Self

Update the puntal geometries count and return self

Source

pub fn with_lineal_count(self, count: i64) -> Self

Update the lineal geometries count and return self

Source

pub fn with_polygonal_count(self, count: i64) -> Self

Update the polygonal geometries count and return self

Source

pub fn with_collection_count(self, count: i64) -> Self

Update the collection geometries count and return self

Source

pub fn with_total_envelope_width(self, width: f64) -> Self

Update the total envelope width and return self

Source

pub fn with_total_envelope_height(self, height: f64) -> Self

Update the total envelope height and return self

Source

pub fn merge(&mut self, other: &Self)

Update this statistics object with another one

Source

pub fn try_from_column_statistics( stats: &ColumnStatistics, ) -> Result<Option<Self>>

Try to deserialize GeoStatistics from DataFusion ColumnStatistics

Various DataFusion APIs operate on ColumnStatistics, which do not support spatial statistics natively. This function attempts to reconstruct an object that was canonically serialized into one of these objects for transport through DataFusion internals.

Source

pub fn to_column_statistics(&self) -> Result<ColumnStatistics>

Serialize this object into a ColumnStatistics

Canonically place this object into a ColumnStatistics for transport through DataFusion APIs.

Source

pub fn try_with_str_geometry_types( self, geometry_types: Option<&[&str]>, ) -> Result<Self>

Add a definitive list of geometry type/dimension values specified as strings

This accepts a list of strings like “point z” or “polygon zm”. These strings are case insensitive.

Source

pub fn to_scalar_value(&self) -> Result<ScalarValue>

Convert this GeoStatistics to a ScalarValue for storage in DataFusion statistics

Trait Implementations§

Source§

impl Clone for GeoStatistics

Source§

fn clone(&self) -> GeoStatistics

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeoStatistics

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GeoStatistics

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<GeoStatistics> for TableGeoStatistics

Source§

fn from(value: GeoStatistics) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GeoStatistics

Source§

fn eq(&self, other: &GeoStatistics) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for GeoStatistics

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GeoStatistics

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,