IndexChunked

Struct IndexChunked 

Source
pub struct IndexChunked<'a, IX: IndexValue> {
    pub chunked_array: &'a UInt64Chunked,
    /* private fields */
}

Fields§

§chunked_array: &'a UInt64Chunked

Implementations§

Source§

impl<'a, IX: IndexValue> IndexChunked<'a, IX>

Source

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

Source

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.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn validity_bitmap(&self) -> Bitmap

Source

pub fn to_collection<C>(&self) -> Result<C, Error>
where C: FromIterator<IX>,

Trait Implementations§

Source§

impl<'a, IX> BoundingRect for IndexChunked<'a, IX>

Source§

impl<'a, IX> BuildKDTreeIndex<'a, IX> for IndexChunked<'a, IX>

Source§

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>

Build a KDTreeIndex using the default parameters. Read more
Source§

impl<'a, IX> BuildPackedHilbertRTreeIndex<IX> for IndexChunked<'a, IX>

Source§

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>

Source§

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<'a> H3CellClusters for IndexChunked<'a, H3Cell>

Source§

fn h3_cell_clusters(&self) -> Result<DataFrame, Error>

find clusters of neighboring cells Read more
Source§

fn h3_cell_clusters_eq_value(&self, values: &Series) -> Result<DataFrame, Error>

find clusters of neighboring cells where the same value is associated with the cells. Read more
Source§

impl<'a> H3ChangeResolution for IndexChunked<'a, H3Cell>

Source§

fn h3_change_resolution( &self, target_resolution: u8, ) -> Result<ListChunked, Error>

Changes the resolution of the contained H3Cell values Read more
Source§

impl<'a> H3CompactCells for IndexChunked<'a, H3Cell>

Source§

fn h3_compact_cells(&self) -> Result<UInt64Chunked, Error>

Compacts H3Cell using the H3 resolution hierarchy. Read more
Source§

impl<'a> H3GridDisk for IndexChunked<'a, H3Cell>

Source§

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>

Source§

fn h3_is_valid(&self) -> BooleanChunked

Example Read more
Source§

fn h3_all_valid(&self) -> bool

Returns true when all contained h3indexes are valid.
Source§

impl<'a, IX: IndexValue> H3Resolution for IndexChunked<'a, IX>

Source§

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>

Source§

fn get(&self, index: usize) -> Option<Self::Item>

get a nullable value by index. The returned Index is not validated.

Source§

type Item = IX

Source§

fn last(&self) -> Option<Self::Item>

This is much faster if we have many chunks as we don’t have to compute the index Read more
Source§

unsafe fn get_unchecked(&self, index: usize) -> Option<Self::Item>
where Self: Sized,

Get a value by index and ignore the null bit. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

Source§

fn is_within(&self, b: &G2) -> bool