pub struct GeometryCollectionArray<O: OffsetSizeTrait> {
    pub array: MixedGeometryArray<O>,
    pub geom_offsets: OffsetBuffer<O>,
    pub validity: Option<NullBuffer>,
    /* private fields */
}
Expand description

An immutable array of GeometryCollection geometries using GeoArrow’s in-memory representation.

This is semantically equivalent to Vec<Option<GeometryCollection>> due to the internal validity bitmap.

Fields§

§array: MixedGeometryArray<O>§geom_offsets: OffsetBuffer<O>

Offsets into the mixed geometry array where each geometry starts

§validity: Option<NullBuffer>

Validity bitmap

Implementations§

source§

impl<O: OffsetSizeTrait> GeometryCollectionArray<O>

source

pub fn new( array: MixedGeometryArray<O>, geom_offsets: OffsetBuffer<O>, validity: Option<NullBuffer> ) -> Self

Create a new GeometryCollectionArray from parts

Implementation

This function is O(1).

source§

impl<O: OffsetSizeTrait> GeometryCollectionArray<O>

source

pub fn iter_geo_values(&self) -> impl Iterator<Item = GeometryCollection> + '_

Iterator over geo Geometry objects, not looking at validity

source

pub fn iter_geo( &self ) -> ZipValidity<GeometryCollection, impl Iterator<Item = GeometryCollection> + '_, BitIterator<'_>>

Iterator over geo Geometry objects, taking into account validity

source§

impl<'a, O: OffsetSizeTrait> GeometryCollectionArray<O>

source

pub fn iter(&'a self) -> GeometryCollectionArrayIter<'_, O>

Returns an iterator of Option<GeometryCollection>

Trait Implementations§

source§

impl<O: Clone + OffsetSizeTrait> Clone for GeometryCollectionArray<O>

source§

fn clone(&self) -> GeometryCollectionArray<O>

Returns a copy 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<O: Debug + OffsetSizeTrait> Debug for GeometryCollectionArray<O>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<A: OffsetSizeTrait, B: OffsetSizeTrait> From<&GeometryCollectionArray<A>> for WKBArray<B>

source§

fn from(value: &GeometryCollectionArray<A>) -> Self

Converts to this type from the input type.
source§

impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for GeometryCollectionArray<O>

§

type Item = GeometryCollection<'a, O>

The geoarrow scalar object for this geometry array type.
§

type ItemGeo = GeometryCollection

The geo scalar object for this geometry array type.
source§

unsafe fn value_unchecked(&'a self, index: usize) -> Self::Item

Returns the element at index i Read more
source§

fn value(&'a self, index: usize) -> Self::Item

Returns the element at index i Read more
source§

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

Access the value at slot i as an Arrow scalar, considering validity.
source§

fn value_as_geo(&'a self, i: usize) -> Self::ItemGeo

Access the value at slot i as a geo scalar, not considering validity.
source§

fn get_as_geo(&'a self, i: usize) -> Option<Self::ItemGeo>

Access the value at slot i as a geo scalar, considering validity.
source§

impl<'a, O: OffsetSizeTrait> GeometryArrayTrait<'a> for GeometryCollectionArray<O>

source§

fn len(&self) -> usize

Returns the number of geometries in this array

source§

fn validity(&self) -> Option<&NullBuffer>

Returns the optional validity.

source§

fn slice(&self, offset: usize, length: usize) -> Self

Slices this GeometryCollectionArray in place.

Implementation

This operation is O(1) as it amounts to increase two ref counts.

Examples
use arrow::array::PrimitiveArray;
use arrow_array::types::Int32Type;

let array: PrimitiveArray<Int32Type> = PrimitiveArray::from(vec![1, 2, 3]);
assert_eq!(format!("{:?}", array), "PrimitiveArray<Int32>\n[\n  1,\n  2,\n  3,\n]");
let sliced = array.slice(1, 1);
assert_eq!(format!("{:?}", sliced), "PrimitiveArray<Int32>\n[\n  2,\n]");

// note: `sliced` and `array` share the same memory region.
Panic

This function panics iff offset + length > self.len().

source§

fn as_any(&self) -> &dyn Any

Returns the array as Any so that it can be downcasted to a specific implementation. Read more
source§

fn data_type(&self) -> &GeoDataType

Returns a reference to the DataType of this array. Read more
source§

fn storage_type(&self) -> DataType

Get the logical DataType of this array.
source§

fn extension_field(&self) -> Arc<Field>

Get the extension type of this array, as defined by the GeoArrow specification. Read more
source§

fn extension_name(&self) -> &str

Get the extension name of this array.
source§

fn into_array_ref(self) -> Arc<dyn Array>

Convert this array into an arced arrow array. Read more
source§

fn with_coords(self, _coords: CoordBuffer) -> Self

Create a new array with replaced coordinates Read more
source§

fn coord_type(&self) -> CoordType

Get the coordinate type of this geometry array, either interleaved or separated.
source§

fn into_coord_type(self, _coord_type: CoordType) -> Self

Cast the coordinate buffer of this geometry array to the given coordinate type.
source§

fn owned_slice(&self, _offset: usize, _length: usize) -> Self

A slice that fully copies the contents of the underlying buffer
source§

fn is_empty(&self) -> bool

Returns true if the array is empty.
source§

fn nulls(&self) -> Option<&NullBuffer>

source§

fn logical_nulls(&self) -> Option<NullBuffer>

source§

fn null_count(&self) -> usize

The number of null slots in this array. Read more
source§

fn is_null(&self, i: usize) -> bool

Returns whether slot i is null. Read more
source§

fn is_valid(&self, i: usize) -> bool

Returns whether slot i is valid. Read more
source§

impl<O: OffsetSizeTrait> IntoArrow for GeometryCollectionArray<O>

source§

impl<'a, O: OffsetSizeTrait> RTree<'a> for GeometryCollectionArray<O>

§

type RTreeObject = CachedEnvelope<GeometryCollection<'a, O>>

The object type to store in the RTree.
source§

fn rstar_tree(&'a self) -> RTree<Self::RTreeObject>

Build an RTree spatial index containing this array’s geometries.

Auto Trait Implementations§

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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<G1, G2> Within<G2> for G1
where G2: Contains<G1>,

source§

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

source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,