pub struct GeometryArray { /* private fields */ }
Expand description
An immutable array of geometries of unknown geometry type and dimension.
Implementations§
Source§impl GeometryArray
impl GeometryArray
Sourcepub fn new(
type_ids: ScalarBuffer<i8>,
offsets: ScalarBuffer<i32>,
points: [PointArray; 4],
line_strings: [LineStringArray; 4],
polygons: [PolygonArray; 4],
mpoints: [MultiPointArray; 4],
mline_strings: [MultiLineStringArray; 4],
mpolygons: [MultiPolygonArray; 4],
gcs: [GeometryCollectionArray; 4],
metadata: Arc<Metadata>,
) -> Self
pub fn new( type_ids: ScalarBuffer<i8>, offsets: ScalarBuffer<i32>, points: [PointArray; 4], line_strings: [LineStringArray; 4], polygons: [PolygonArray; 4], mpoints: [MultiPointArray; 4], mline_strings: [MultiLineStringArray; 4], mpolygons: [MultiPolygonArray; 4], gcs: [GeometryCollectionArray; 4], metadata: Arc<Metadata>, ) -> Self
Sourcepub fn buffer_lengths(&self) -> GeometryCapacity
pub fn buffer_lengths(&self) -> GeometryCapacity
The lengths of each buffer contained in this array.
Sourcepub fn type_ids(&self) -> &ScalarBuffer<i8>
pub fn type_ids(&self) -> &ScalarBuffer<i8>
Returns the type_ids
buffer for this array
Sourcepub fn offsets(&self) -> &ScalarBuffer<i32>
pub fn offsets(&self) -> &ScalarBuffer<i32>
Returns the offsets
buffer for this array
Sourcepub fn has_dimension(&self, dim: Dimension) -> bool
pub fn has_dimension(&self, dim: Dimension) -> bool
Return true
if this array holds at least one non-empty array of the given dimension
Sourcepub fn has_only_dimension(&self, dim: Dimension) -> bool
pub fn has_only_dimension(&self, dim: Dimension) -> bool
Return true
if this array holds at least one geometry array of the given dimension and no
arrays of any other dimension.
Sourcepub fn slice(&self, offset: usize, length: usize) -> Self
pub fn slice(&self, offset: usize, length: usize) -> Self
Slice this GeometryArray
.
§Implementation
This operation is O(F)
where F
is the number of fields.
§Panic
This function panics iff offset + length > self.len()
.
Sourcepub fn into_coord_type(self, coord_type: CoordType) -> Self
pub fn into_coord_type(self, coord_type: CoordType) -> Self
Change the CoordType
of this array.
Sourcepub fn with_metadata(self, metadata: Arc<Metadata>) -> Self
pub fn with_metadata(self, metadata: Arc<Metadata>) -> Self
Change the Metadata
of this array.
Trait Implementations§
Source§impl Clone for GeometryArray
impl Clone for GeometryArray
Source§fn clone(&self) -> GeometryArray
fn clone(&self) -> GeometryArray
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 Debug for GeometryArray
impl Debug for GeometryArray
Source§impl From<GeometryCollectionArray> for GeometryArray
impl From<GeometryCollectionArray> for GeometryArray
Source§fn from(value: GeometryCollectionArray) -> Self
fn from(value: GeometryCollectionArray) -> Self
Converts to this type from the input type.
Source§impl From<LineStringArray> for GeometryArray
impl From<LineStringArray> for GeometryArray
Source§fn from(value: LineStringArray) -> Self
fn from(value: LineStringArray) -> Self
Converts to this type from the input type.
Source§impl From<MultiLineStringArray> for GeometryArray
impl From<MultiLineStringArray> for GeometryArray
Source§fn from(value: MultiLineStringArray) -> Self
fn from(value: MultiLineStringArray) -> Self
Converts to this type from the input type.
Source§impl From<MultiPointArray> for GeometryArray
impl From<MultiPointArray> for GeometryArray
Source§fn from(value: MultiPointArray) -> Self
fn from(value: MultiPointArray) -> Self
Converts to this type from the input type.
Source§impl From<MultiPolygonArray> for GeometryArray
impl From<MultiPolygonArray> for GeometryArray
Source§fn from(value: MultiPolygonArray) -> Self
fn from(value: MultiPolygonArray) -> Self
Converts to this type from the input type.
Source§impl From<PointArray> for GeometryArray
impl From<PointArray> for GeometryArray
Source§fn from(value: PointArray) -> Self
fn from(value: PointArray) -> Self
Converts to this type from the input type.
Source§impl From<PolygonArray> for GeometryArray
impl From<PolygonArray> for GeometryArray
Source§fn from(value: PolygonArray) -> Self
fn from(value: PolygonArray) -> Self
Converts to this type from the input type.
Source§impl GeoArrowArray for GeometryArray
impl GeoArrowArray for GeometryArray
Source§fn into_array_ref(self) -> ArrayRef
fn into_array_ref(self) -> ArrayRef
Source§fn logical_nulls(&self) -> Option<NullBuffer>
fn logical_nulls(&self) -> Option<NullBuffer>
Returns a potentially computed `NullBuffer`` that represents the logical null values of
this array, if any. Read more
Source§fn logical_null_count(&self) -> usize
fn logical_null_count(&self) -> usize
Returns the number of null slots in this array. Read more
Source§fn data_type(&self) -> GeoArrowType
fn data_type(&self) -> GeoArrowType
Returns the
GeoArrowType
of this array. Read moreSource§fn slice(&self, offset: usize, length: usize) -> Arc<dyn GeoArrowArray>
fn slice(&self, offset: usize, length: usize) -> Arc<dyn GeoArrowArray>
Returns a zero-copy slice of this array with the indicated offset and length. Read more
Source§fn with_metadata(self, metadata: Arc<Metadata>) -> Arc<dyn GeoArrowArray>
fn with_metadata(self, metadata: Arc<Metadata>) -> Arc<dyn GeoArrowArray>
Change the
Metadata
of this array.Source§impl<'a> GeoArrowArrayAccessor<'a> for GeometryArray
impl<'a> GeoArrowArrayAccessor<'a> for GeometryArray
Source§type Item = Geometry<'a>
type Item = Geometry<'a>
The geoarrow scalar object for this geometry array type.
Source§unsafe fn value_unchecked(&'a self, index: usize) -> GeoArrowResult<Self::Item>
unsafe fn value_unchecked(&'a self, index: usize) -> GeoArrowResult<Self::Item>
Returns the element at index
i
, not considering validity. Read moreSource§fn value(&'a self, index: usize) -> GeoArrowResult<Self::Item>
fn value(&'a self, index: usize) -> GeoArrowResult<Self::Item>
Returns the element at index
i
, not considering validity. Read moreSource§fn get(&'a self, index: usize) -> GeoArrowResult<Option<Self::Item>>
fn get(&'a self, index: usize) -> GeoArrowResult<Option<Self::Item>>
Returns the value at slot
i
as an Arrow scalar, considering validity. Read moreSource§unsafe fn get_unchecked(
&'a self,
index: usize,
) -> Option<GeoArrowResult<Self::Item>>
unsafe fn get_unchecked( &'a self, index: usize, ) -> Option<GeoArrowResult<Self::Item>>
Returns the value at slot
i
as an Arrow scalar, considering validity. Read moreSource§fn iter(
&'a self,
) -> impl ExactSizeIterator<Item = Option<GeoArrowResult<Self::Item>>> + 'a
fn iter( &'a self, ) -> impl ExactSizeIterator<Item = Option<GeoArrowResult<Self::Item>>> + 'a
Iterates over this array’s geoarrow scalar values, considering validity. Read more
Source§fn iter_values(
&'a self,
) -> impl ExactSizeIterator<Item = GeoArrowResult<Self::Item>> + 'a
fn iter_values( &'a self, ) -> impl ExactSizeIterator<Item = GeoArrowResult<Self::Item>> + 'a
Iterator over geoarrow scalar values, not considering validity. Read more
Source§impl IntoArrow for GeometryArray
impl IntoArrow for GeometryArray
Source§type ArrowArray = UnionArray
type ArrowArray = UnionArray
The type of arrow array that this geoarrow array can be converted into.
Source§type ExtensionType = GeometryType
type ExtensionType = GeometryType
The extension type representing this array. It will always be a type defined by
geoarrow_schema.
Source§fn into_arrow(self) -> Self::ArrowArray
fn into_arrow(self) -> Self::ArrowArray
Converts this geoarrow array into an arrow array. Read more
Source§fn extension_type(&self) -> &Self::ExtensionType
fn extension_type(&self) -> &Self::ExtensionType
Return the Arrow extension type representing this array.
Source§impl PartialEq for GeometryArray
impl PartialEq for GeometryArray
Source§impl TryFrom<(&UnionArray, GeometryType)> for GeometryArray
impl TryFrom<(&UnionArray, GeometryType)> for GeometryArray
Source§type Error = GeoArrowError
type Error = GeoArrowError
The type returned in the event of a conversion error.
Source§fn try_from((value, typ): (&UnionArray, GeometryType)) -> GeoArrowResult<Self>
fn try_from((value, typ): (&UnionArray, GeometryType)) -> GeoArrowResult<Self>
Performs the conversion.
Source§impl TryFrom<(&dyn Array, &Field)> for GeometryArray
impl TryFrom<(&dyn Array, &Field)> for GeometryArray
Source§type Error = GeoArrowError
type Error = GeoArrowError
The type returned in the event of a conversion error.
Source§impl TryFrom<(&dyn Array, GeometryType)> for GeometryArray
impl TryFrom<(&dyn Array, GeometryType)> for GeometryArray
Source§type Error = GeoArrowError
type Error = GeoArrowError
The type returned in the event of a conversion error.
Source§fn try_from((value, typ): (&dyn Array, GeometryType)) -> GeoArrowResult<Self>
fn try_from((value, typ): (&dyn Array, GeometryType)) -> GeoArrowResult<Self>
Performs the conversion.
Source§impl<O: OffsetSizeTrait> TryFrom<(GenericWkbArray<O>, GeometryType)> for GeometryArray
impl<O: OffsetSizeTrait> TryFrom<(GenericWkbArray<O>, GeometryType)> for GeometryArray
Source§type Error = GeoArrowError
type Error = GeoArrowError
The type returned in the event of a conversion error.
Source§fn try_from(value: (GenericWkbArray<O>, GeometryType)) -> GeoArrowResult<Self>
fn try_from(value: (GenericWkbArray<O>, GeometryType)) -> GeoArrowResult<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for GeometryArray
impl RefUnwindSafe for GeometryArray
impl Send for GeometryArray
impl Sync for GeometryArray
impl Unpin for GeometryArray
impl UnwindSafe for GeometryArray
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