Struct geoarrow2::array::geometrycollection::array::GeometryCollectionArray
source · 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>
impl<O: OffsetSizeTrait> GeometryCollectionArray<O>
sourcepub fn new(
array: MixedGeometryArray<O>,
geom_offsets: OffsetBuffer<O>,
validity: Option<NullBuffer>
) -> Self
pub fn new( array: MixedGeometryArray<O>, geom_offsets: OffsetBuffer<O>, validity: Option<NullBuffer> ) -> Self
source§impl<O: OffsetSizeTrait> GeometryCollectionArray<O>
impl<O: OffsetSizeTrait> GeometryCollectionArray<O>
sourcepub fn iter_geo_values(&self) -> impl Iterator<Item = GeometryCollection> + '_
pub fn iter_geo_values(&self) -> impl Iterator<Item = GeometryCollection> + '_
Iterator over geo Geometry objects, not looking at validity
sourcepub fn iter_geo(
&self
) -> ZipValidity<GeometryCollection, impl Iterator<Item = GeometryCollection> + '_, BitIterator<'_>> ⓘ
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>
impl<'a, O: OffsetSizeTrait> GeometryCollectionArray<O>
sourcepub fn iter(&'a self) -> GeometryCollectionArrayIter<'_, O> ⓘ
pub fn iter(&'a self) -> GeometryCollectionArrayIter<'_, O> ⓘ
Returns an iterator of Option<GeometryCollection>
Trait Implementations§
source§impl<O: Clone + OffsetSizeTrait> Clone for GeometryCollectionArray<O>
impl<O: Clone + OffsetSizeTrait> Clone for GeometryCollectionArray<O>
source§fn clone(&self) -> GeometryCollectionArray<O>
fn clone(&self) -> GeometryCollectionArray<O>
Returns a copy 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<O: Debug + OffsetSizeTrait> Debug for GeometryCollectionArray<O>
impl<O: Debug + OffsetSizeTrait> Debug for GeometryCollectionArray<O>
source§impl<A: OffsetSizeTrait, B: OffsetSizeTrait> From<&GeometryCollectionArray<A>> for WKBArray<B>
impl<A: OffsetSizeTrait, B: OffsetSizeTrait> From<&GeometryCollectionArray<A>> for WKBArray<B>
source§fn from(value: &GeometryCollectionArray<A>) -> Self
fn from(value: &GeometryCollectionArray<A>) -> Self
Converts to this type from the input type.
source§impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for GeometryCollectionArray<O>
impl<'a, O: OffsetSizeTrait> GeoArrayAccessor<'a> for GeometryCollectionArray<O>
§type Item = GeometryCollection<'a, O>
type Item = GeometryCollection<'a, O>
The geoarrow scalar object for this geometry array type.
source§unsafe fn value_unchecked(&'a self, index: usize) -> Self::Item
unsafe fn value_unchecked(&'a self, index: usize) -> Self::Item
Returns the element at index
i
Read moresource§fn get(&'a self, index: usize) -> Option<Self::Item>
fn get(&'a self, index: usize) -> Option<Self::Item>
Access the value at slot
i
as an Arrow scalar, considering validity.source§impl<'a, O: OffsetSizeTrait> GeometryArrayTrait<'a> for GeometryCollectionArray<O>
impl<'a, O: OffsetSizeTrait> GeometryArrayTrait<'a> for GeometryCollectionArray<O>
source§fn validity(&self) -> Option<&NullBuffer>
fn validity(&self) -> Option<&NullBuffer>
Returns the optional validity.
source§fn slice(&self, offset: usize, length: usize) -> Self
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 data_type(&self) -> &GeoDataType
fn data_type(&self) -> &GeoDataType
source§fn storage_type(&self) -> DataType
fn storage_type(&self) -> DataType
Get the logical DataType of this array.
source§fn extension_field(&self) -> Arc<Field>
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
fn extension_name(&self) -> &str
Get the extension name of this array.
source§fn into_array_ref(self) -> Arc<dyn Array>
fn into_array_ref(self) -> Arc<dyn Array>
source§fn with_coords(self, _coords: CoordBuffer) -> Self
fn with_coords(self, _coords: CoordBuffer) -> Self
Create a new array with replaced coordinates Read more
source§fn coord_type(&self) -> CoordType
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
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
fn owned_slice(&self, _offset: usize, _length: usize) -> Self
A slice that fully copies the contents of the underlying buffer
fn nulls(&self) -> Option<&NullBuffer>
fn logical_nulls(&self) -> Option<NullBuffer>
source§fn null_count(&self) -> usize
fn null_count(&self) -> usize
The number of null slots in this array. Read more
source§impl<O: OffsetSizeTrait> IntoArrow for GeometryCollectionArray<O>
impl<O: OffsetSizeTrait> IntoArrow for GeometryCollectionArray<O>
type ArrowArray = GenericListArray<O>
fn into_arrow(self) -> Self::ArrowArray
source§impl<'a, O: OffsetSizeTrait> RTree<'a> for GeometryCollectionArray<O>
impl<'a, O: OffsetSizeTrait> RTree<'a> for GeometryCollectionArray<O>
§type RTreeObject = CachedEnvelope<GeometryCollection<'a, O>>
type RTreeObject = CachedEnvelope<GeometryCollection<'a, O>>
The object type to store in the RTree.
source§fn rstar_tree(&'a self) -> RTree<Self::RTreeObject>
fn rstar_tree(&'a self) -> RTree<Self::RTreeObject>
Build an
RTree
spatial index containing this array’s geometries.Auto Trait Implementations§
impl<O> RefUnwindSafe for GeometryCollectionArray<O>where
O: RefUnwindSafe,
impl<O> Send for GeometryCollectionArray<O>
impl<O> Sync for GeometryCollectionArray<O>
impl<O> Unpin for GeometryCollectionArray<O>where
O: Unpin,
impl<O> UnwindSafe for GeometryCollectionArray<O>where
O: UnwindSafe,
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