pub struct RTreePartitioner { /* private fields */ }Expand description
RTree-based spatial partitioner that uses pre-defined partition boundaries.
This partitioner constructs an RTree index over a set of partition boundaries (rectangles) and uses it to efficiently determine which partition a given bounding box belongs to based on spatial intersection.
Implementations§
Source§impl RTreePartitioner
impl RTreePartitioner
Sourcepub fn try_new(boundaries: Vec<BoundingBox>) -> Result<Self>
pub fn try_new(boundaries: Vec<BoundingBox>) -> Result<Self>
Create a new RTree partitioner from a collection of partition boundaries.
§Arguments
boundaries- A vector of bounding boxes representing partition boundaries. Each bounding box defines the spatial extent of one partition. The partition ID is the index in this vector.
§Errors
Returns an error if any boundary has wraparound coordinates (not supported)
§Example
use sedona_geometry::bounding_box::BoundingBox;
use sedona_spatial_join::partitioning::rtree::RTreePartitioner;
let boundaries = vec![
BoundingBox::xy((0.0, 50.0), (0.0, 50.0)),
BoundingBox::xy((50.0, 100.0), (0.0, 50.0)),
];
let partitioner = RTreePartitioner::try_new(boundaries).unwrap();Sourcepub fn try_new_with_node_size(
boundaries: Vec<BoundingBox>,
node_size: u16,
) -> Result<Self>
pub fn try_new_with_node_size( boundaries: Vec<BoundingBox>, node_size: u16, ) -> Result<Self>
Create a new RTree partitioner with a custom node size.
Trait Implementations§
Source§impl Clone for RTreePartitioner
impl Clone for RTreePartitioner
Source§fn clone(&self) -> RTreePartitioner
fn clone(&self) -> RTreePartitioner
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SpatialPartitioner for RTreePartitioner
impl SpatialPartitioner for RTreePartitioner
Source§fn num_regular_partitions(&self) -> usize
fn num_regular_partitions(&self) -> usize
Get the total number of spatial partitions, excluding the None partition and Multi partition.
Source§fn partition(&self, bbox: &BoundingBox) -> Result<SpatialPartition>
fn partition(&self, bbox: &BoundingBox) -> Result<SpatialPartition>
Given a bounding box, return the partition it is assigned to.
Source§fn partition_no_multi(&self, bbox: &BoundingBox) -> Result<SpatialPartition>
fn partition_no_multi(&self, bbox: &BoundingBox) -> Result<SpatialPartition>
Given a bounding box, return the partition it is assigned to. This function never returns
Multi partition. If
bbox intersects with multiple partitions, only one of them will be
selected as regular partition.Source§fn box_clone(&self) -> Box<dyn SpatialPartitioner>
fn box_clone(&self) -> Box<dyn SpatialPartitioner>
Clone the partitioner as a boxed trait object.
Auto Trait Implementations§
impl Freeze for RTreePartitioner
impl RefUnwindSafe for RTreePartitioner
impl Send for RTreePartitioner
impl Sync for RTreePartitioner
impl Unpin for RTreePartitioner
impl UnsafeUnpin for RTreePartitioner
impl UnwindSafe for RTreePartitioner
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more