pub struct KDTreeIndex<IX: IndexValue> {
pub kdbush: Option<KDBush>,
/* private fields */
}Expand description
A very fast static spatial index for 2D points based on a flat KD-tree.
Operates only the centroid coordinate, not on envelopes / bounding boxes.
§Example
use polars::prelude::UInt64Chunked;
use h3ron::H3Cell;
use h3ron_polars::{AsH3CellChunked, NamedFromIndexes};
use h3ron_polars::spatial_index::BuildKDTreeIndex;
let uc = UInt64Chunked::new_from_indexes(
"",
vec![
H3Cell::from_coordinate((45.5, 45.5).into(), 7).unwrap(),
H3Cell::from_coordinate((-60.5, -60.5).into(), 7).unwrap(),
H3Cell::from_coordinate((120.5, 70.5).into(), 7).unwrap(),
],
);
let idx = uc.h3cell().kdtree_index();Fields§
§kdbush: Option<KDBush>Trait Implementations§
Source§impl<IX> SpatialIndex<IX, CoordinateSIKind> for KDTreeIndex<IX>where
IX: CoordinateIndexable + IndexValue,
impl<IX> SpatialIndex<IX, CoordinateSIKind> for KDTreeIndex<IX>where
IX: CoordinateIndexable + IndexValue,
fn h3indexchunked(&self) -> IndexChunked<'_, IX>
Source§fn envelopes_intersect_impl(&self, rect: &Rect) -> MutableBitmap
fn envelopes_intersect_impl(&self, rect: &Rect) -> MutableBitmap
internal
Source§fn envelopes_within_distance(
&self,
coord: Coord,
distance: f64,
) -> BooleanChunked
fn envelopes_within_distance( &self, coord: Coord, distance: f64, ) -> BooleanChunked
Source§fn envelopes_intersect(&self, rect: &Rect) -> BooleanChunked
fn envelopes_intersect(&self, rect: &Rect) -> BooleanChunked
The envelope of the indexed elements has some overlap with the given
rectAuto Trait Implementations§
impl<IX> Freeze for KDTreeIndex<IX>
impl<IX> !RefUnwindSafe for KDTreeIndex<IX>
impl<IX> Send for KDTreeIndex<IX>where
IX: Send,
impl<IX> Sync for KDTreeIndex<IX>where
IX: Sync,
impl<IX> Unpin for KDTreeIndex<IX>where
IX: Unpin,
impl<IX> !UnwindSafe for KDTreeIndex<IX>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, IX> SpatialIndexGeomOp<IX, CoordinateSIKind> for T
impl<T, IX> SpatialIndexGeomOp<IX, CoordinateSIKind> for T
Source§fn geometries_intersect(&self, rect: &Rect) -> ChunkedArray<BooleanType>
fn geometries_intersect(&self, rect: &Rect) -> ChunkedArray<BooleanType>
The geometry of the indexed elements is with in the given Rect
Source§fn geometries_intersect_polygon(
&self,
polygon: &Polygon,
) -> ChunkedArray<BooleanType>
fn geometries_intersect_polygon( &self, polygon: &Polygon, ) -> ChunkedArray<BooleanType>
The geometry of the indexed elements is with in the given Polygon
Source§fn geometries_intersect_multipolygon(
&self,
multipolygon: &MultiPolygon,
) -> ChunkedArray<BooleanType>
fn geometries_intersect_multipolygon( &self, multipolygon: &MultiPolygon, ) -> ChunkedArray<BooleanType>
The geometry of the indexed elements is with in the given MultiPolygon