pub struct GeometryCapacity { /* private fields */ }
Expand description
A counter for the buffer sizes of a GeometryArray
.
This can be used to reduce allocations by allocating once for exactly the array size you need.
Implementations§
Source§impl GeometryCapacity
impl GeometryCapacity
Sourcepub fn new(
nulls: usize,
points: [usize; 4],
line_strings: [LineStringCapacity; 4],
polygons: [PolygonCapacity; 4],
mpoints: [MultiPointCapacity; 4],
mline_strings: [MultiLineStringCapacity; 4],
mpolygons: [MultiPolygonCapacity; 4],
gcs: [GeometryCollectionCapacity; 4],
) -> Self
pub fn new( nulls: usize, points: [usize; 4], line_strings: [LineStringCapacity; 4], polygons: [PolygonCapacity; 4], mpoints: [MultiPointCapacity; 4], mline_strings: [MultiLineStringCapacity; 4], mpolygons: [MultiPolygonCapacity; 4], gcs: [GeometryCollectionCapacity; 4], ) -> Self
Create a new capacity with known sizes.
Note that the ordering within each array must be XY, XYZ, XYM, XYZM.
Sourcepub fn with_prefer_multi(self, prefer_multi: bool) -> Self
pub fn with_prefer_multi(self, prefer_multi: bool) -> Self
Set whether this capacity counter should prefer allocating “single-type” geometries like Point/LineString/Polygon in the arrays of their “Multi” counterparts.
Sourcepub fn total_num_geoms(&self) -> usize
pub fn total_num_geoms(&self) -> usize
The total number of geometries across all geometry types.
Sourcepub fn line_string(&self, dim: Dimension) -> LineStringCapacity
pub fn line_string(&self, dim: Dimension) -> LineStringCapacity
Access LineString capacity
Sourcepub fn polygon(&self, dim: Dimension) -> PolygonCapacity
pub fn polygon(&self, dim: Dimension) -> PolygonCapacity
Access Polygon capacity
Sourcepub fn multi_point(&self, dim: Dimension) -> MultiPointCapacity
pub fn multi_point(&self, dim: Dimension) -> MultiPointCapacity
Access MultiPoint capacity
Sourcepub fn multi_line_string(&self, dim: Dimension) -> MultiLineStringCapacity
pub fn multi_line_string(&self, dim: Dimension) -> MultiLineStringCapacity
Access point capacity
Sourcepub fn multi_polygon(&self, dim: Dimension) -> MultiPolygonCapacity
pub fn multi_polygon(&self, dim: Dimension) -> MultiPolygonCapacity
Access point capacity
Sourcepub fn geometry_collection(&self, dim: Dimension) -> GeometryCollectionCapacity
pub fn geometry_collection(&self, dim: Dimension) -> GeometryCollectionCapacity
Access GeometryCollection capacity
Sourcepub fn add_geometry<T: WktNum>(
&mut self,
geom: Option<&impl GeometryTrait<T = T>>,
) -> GeoArrowResult<()>
pub fn add_geometry<T: WktNum>( &mut self, geom: Option<&impl GeometryTrait<T = T>>, ) -> GeoArrowResult<()>
Add the capacity of the given Geometry
Sourcepub fn from_geometries<'a, T: WktNum>(
geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait<T = T> + 'a)>>,
) -> GeoArrowResult<Self>
pub fn from_geometries<'a, T: WktNum>( geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait<T = T> + 'a)>>, ) -> GeoArrowResult<Self>
Construct a new counter pre-filled with the given geometries
Trait Implementations§
Source§impl AddAssign for GeometryCapacity
impl AddAssign for GeometryCapacity
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moreSource§impl Clone for GeometryCapacity
impl Clone for GeometryCapacity
Source§fn clone(&self) -> GeometryCapacity
fn clone(&self) -> GeometryCapacity
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 GeometryCapacity
impl Debug for GeometryCapacity
Source§impl Default for GeometryCapacity
impl Default for GeometryCapacity
Source§fn default() -> GeometryCapacity
fn default() -> GeometryCapacity
Returns the “default value” for a type. Read more
impl Copy for GeometryCapacity
Auto Trait Implementations§
impl Freeze for GeometryCapacity
impl RefUnwindSafe for GeometryCapacity
impl Send for GeometryCapacity
impl Sync for GeometryCapacity
impl Unpin for GeometryCapacity
impl UnwindSafe for GeometryCapacity
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