pub struct PointIndex<M: Clone + Default + Serialize + DeserializeOwned = MValue, S: VectorStore<S2CellId, IndexPoint<M>> = Vector<S2CellId, IndexPoint<M>>> { /* private fields */ }Expand description
Implementations§
Source§impl<M: Clone + Default + Serialize + DeserializeOwned, S: VectorStore<S2CellId, IndexPoint<M>>> PointIndex<M, S>
impl<M: Clone + Default + Serialize + DeserializeOwned, S: VectorStore<S2CellId, IndexPoint<M>>> PointIndex<M, S>
Sourcepub fn new(store: Option<S>, projection: Option<Projection>) -> Self
pub fn new(store: Option<S>, projection: Option<Projection>) -> Self
Create a new PointIndex
Sourcepub fn get_index(&self, index: u64) -> Option<&(S2CellId, IndexPoint<M>)>
pub fn get_index(&self, index: u64) -> Option<&(S2CellId, IndexPoint<M>)>
Get a reference to the point store
Sourcepub fn get_index_mut(
&mut self,
index: u64,
) -> Option<&mut (S2CellId, IndexPoint<M>)>
pub fn get_index_mut( &mut self, index: u64, ) -> Option<&mut (S2CellId, IndexPoint<M>)>
Get a mutable reference to the point store
Sourcepub fn insert(&mut self, cell: S2CellId, point: S2Point, data: Option<M>)
pub fn insert(&mut self, cell: S2CellId, point: S2Point, data: Option<M>)
Insert a cell with the point and its corresponding data to the index
Sourcepub fn insert_point<T: GetXY>(&mut self, point: T, data: Option<M>)
pub fn insert_point<T: GetXY>(&mut self, point: T, data: Option<M>)
Add a lon-lat pair as with any shape
Sourcepub fn insert_lon_lat(&mut self, vp: LonLat<M>)
pub fn insert_lon_lat(&mut self, vp: LonLat<M>)
Add a lon-lat pair to the cluster
Sourcepub fn insert_vector_point(&mut self, vp: VectorPoint<M>)
pub fn insert_vector_point(&mut self, vp: VectorPoint<M>)
Add a lon-lat pair via a VectorPoint to the cluster
Sourcepub fn insert_face_st(&mut self, face: Face, s: f64, t: f64, data: M)
pub fn insert_face_st(&mut self, face: Face, s: f64, t: f64, data: M)
Insert an STPoint to the index
Sourcepub fn insert_reader<T: Clone, F: FeatureReader<T, M, M>>(&mut self, reader: &F)
pub fn insert_reader<T: Clone, F: FeatureReader<T, M, M>>(&mut self, reader: &F)
Add all points from a reader. It will try to use the M-value first, but if it doesn’t exist it will use the feature properties data
Sourcepub fn insert_feature<T: Clone>(&mut self, data: JSONCollection<T, M, M>)
pub fn insert_feature<T: Clone>(&mut self, data: JSONCollection<T, M, M>)
Add a vector feature. It will try to use the M-value first, but if it doesn’t exist it will use the feature properties data
Sourcepub fn lower_bound(&self, id: S2CellId) -> u64
pub fn lower_bound(&self, id: S2CellId) -> u64
Find the starting index of a search
Sourcepub fn search_range(
&self,
low: S2CellId,
high: Option<S2CellId>,
max_results: Option<usize>,
) -> Vec<&(S2CellId, IndexPoint<M>)>
pub fn search_range( &self, low: S2CellId, high: Option<S2CellId>, max_results: Option<usize>, ) -> Vec<&(S2CellId, IndexPoint<M>)>
Search for points given a range of low and high ids
Sourcepub fn search_range_mut(
&mut self,
low: S2CellId,
high: Option<S2CellId>,
max_results: Option<usize>,
) -> Vec<&mut (S2CellId, IndexPoint<M>)>
pub fn search_range_mut( &mut self, low: S2CellId, high: Option<S2CellId>, max_results: Option<usize>, ) -> Vec<&mut (S2CellId, IndexPoint<M>)>
Search for points given a range of low and high ids
Sourcepub fn search_radius<M2: Clone + Default>(
&self,
target: &LonLat<M2>,
radius: S1ChordAngle,
max_results: Option<usize>,
) -> Vec<&(S2CellId, IndexPoint<M>)>
pub fn search_radius<M2: Clone + Default>( &self, target: &LonLat<M2>, radius: S1ChordAngle, max_results: Option<usize>, ) -> Vec<&(S2CellId, IndexPoint<M>)>
TODO: WG Proj case: is the radius correct? Search for points within a given radius of a target point
Sourcepub fn s2_search_radius(
&self,
target: S2Point,
radius: S1ChordAngle,
max_results: Option<usize>,
) -> Vec<&(S2CellId, IndexPoint<M>)>
pub fn s2_search_radius( &self, target: S2Point, radius: S1ChordAngle, max_results: Option<usize>, ) -> Vec<&(S2CellId, IndexPoint<M>)>
Search for points within a given radius of a target point in S2 space
Sourcepub fn search_radius_mut<M2: Clone + Default>(
&mut self,
target: &LonLat<M2>,
radius: S1ChordAngle,
max_results: Option<usize>,
) -> Vec<&mut (S2CellId, IndexPoint<M>)>
pub fn search_radius_mut<M2: Clone + Default>( &mut self, target: &LonLat<M2>, radius: S1ChordAngle, max_results: Option<usize>, ) -> Vec<&mut (S2CellId, IndexPoint<M>)>
TODO: WG Proj case: is the radius correct? Search for points within a given radius of a target point
Sourcepub fn s2_search_radius_mut(
&mut self,
target: S2Point,
radius: S1ChordAngle,
max_results: Option<usize>,
) -> Vec<&mut (S2CellId, IndexPoint<M>)>
pub fn s2_search_radius_mut( &mut self, target: S2Point, radius: S1ChordAngle, max_results: Option<usize>, ) -> Vec<&mut (S2CellId, IndexPoint<M>)>
Search for points within a given radius of a target point in S2 space
Sourcepub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a (S2CellId, IndexPoint<M>)>where
IndexPoint<M>: 'a,
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a (S2CellId, IndexPoint<M>)>where
IndexPoint<M>: 'a,
Get a reference iterator over the point store
Sourcepub fn iter_mut<'a>(
&'a mut self,
) -> impl Iterator<Item = &'a mut (S2CellId, IndexPoint<M>)>where
IndexPoint<M>: 'a,
pub fn iter_mut<'a>(
&'a mut self,
) -> impl Iterator<Item = &'a mut (S2CellId, IndexPoint<M>)>where
IndexPoint<M>: 'a,
Get a mutable iterator over the point store
Trait Implementations§
Source§impl<M: Debug + Clone + Default + Serialize + DeserializeOwned, S: Debug + VectorStore<S2CellId, IndexPoint<M>>> Debug for PointIndex<M, S>
impl<M: Debug + Clone + Default + Serialize + DeserializeOwned, S: Debug + VectorStore<S2CellId, IndexPoint<M>>> Debug for PointIndex<M, S>
Source§impl<M: Default + Clone + Default + Serialize + DeserializeOwned, S: Default + VectorStore<S2CellId, IndexPoint<M>>> Default for PointIndex<M, S>
impl<M: Default + Clone + Default + Serialize + DeserializeOwned, S: Default + VectorStore<S2CellId, IndexPoint<M>>> Default for PointIndex<M, S>
Source§fn default() -> PointIndex<M, S>
fn default() -> PointIndex<M, S>
Auto Trait Implementations§
impl<M, S> Freeze for PointIndex<M, S>where
S: Freeze,
impl<M, S> RefUnwindSafe for PointIndex<M, S>where
S: RefUnwindSafe,
M: RefUnwindSafe,
impl<M, S> Send for PointIndex<M, S>
impl<M, S> Sync for PointIndex<M, S>
impl<M, S> Unpin for PointIndex<M, S>
impl<M, S> UnwindSafe for PointIndex<M, S>where
S: UnwindSafe,
M: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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>
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>
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<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().