pub struct SeparatedCoordBuffer { /* private fields */ }
Expand description
An array of coordinates stored in separate buffers of the same length.
This stores all coordinates in separated fashion as multiple underlying buffers: e.g. xxx
and
yyy
for 2D coordinates.
Implementations§
Source§impl SeparatedCoordBuffer
impl SeparatedCoordBuffer
Sourcepub const COORD_TYPE: CoordType = CoordType::Separated
pub const COORD_TYPE: CoordType = CoordType::Separated
The underlying coordinate type
Sourcepub fn from_array(
buffers: [ScalarBuffer<f64>; 4],
dim: Dimension,
) -> GeoArrowResult<Self>
pub fn from_array( buffers: [ScalarBuffer<f64>; 4], dim: Dimension, ) -> GeoArrowResult<Self>
Construct a new SeparatedCoordBuffer from an array of existing buffers.
The number of valid buffers in the array must match the dimension size. E.g. if the dim
is Dimension::XY
, then only the first two buffers must have non-zero length, and the last
two buffers in the array can have length zero.
Sourcepub fn from_vec(
buffers: Vec<ScalarBuffer<f64>>,
dim: Dimension,
) -> GeoArrowResult<Self>
pub fn from_vec( buffers: Vec<ScalarBuffer<f64>>, dim: Dimension, ) -> GeoArrowResult<Self>
Construct a new SeparatedCoordBuffer from a Vec
of existing buffers.
All buffers within buffers
must have the same length, and the length of buffers
must
equal the dimension size.
Sourcepub fn raw_buffers(&self) -> &[ScalarBuffer<f64>; 4]
pub fn raw_buffers(&self) -> &[ScalarBuffer<f64>; 4]
Access the underlying coordinate buffers.
Note that not all four buffers may be valid. Only so many buffers have defined meaning as there are dimensions, so for an XY buffer, only the first two buffers have defined meaning, and the last two may be any buffer, or empty.
Sourcepub fn buffers(&self) -> Vec<ScalarBuffer<f64>>
pub fn buffers(&self) -> Vec<ScalarBuffer<f64>>
Access the underlying coordinate buffers.
In comparison to raw_buffers, all of the returned buffers are valid.
Sourcepub fn from_coords<'a>(
coords: impl ExactSizeIterator<Item = &'a (impl CoordTrait<T = f64> + 'a)>,
dim: Dimension,
) -> GeoArrowResult<Self>
pub fn from_coords<'a>( coords: impl ExactSizeIterator<Item = &'a (impl CoordTrait<T = f64> + 'a)>, dim: Dimension, ) -> GeoArrowResult<Self>
Construct from an iterator of coordinates
Trait Implementations§
Source§impl Clone for SeparatedCoordBuffer
impl Clone for SeparatedCoordBuffer
Source§fn clone(&self) -> SeparatedCoordBuffer
fn clone(&self) -> SeparatedCoordBuffer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more