pub struct MultiLineStringBuilder { /* private fields */ }
Expand description
The GeoArrow equivalent to Vec<Option<MultiLineString>>
: a mutable collection of
MultiLineStrings.
Converting an MultiLineStringBuilder
into a MultiLineStringArray
is O(1)
.
Implementations§
Source§impl MultiLineStringBuilder
impl MultiLineStringBuilder
Sourcepub fn new(typ: MultiLineStringType) -> Self
pub fn new(typ: MultiLineStringType) -> Self
Creates a new empty MultiLineStringBuilder
.
Sourcepub fn with_capacity(
typ: MultiLineStringType,
capacity: MultiLineStringCapacity,
) -> Self
pub fn with_capacity( typ: MultiLineStringType, capacity: MultiLineStringCapacity, ) -> Self
Creates a new MultiLineStringBuilder
with a capacity.
Sourcepub fn reserve(&mut self, additional: MultiLineStringCapacity)
pub fn reserve(&mut self, additional: MultiLineStringCapacity)
Reserves capacity for at least additional
more MultiLineStrings.
The collection may reserve more space to speculatively avoid frequent reallocations. After
calling reserve
, capacity will be greater than or equal to self.len() + additional
.
Does nothing if capacity is already sufficient.
Sourcepub fn reserve_exact(&mut self, additional: MultiLineStringCapacity)
pub fn reserve_exact(&mut self, additional: MultiLineStringCapacity)
Reserves the minimum capacity for at least additional
more MultiLineStrings.
Unlike reserve
, this will not deliberately over-allocate to speculatively avoid
frequent allocations. After calling reserve_exact
, capacity will be greater than or equal
to self.len() + additional
. Does nothing if the capacity is already sufficient.
Note that the allocator may give the collection more space than it
requests. Therefore, capacity can not be relied upon to be precisely
minimal. Prefer reserve
if future insertions are expected.
Sourcepub fn try_new(
coords: CoordBufferBuilder,
geom_offsets: OffsetsBuilder<i32>,
ring_offsets: OffsetsBuilder<i32>,
validity: NullBufferBuilder,
data_type: MultiLineStringType,
) -> GeoArrowResult<Self>
pub fn try_new( coords: CoordBufferBuilder, geom_offsets: OffsetsBuilder<i32>, ring_offsets: OffsetsBuilder<i32>, validity: NullBufferBuilder, data_type: MultiLineStringType, ) -> GeoArrowResult<Self>
The canonical method to create a MultiLineStringBuilder
out of its internal
components.
§Implementation
This function is O(1)
.
§Errors
- if the validity is not
None
and its length is different from the number of geometries - if the largest ring offset does not match the number of coordinates
- if the largest geometry offset does not match the size of ring offsets
Sourcepub fn finish(self) -> MultiLineStringArray
pub fn finish(self) -> MultiLineStringArray
Consume the builder and convert to an immutable MultiLineStringArray
Sourcepub fn push_line_string(
&mut self,
value: Option<&impl LineStringTrait<T = f64>>,
) -> GeoArrowResult<()>
pub fn push_line_string( &mut self, value: Option<&impl LineStringTrait<T = f64>>, ) -> GeoArrowResult<()>
Add a new LineString to the end of this array.
§Errors
This function errors iff the new last item is larger than what O supports.
Sourcepub fn push_multi_line_string(
&mut self,
value: Option<&impl MultiLineStringTrait<T = f64>>,
) -> GeoArrowResult<()>
pub fn push_multi_line_string( &mut self, value: Option<&impl MultiLineStringTrait<T = f64>>, ) -> GeoArrowResult<()>
Add a new MultiLineString to the end of this array.
§Errors
This function errors iff the new last item is larger than what O supports.
Sourcepub fn push_geometry(
&mut self,
value: Option<&impl GeometryTrait<T = f64>>,
) -> GeoArrowResult<()>
pub fn push_geometry( &mut self, value: Option<&impl GeometryTrait<T = f64>>, ) -> GeoArrowResult<()>
Add a new geometry to this builder
This will error if the geometry type is not LineString or MultiLineString.
Sourcepub fn extend_from_iter<'a>(
&mut self,
geoms: impl Iterator<Item = Option<&'a (impl MultiLineStringTrait<T = f64> + 'a)>>,
)
pub fn extend_from_iter<'a>( &mut self, geoms: impl Iterator<Item = Option<&'a (impl MultiLineStringTrait<T = f64> + 'a)>>, )
Extend this builder with the given geometries
Sourcepub fn extend_from_geometry_iter<'a>(
&mut self,
geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait<T = f64> + 'a)>>,
) -> GeoArrowResult<()>
pub fn extend_from_geometry_iter<'a>( &mut self, geoms: impl Iterator<Item = Option<&'a (impl GeometryTrait<T = f64> + 'a)>>, ) -> GeoArrowResult<()>
Extend this builder with the given geometries
Sourcepub fn from_multi_line_strings(
geoms: &[impl MultiLineStringTrait<T = f64>],
typ: MultiLineStringType,
) -> Self
pub fn from_multi_line_strings( geoms: &[impl MultiLineStringTrait<T = f64>], typ: MultiLineStringType, ) -> Self
Construct a new builder, pre-filling it with the provided geometries
Sourcepub fn from_nullable_multi_line_strings(
geoms: &[Option<impl MultiLineStringTrait<T = f64>>],
typ: MultiLineStringType,
) -> Self
pub fn from_nullable_multi_line_strings( geoms: &[Option<impl MultiLineStringTrait<T = f64>>], typ: MultiLineStringType, ) -> Self
Construct a new builder, pre-filling it with the provided geometries
Sourcepub fn from_nullable_geometries(
geoms: &[Option<impl GeometryTrait<T = f64>>],
typ: MultiLineStringType,
) -> GeoArrowResult<Self>
pub fn from_nullable_geometries( geoms: &[Option<impl GeometryTrait<T = f64>>], typ: MultiLineStringType, ) -> GeoArrowResult<Self>
Construct a new builder, pre-filling it with the provided geometries