Struct RectArray

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

An immutable array of Rect or Box geometries.

A rect is an axis-aligned bounded rectangle whose area is defined by minimum and maximum coordinates.

All rects must have the same dimension.

This is not an array type defined by the GeoArrow specification (as of spec version 0.1) but is included here for parity with georust/geo, and to save memory for the output of bounds().

Internally this is implemented as a FixedSizeList, laid out as minx, miny, maxx, maxy.

Implementations§

Source§

impl RectArray

Source

pub fn new( lower: SeparatedCoordBuffer, upper: SeparatedCoordBuffer, nulls: Option<NullBuffer>, metadata: Arc<Metadata>, ) -> Self

Construct a new RectArray from parts

Source

pub fn lower(&self) -> &SeparatedCoordBuffer

Access the coordinate buffer of the “lower” corner of the RectArray

Note that this needs to be interpreted in conjunction with the null buffer.

Source

pub fn upper(&self) -> &SeparatedCoordBuffer

Access the coordinate buffer of the “upper” corner of the RectArray

Note that this needs to be interpreted in conjunction with the null buffer.

Source

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

Slice this RectArray.

§Panic

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

Source

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

Change the Metadata of this array.

Trait Implementations§

Source§

impl Clone for RectArray

Source§

fn clone(&self) -> RectArray

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

Source§

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

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

impl From<RectArray> for PolygonArray

Source§

fn from(value: RectArray) -> Self

Converts to this type from the input type.
Source§

impl GeoArrowArray for RectArray

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 RectArray

Source§

type Item = Rect<'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 IntoArrow for RectArray

Source§

type ArrowArray = StructArray

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

type ExtensionType = BoxType

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 RectArray

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<(&StructArray, BoxType)> for RectArray

Source§

type Error = GeoArrowError

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

fn try_from((value, typ): (&StructArray, BoxType)) -> GeoArrowResult<Self>

Performs the conversion.
Source§

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

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, BoxType)> for RectArray

Source§

type Error = GeoArrowError

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

fn try_from((value, dim): (&dyn Array, BoxType)) -> 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> 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, 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,