pub struct IndexChunked<'a, IX: IndexValue> {
pub chunked_array: &'a UInt64Chunked,
/* private fields */
}Fields§
§chunked_array: &'a UInt64ChunkedImplementations§
Source§impl<'a, IX: IndexValue> IndexChunked<'a, IX>
impl<'a, IX: IndexValue> IndexChunked<'a, IX>
Sourcepub fn iter_indexes_validated(&self) -> ValidatedIndexIter<'_, IX> ⓘ
pub fn iter_indexes_validated(&self) -> ValidatedIndexIter<'_, IX> ⓘ
iterate over the Index values in this array.
The contained u64 values are validated and returned as Results
Sourcepub fn iter_indexes_nonvalidated(&self) -> NonValidatedIndexIter<'_, IX> ⓘ
pub fn iter_indexes_nonvalidated(&self) -> NonValidatedIndexIter<'_, IX> ⓘ
iterate over the Index values in this array.
The contained u64 values are not validated, so there may be invalid Index values.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn validity_bitmap(&self) -> Bitmap
pub fn to_collection<C>(&self) -> Result<C, Error>where
C: FromIterator<IX>,
Trait Implementations§
Source§impl<'a, IX> BoundingRect for IndexChunked<'a, IX>where
IX: BoundingRect + IndexValue,
impl<'a, IX> BoundingRect for IndexChunked<'a, IX>where
IX: BoundingRect + IndexValue,
Source§impl<'a, IX> BuildKDTreeIndex<'a, IX> for IndexChunked<'a, IX>where
IX: CoordinateIndexable + IndexValue,
impl<'a, IX> BuildKDTreeIndex<'a, IX> for IndexChunked<'a, IX>where
IX: CoordinateIndexable + IndexValue,
Source§fn kdtree_index_with_node_size(&self, node_size: u8) -> KDTreeIndex<IX>
fn kdtree_index_with_node_size(&self, node_size: u8) -> KDTreeIndex<IX>
Build a KDTreeIndex using custom parameters. Read more
Source§fn kdtree_index(&self) -> KDTreeIndex<IX>
fn kdtree_index(&self) -> KDTreeIndex<IX>
Build a KDTreeIndex using the default parameters. Read more
Source§impl<'a, IX> BuildPackedHilbertRTreeIndex<IX> for IndexChunked<'a, IX>where
IX: RectIndexable + IndexValue,
impl<'a, IX> BuildPackedHilbertRTreeIndex<IX> for IndexChunked<'a, IX>where
IX: RectIndexable + IndexValue,
Source§fn packed_hilbert_rtree_index(
&self,
) -> Result<PackedHilbertRTreeIndex<IX>, Error>
fn packed_hilbert_rtree_index( &self, ) -> Result<PackedHilbertRTreeIndex<IX>, Error>
Build a spatial index using the packed Hilbert R-tree algorithm Read more
Source§impl<'a, IX> BuildRTreeIndex<'a, IX> for IndexChunked<'a, IX>where
IX: RectIndexable + IndexValue,
impl<'a, IX> BuildRTreeIndex<'a, IX> for IndexChunked<'a, IX>where
IX: RectIndexable + IndexValue,
Source§fn rtree_index(&self) -> RTreeIndex<IX>
fn rtree_index(&self) -> RTreeIndex<IX>
Build a R-Tree spatial index
§Example
use geo_types::Rect;
use polars::prelude::UInt64Chunked;
use polars_core::prelude::TakeRandom;
use h3ron::{H3Cell, Index};
use h3ron_polars::{AsH3CellChunked, NamedFromIndexes};
use h3ron_polars::spatial_index::{BuildRTreeIndex, SpatialIndex, SpatialIndexGeomOp};
let ca = 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 rtree = ca.h3cell().rtree_index();
let mask = rtree.geometries_intersect(&Rect::new((40.0, 40.0), (50.0, 50.0)));
assert_eq!(mask.len(), 3);
assert_eq!(mask.get(0), Some(true));
assert_eq!(mask.get(1), Some(false));
assert_eq!(mask.get(2), Some(false));Source§impl<'a, IX: Clone + IndexValue> Clone for IndexChunked<'a, IX>
impl<'a, IX: Clone + IndexValue> Clone for IndexChunked<'a, IX>
Source§fn clone(&self) -> IndexChunked<'a, IX>
fn clone(&self) -> IndexChunked<'a, IX>
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<'a> H3CellClusters for IndexChunked<'a, H3Cell>
impl<'a> H3CellClusters for IndexChunked<'a, H3Cell>
Source§impl<'a> H3ChangeResolution for IndexChunked<'a, H3Cell>
impl<'a> H3ChangeResolution for IndexChunked<'a, H3Cell>
Source§fn h3_change_resolution(
&self,
target_resolution: u8,
) -> Result<ListChunked, Error>
fn h3_change_resolution( &self, target_resolution: u8, ) -> Result<ListChunked, Error>
Changes the resolution of the contained
H3Cell values Read moreSource§impl<'a> H3CompactCells for IndexChunked<'a, H3Cell>
impl<'a> H3CompactCells for IndexChunked<'a, H3Cell>
Source§fn h3_compact_cells(&self) -> Result<UInt64Chunked, Error>
fn h3_compact_cells(&self) -> Result<UInt64Chunked, Error>
Compacts
H3Cell using the H3 resolution hierarchy. Read moreSource§impl<'a> H3GridDisk for IndexChunked<'a, H3Cell>
impl<'a> H3GridDisk for IndexChunked<'a, H3Cell>
Source§fn h3_grid_disk(&self, k: u32) -> Result<ListChunked, Error>
fn h3_grid_disk(&self, k: u32) -> Result<ListChunked, Error>
Produces all cells within k distance of the origin cell. Read more
Source§impl<'a, IX: IndexValue> H3IsValid for IndexChunked<'a, IX>
impl<'a, IX: IndexValue> H3IsValid for IndexChunked<'a, IX>
Source§fn h3_is_valid(&self) -> BooleanChunked
fn h3_is_valid(&self) -> BooleanChunked
Example Read more
Source§fn h3_all_valid(&self) -> bool
fn h3_all_valid(&self) -> bool
Returns true when all contained h3indexes are valid.
Source§impl<'a, IX: IndexValue> H3Resolution for IndexChunked<'a, IX>
impl<'a, IX: IndexValue> H3Resolution for IndexChunked<'a, IX>
Source§fn h3_resolution(&self) -> UInt8Chunked
fn h3_resolution(&self) -> UInt8Chunked
Obtain the H3 Resolutions at the array positions where
the contained
Index values are valid.Source§impl<'a, IX: IndexValue> TakeRandom for IndexChunked<'a, IX>
impl<'a, IX: IndexValue> TakeRandom for IndexChunked<'a, IX>
Auto Trait Implementations§
impl<'a, IX> Freeze for IndexChunked<'a, IX>
impl<'a, IX> !RefUnwindSafe for IndexChunked<'a, IX>
impl<'a, IX> Send for IndexChunked<'a, IX>where
IX: Send,
impl<'a, IX> Sync for IndexChunked<'a, IX>where
IX: Sync,
impl<'a, IX> Unpin for IndexChunked<'a, IX>where
IX: Unpin,
impl<'a, IX> !UnwindSafe for IndexChunked<'a, 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> 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