pub struct GeoShapeStore { /* private fields */ }Expand description
Per-segment geo shape storage with packed R-tree for candidate selection.
Stores bounding boxes for R-tree indexing and serialized shape data for exact predicate evaluation. Indexed by doc_id.
See [[feature-geo-shape]].
Implementations§
Source§impl GeoShapeStore
impl GeoShapeStore
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn shape_offsets_ref(&self) -> &[u32]
pub fn shape_offsets_ref(&self) -> &[u32]
Access the raw shape offsets (for R-tree doc ID mapping).
Sourcepub fn rtree_data(&self) -> &[u8] ⓘ
pub fn rtree_data(&self) -> &[u8] ⓘ
Get the pre-built R-tree bytes (empty if not yet built).
Sourcepub fn is_rect_shape(&self, doc_id: u32) -> bool
pub fn is_rect_shape(&self, doc_id: u32) -> bool
Check if a doc’s shape is a Rect (bbox == exact geometry).
Sourcepub fn get_bbox(&self, doc_id: u32) -> Option<(f64, f64, f64, f64)>
pub fn get_bbox(&self, doc_id: u32) -> Option<(f64, f64, f64, f64)>
Get the bounding box for a doc, or None if null.
Sourcepub fn get_shape(&self, doc_id: u32) -> Option<Geometry<f64>>
pub fn get_shape(&self, doc_id: u32) -> Option<Geometry<f64>>
Deserialize and return the full geometry for a doc.
Sourcepub fn build_rtree(&self) -> Vec<u8> ⓘ
pub fn build_rtree(&self) -> Vec<u8> ⓘ
Build a packed R-tree from the stored bounding boxes.
Sourcepub fn search_rtree(
rtree_data: &[u8],
query_bbox: (f64, f64, f64, f64),
shape_offsets: &[u32],
) -> Vec<u32>
pub fn search_rtree( rtree_data: &[u8], query_bbox: (f64, f64, f64, f64), shape_offsets: &[u32], ) -> Vec<u32>
Search the R-tree for candidates whose bboxes intersect the query bbox. Returns doc IDs (not R-tree insertion indices).
Sourcepub fn from_bytes(data: &[u8]) -> Self
pub fn from_bytes(data: &[u8]) -> Self
Deserialize from segment bytes.
Trait Implementations§
Source§impl Clone for GeoShapeStore
impl Clone for GeoShapeStore
Source§fn clone(&self) -> GeoShapeStore
fn clone(&self) -> GeoShapeStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GeoShapeStore
impl RefUnwindSafe for GeoShapeStore
impl Send for GeoShapeStore
impl Sync for GeoShapeStore
impl Unpin for GeoShapeStore
impl UnsafeUnpin for GeoShapeStore
impl UnwindSafe for GeoShapeStore
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