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 point_child(&self, dim: Dimension) -> PointArray
pub fn point_child(&self, dim: Dimension) -> PointArray
Access the PointArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent array.
Sourcepub fn line_string_child(&self, dim: Dimension) -> LineStringArray
pub fn line_string_child(&self, dim: Dimension) -> LineStringArray
Access the LineStringArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent array.
Sourcepub fn polygon_child(&self, dim: Dimension) -> PolygonArray
pub fn polygon_child(&self, dim: Dimension) -> PolygonArray
Access the PolygonArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent array.
Sourcepub fn multi_point_child(&self, dim: Dimension) -> MultiPointArray
pub fn multi_point_child(&self, dim: Dimension) -> MultiPointArray
Access the MultiPointArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent array.
Sourcepub fn multi_line_string_child(&self, dim: Dimension) -> MultiLineStringArray
pub fn multi_line_string_child(&self, dim: Dimension) -> MultiLineStringArray
Access the MultiLineStringArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent array.
Sourcepub fn multi_polygon_child(&self, dim: Dimension) -> MultiPolygonArray
pub fn multi_polygon_child(&self, dim: Dimension) -> MultiPolygonArray
Access the MultiPolygonArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent array.
Sourcepub fn geometry_collection_child(
&self,
dim: Dimension,
) -> GeometryCollectionArray
pub fn geometry_collection_child( &self, dim: Dimension, ) -> GeometryCollectionArray
Access the GeometryCollectionArray child for the given dimension.
Note that ordering will be maintained within the child array, but there may have been other geometries in between in the parent 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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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
Source§impl From<LineStringArray> for GeometryArray
impl From<LineStringArray> for GeometryArray
Source§fn from(value: LineStringArray) -> Self
fn from(value: LineStringArray) -> Self
Source§impl From<MultiLineStringArray> for GeometryArray
impl From<MultiLineStringArray> for GeometryArray
Source§fn from(value: MultiLineStringArray) -> Self
fn from(value: MultiLineStringArray) -> Self
Source§impl From<MultiPointArray> for GeometryArray
impl From<MultiPointArray> for GeometryArray
Source§fn from(value: MultiPointArray) -> Self
fn from(value: MultiPointArray) -> Self
Source§impl From<MultiPolygonArray> for GeometryArray
impl From<MultiPolygonArray> for GeometryArray
Source§fn from(value: MultiPolygonArray) -> Self
fn from(value: MultiPolygonArray) -> Self
Source§impl From<PointArray> for GeometryArray
impl From<PointArray> for GeometryArray
Source§fn from(value: PointArray) -> Self
fn from(value: PointArray) -> Self
Source§impl From<PolygonArray> for GeometryArray
impl From<PolygonArray> for GeometryArray
Source§fn from(value: PolygonArray) -> Self
fn from(value: PolygonArray) -> Self
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>
Source§fn logical_null_count(&self) -> usize
fn logical_null_count(&self) -> usize
Source§fn data_type(&self) -> GeoArrowType
fn data_type(&self) -> GeoArrowType
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>
Source§fn with_metadata(self, metadata: Arc<Metadata>) -> Arc<dyn GeoArrowArray>
fn with_metadata(self, metadata: Arc<Metadata>) -> Arc<dyn GeoArrowArray>
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>
Source§unsafe fn value_unchecked(&'a self, index: usize) -> GeoArrowResult<Self::Item>
unsafe fn value_unchecked(&'a self, index: usize) -> GeoArrowResult<Self::Item>
i
, not considering validity. Read moreSource§fn value(&'a self, index: usize) -> GeoArrowResult<Self::Item>
fn value(&'a self, index: usize) -> GeoArrowResult<Self::Item>
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>>
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>>
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
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
Source§impl GeozeroGeometry for GeometryArray
Available on crate feature geozero
only.
impl GeozeroGeometry for GeometryArray
geozero
only.Source§impl IntoArrow for GeometryArray
impl IntoArrow for GeometryArray
Source§type ArrowArray = UnionArray
type ArrowArray = UnionArray
Source§type ExtensionType = GeometryType
type ExtensionType = GeometryType
Source§fn into_arrow(self) -> Self::ArrowArray
fn into_arrow(self) -> Self::ArrowArray
Source§fn extension_type(&self) -> &Self::ExtensionType
fn extension_type(&self) -> &Self::ExtensionType
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
Source§fn try_from((value, typ): (&UnionArray, GeometryType)) -> GeoArrowResult<Self>
fn try_from((value, typ): (&UnionArray, GeometryType)) -> GeoArrowResult<Self>
Source§impl TryFrom<(&dyn Array, &Field)> for GeometryArray
impl TryFrom<(&dyn Array, &Field)> for GeometryArray
Source§type Error = GeoArrowError
type Error = GeoArrowError
Source§impl TryFrom<(&dyn Array, GeometryType)> for GeometryArray
impl TryFrom<(&dyn Array, GeometryType)> for GeometryArray
Source§type Error = GeoArrowError
type Error = GeoArrowError
Source§fn try_from((value, typ): (&dyn Array, GeometryType)) -> GeoArrowResult<Self>
fn try_from((value, typ): (&dyn Array, GeometryType)) -> GeoArrowResult<Self>
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
Source§fn try_from(value: (GenericWkbArray<O>, GeometryType)) -> GeoArrowResult<Self>
fn try_from(value: (GenericWkbArray<O>, GeometryType)) -> GeoArrowResult<Self>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> ToGeo for Twhere
T: GeozeroGeometry,
impl<T> ToGeo for Twhere
T: GeozeroGeometry,
Source§impl<T> ToGeometryArray for Twhere
T: GeozeroGeometry,
impl<T> ToGeometryArray for Twhere
T: GeozeroGeometry,
Source§fn to_geometry_builder(
&self,
typ: GeometryType,
) -> Result<GeometryBuilder, GeozeroError>
fn to_geometry_builder( &self, typ: GeometryType, ) -> Result<GeometryBuilder, GeozeroError>
geozero
only.GeometryBuilder
Source§fn to_geometry_array(&self, typ: GeometryType) -> Result<GeometryArray>
fn to_geometry_array(&self, typ: GeometryType) -> Result<GeometryArray>
geozero
only.GeometryArray
Source§impl<T> ToJson for Twhere
T: GeozeroGeometry,
impl<T> ToJson for Twhere
T: GeozeroGeometry,
Source§impl<T> ToLineStringArray for Twhere
T: GeozeroGeometry,
impl<T> ToLineStringArray for Twhere
T: GeozeroGeometry,
Source§fn to_line_string_builder(
&self,
typ: LineStringType,
) -> Result<LineStringBuilder, GeozeroError>
fn to_line_string_builder( &self, typ: LineStringType, ) -> Result<LineStringBuilder, GeozeroError>
geozero
only.Source§fn to_line_string_array(&self, typ: LineStringType) -> Result<LineStringArray>
fn to_line_string_array(&self, typ: LineStringType) -> Result<LineStringArray>
geozero
only.Source§impl<T> ToMultiLineStringArray for Twhere
T: GeozeroGeometry,
impl<T> ToMultiLineStringArray for Twhere
T: GeozeroGeometry,
Source§fn to_multi_line_string_builder(
&self,
typ: MultiLineStringType,
) -> Result<MultiLineStringBuilder, GeozeroError>
fn to_multi_line_string_builder( &self, typ: MultiLineStringType, ) -> Result<MultiLineStringBuilder, GeozeroError>
geozero
only.Source§fn to_multi_line_string_array(
&self,
typ: MultiLineStringType,
) -> Result<MultiLineStringArray>
fn to_multi_line_string_array( &self, typ: MultiLineStringType, ) -> Result<MultiLineStringArray>
geozero
only.Source§impl<T> ToMultiPointArray for Twhere
T: GeozeroGeometry,
impl<T> ToMultiPointArray for Twhere
T: GeozeroGeometry,
Source§fn to_multi_point_builder(
&self,
typ: MultiPointType,
) -> Result<MultiPointBuilder, GeozeroError>
fn to_multi_point_builder( &self, typ: MultiPointType, ) -> Result<MultiPointBuilder, GeozeroError>
geozero
only.Source§fn to_multi_point_array(&self, typ: MultiPointType) -> Result<MultiPointArray>
fn to_multi_point_array(&self, typ: MultiPointType) -> Result<MultiPointArray>
geozero
only.Source§impl<T> ToMultiPolygonArray for Twhere
T: GeozeroGeometry,
impl<T> ToMultiPolygonArray for Twhere
T: GeozeroGeometry,
Source§fn to_multi_polygon_array(
&self,
typ: MultiPolygonType,
) -> Result<MultiPolygonArray, GeozeroError>
fn to_multi_polygon_array( &self, typ: MultiPolygonType, ) -> Result<MultiPolygonArray, GeozeroError>
geozero
only.Source§fn to_multi_polygon_builder(
&self,
typ: MultiPolygonType,
) -> Result<MultiPolygonBuilder, GeozeroError>
fn to_multi_polygon_builder( &self, typ: MultiPolygonType, ) -> Result<MultiPolygonBuilder, GeozeroError>
geozero
only.Source§impl<T> ToPointArray for Twhere
T: GeozeroGeometry,
impl<T> ToPointArray for Twhere
T: GeozeroGeometry,
Source§fn to_point_builder(&self, typ: PointType) -> Result<PointBuilder, GeozeroError>
fn to_point_builder(&self, typ: PointType) -> Result<PointBuilder, GeozeroError>
geozero
only.Source§fn to_point_array(&self, typ: PointType) -> Result<PointArray>
fn to_point_array(&self, typ: PointType) -> Result<PointArray>
geozero
only.Source§impl<T> ToPolygonArray for Twhere
T: GeozeroGeometry,
impl<T> ToPolygonArray for Twhere
T: GeozeroGeometry,
Source§fn to_polygon_builder(
&self,
typ: PolygonType,
) -> Result<PolygonBuilder, GeozeroError>
fn to_polygon_builder( &self, typ: PolygonType, ) -> Result<PolygonBuilder, GeozeroError>
geozero
only.Source§fn to_polygon_array(&self, typ: PolygonType) -> Result<PolygonArray>
fn to_polygon_array(&self, typ: PolygonType) -> Result<PolygonArray>
geozero
only.