pub struct PointIndex { /* private fields */ }Expand description
A k-d tree over points, split at the median of each cell’s widest axis.
Holds its own copy of the points.
Implementations§
Source§impl PointIndex
impl PointIndex
Sourcepub fn build(points: &[Point]) -> OgeomResult<Self>
pub fn build(points: &[Point]) -> OgeomResult<Self>
Build the tree over a cloud.
§Errors
OgeomError::Numeric if a point
is not finite, and
OgeomError::Range for a cloud of
more than four billion points.
Sourcepub fn nearest(&self, p: Point, max: f64) -> Option<Neighbour>
pub fn nearest(&self, p: Point, max: f64) -> Option<Neighbour>
The point nearest p, no farther than max; the lowest index among
equally near ones. max may be infinite.
Sourcepub fn nearest_many(&self, points: &[Point], max: f64) -> Vec<Option<Neighbour>>
pub fn nearest_many(&self, points: &[Point], max: f64) -> Vec<Option<Neighbour>>
PointIndex::nearest for each point, in parallel, answers in point
order.
Trait Implementations§
Source§impl Clone for PointIndex
impl Clone for PointIndex
Auto Trait Implementations§
impl Freeze for PointIndex
impl RefUnwindSafe for PointIndex
impl Send for PointIndex
impl Sync for PointIndex
impl Unpin for PointIndex
impl UnsafeUnpin for PointIndex
impl UnwindSafe for PointIndex
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,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.