GeometryArray

Struct GeometryArray 

Source
pub struct GeometryArray { /* private fields */ }
Expand description

An immutable array of geometries of unknown geometry type and dimension.

Implementations§

Source§

impl GeometryArray

Source

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

Create a new GeometryArray from parts

§Implementation

This function is O(1).

§Panics
  • if the validity is not None and its length is different from the number of geometries
  • if the largest geometry offset does not match the number of coordinates
Source

pub fn buffer_lengths(&self) -> GeometryCapacity

The lengths of each buffer contained in this array.

Source

pub fn type_ids(&self) -> &ScalarBuffer<i8>

Returns the type_ids buffer for this array

Source

pub fn offsets(&self) -> &ScalarBuffer<i32>

Returns the offsets buffer for this array

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn has_dimension(&self, dim: Dimension) -> bool

Return true if this array holds at least one non-empty array of the given dimension

Source

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.

Source

pub fn num_bytes(&self) -> usize

The number of bytes occupied by this array.

Source

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().

Source

pub fn into_coord_type(self, coord_type: CoordType) -> Self

Change the CoordType of this array.

Source

pub fn with_metadata(self, metadata: Arc<Metadata>) -> Self

Change the Metadata of this array.

Trait Implementations§

Source§

impl Clone for GeometryArray

Source§

fn clone(&self) -> GeometryArray

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 Debug for GeometryArray

Source§

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

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

impl From<GeometryCollectionArray> for GeometryArray

Source§

fn from(value: GeometryCollectionArray) -> Self

Converts to this type from the input type.
Source§

impl From<LineStringArray> for GeometryArray

Source§

fn from(value: LineStringArray) -> Self

Converts to this type from the input type.
Source§

impl From<MultiLineStringArray> for GeometryArray

Source§

fn from(value: MultiLineStringArray) -> Self

Converts to this type from the input type.
Source§

impl From<MultiPointArray> for GeometryArray

Source§

fn from(value: MultiPointArray) -> Self

Converts to this type from the input type.
Source§

impl From<MultiPolygonArray> for GeometryArray

Source§

fn from(value: MultiPolygonArray) -> Self

Converts to this type from the input type.
Source§

impl From<PointArray> for GeometryArray

Source§

fn from(value: PointArray) -> Self

Converts to this type from the input type.
Source§

impl From<PolygonArray> for GeometryArray

Source§

fn from(value: PolygonArray) -> Self

Converts to this type from the input type.
Source§

impl GeoArrowArray for GeometryArray

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 into_array_ref(self) -> ArrayRef

Converts this array into an Arced arrow array, consuming the original array. Read more
Source§

fn to_array_ref(&self) -> ArrayRef

Converts this array into an Arced arrow array. Read more
Source§

fn len(&self) -> usize

The number of geometries contained in this array. Read more
Source§

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

Returns 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 data_type(&self) -> GeoArrowType

Returns the GeoArrowType of this array. Read more
Source§

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>

Change the Metadata of this array.
Source§

fn is_empty(&self) -> bool

Returns true if the array is empty. Read more
Source§

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

Returns whether slot i is valid. Read more
Source§

impl<'a> GeoArrowArrayAccessor<'a> for GeometryArray

Source§

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>

Returns the element at index i, not considering validity. Read more
Source§

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

Returns the element at index i, not considering validity. Read more
Source§

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

Returns the value at slot i as an Arrow scalar, considering validity. Read more
Source§

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

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

Iterator over geoarrow scalar values, not considering validity. Read more
Source§

impl GeozeroGeometry for GeometryArray

Available on crate feature geozero only.
Source§

fn process_geom<P: GeomProcessor>(&self, processor: &mut P) -> Result<()>
where Self: Sized,

Process geometry.
Source§

fn dims(&self) -> CoordDimensions

Dimensions of geometry
Source§

fn srid(&self) -> Option<i32>

SRID of geometry
Source§

impl IntoArrow for GeometryArray

Source§

type ArrowArray = UnionArray

The type of arrow array that this geoarrow array can be converted into.
Source§

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

Converts this geoarrow array into an arrow array. Read more
Source§

fn extension_type(&self) -> &Self::ExtensionType

Return the Arrow extension type representing this array.
Source§

impl PartialEq for GeometryArray

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<(&UnionArray, GeometryType)> for GeometryArray

Source§

type Error = GeoArrowError

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

fn try_from((value, typ): (&UnionArray, GeometryType)) -> GeoArrowResult<Self>

Performs the conversion.
Source§

impl TryFrom<(&dyn Array, &Field)> for GeometryArray

Source§

type Error = GeoArrowError

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

fn try_from((arr, field): (&dyn Array, &Field)) -> GeoArrowResult<Self>

Performs the conversion.
Source§

impl TryFrom<(&dyn Array, GeometryType)> for GeometryArray

Source§

type Error = GeoArrowError

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

fn try_from((value, typ): (&dyn Array, GeometryType)) -> GeoArrowResult<Self>

Performs the conversion.
Source§

impl<O: OffsetSizeTrait> TryFrom<(GenericWkbArray<O>, GeometryType)> for GeometryArray

Source§

type Error = GeoArrowError

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

fn try_from(value: (GenericWkbArray<O>, GeometryType)) -> GeoArrowResult<Self>

Performs the conversion.

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> 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> 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> ToGeo for T
where T: GeozeroGeometry,

Source§

fn to_geo(&self) -> Result<Geometry, GeozeroError>

Convert to geo-types Geometry.
Source§

impl<T> ToGeometryArray for T
where T: GeozeroGeometry,

Source§

fn to_geometry_builder( &self, typ: GeometryType, ) -> Result<GeometryBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow GeometryBuilder
Source§

fn to_geometry_array(&self, typ: GeometryType) -> Result<GeometryArray>

Available on crate feature geozero only.
Convert to GeoArrow GeometryArray
Source§

impl<T> ToJson for T
where T: GeozeroGeometry,

Source§

fn to_json(&self) -> Result<String, GeozeroError>

Convert to GeoJSON String.
Source§

impl<T> ToLineStringArray for T
where T: GeozeroGeometry,

Source§

fn to_line_string_builder( &self, typ: LineStringType, ) -> Result<LineStringBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow LineStringBuilder
Source§

fn to_line_string_array(&self, typ: LineStringType) -> Result<LineStringArray>

Available on crate feature geozero only.
Convert to GeoArrow LineStringArray
Source§

impl<T> ToMultiLineStringArray for T
where T: GeozeroGeometry,

Source§

fn to_multi_line_string_builder( &self, typ: MultiLineStringType, ) -> Result<MultiLineStringBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow MultiLineStringBuilder
Source§

fn to_multi_line_string_array( &self, typ: MultiLineStringType, ) -> Result<MultiLineStringArray>

Available on crate feature geozero only.
Convert to GeoArrow MultiLineStringArray
Source§

impl<T> ToMultiPointArray for T
where T: GeozeroGeometry,

Source§

fn to_multi_point_builder( &self, typ: MultiPointType, ) -> Result<MultiPointBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow MultiPointBuilder
Source§

fn to_multi_point_array(&self, typ: MultiPointType) -> Result<MultiPointArray>

Available on crate feature geozero only.
Convert to GeoArrow MultiPointArray
Source§

impl<T> ToMultiPolygonArray for T
where T: GeozeroGeometry,

Source§

fn to_multi_polygon_array( &self, typ: MultiPolygonType, ) -> Result<MultiPolygonArray, GeozeroError>

Available on crate feature geozero only.
Convert to GeoArrow MultiPolygonArray
Source§

fn to_multi_polygon_builder( &self, typ: MultiPolygonType, ) -> Result<MultiPolygonBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow MultiPolygonBuilder
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> ToPointArray for T
where T: GeozeroGeometry,

Source§

fn to_point_builder(&self, typ: PointType) -> Result<PointBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow PointBuilder
Source§

fn to_point_array(&self, typ: PointType) -> Result<PointArray>

Available on crate feature geozero only.
Convert to GeoArrow PointArray
Source§

impl<T> ToPolygonArray for T
where T: GeozeroGeometry,

Source§

fn to_polygon_builder( &self, typ: PolygonType, ) -> Result<PolygonBuilder, GeozeroError>

Available on crate feature geozero only.
Convert to a GeoArrow PolygonBuilder
Source§

fn to_polygon_array(&self, typ: PolygonType) -> Result<PolygonArray>

Available on crate feature geozero only.
Convert to GeoArrow PolygonArray
Source§

impl<T> ToSvg for T
where T: GeozeroGeometry,

Source§

fn to_svg(&self) -> Result<String, GeozeroError>

Convert to SVG geometry.
Source§

fn to_svg_document(&self) -> Result<String, GeozeroError>

Convert to SVG document.
Source§

impl<T> ToWkt for T
where T: GeozeroGeometry,

Source§

fn to_wkt(&self) -> Result<String, GeozeroError>

Convert to 2D WKT String.
Source§

fn to_ewkt(&self, srid: Option<i32>) -> Result<String, GeozeroError>

Convert to EWKT String.
Source§

fn to_wkt_ndim(&self, dims: CoordDimensions) -> Result<String, GeozeroError>

Convert to WKT String with dimensions.
Source§

fn to_wkt_with_opts( &self, dialect: WktDialect, dims: CoordDimensions, srid: Option<i32>, ) -> Result<String, GeozeroError>

Convert to WKT String with srid, dimensions and dialect.
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<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,