pub struct PolygonBuilder { /* private fields */ }Expand description
The GeoArrow equivalent to Vec<Option<Polygon>>: a mutable collection of Polygons.
Converting an PolygonBuilder into a PolygonArray is O(1).
Implementations§
Source§impl PolygonBuilder
impl PolygonBuilder
Sourcepub fn new(typ: PolygonType) -> Self
pub fn new(typ: PolygonType) -> Self
Creates a new empty PolygonBuilder.
Sourcepub fn with_capacity(typ: PolygonType, capacity: PolygonCapacity) -> Self
pub fn with_capacity(typ: PolygonType, capacity: PolygonCapacity) -> Self
Creates a new PolygonBuilder with given capacity and no validity.
Sourcepub fn reserve(&mut self, capacity: PolygonCapacity)
pub fn reserve(&mut self, capacity: PolygonCapacity)
Reserves capacity for at least additional more Polygons.
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, capacity: PolygonCapacity)
pub fn reserve_exact(&mut self, capacity: PolygonCapacity)
Reserves the minimum capacity for at least additional more Polygons.
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 shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of self to fit.
Sourcepub fn finish(self) -> PolygonArray
pub fn finish(self) -> PolygonArray
Consume the builder and convert to an immutable PolygonArray
Sourcepub fn push_polygon(
&mut self,
value: Option<&impl PolygonTrait<T = f64>>,
) -> GeoArrowResult<()>
pub fn push_polygon( &mut self, value: Option<&impl PolygonTrait<T = f64>>, ) -> GeoArrowResult<()>
Add a new Polygon to the end of this array.
§Errors
This function errors iff the new last item is larger than what O supports.
Sourcepub fn push_rect(
&mut self,
value: Option<&impl RectTrait<T = f64>>,
) -> GeoArrowResult<()>
pub fn push_rect( &mut self, value: Option<&impl RectTrait<T = f64>>, ) -> GeoArrowResult<()>
Add a new Rect to this builder
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 Polygon, a MultiPolygon of length 1, or Rect.
Sourcepub fn extend_from_iter<'a>(
&mut self,
geoms: impl Iterator<Item = Option<&'a (impl PolygonTrait<T = f64> + 'a)>>,
)
pub fn extend_from_iter<'a>( &mut self, geoms: impl Iterator<Item = Option<&'a (impl PolygonTrait<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_polygons(
geoms: &[impl PolygonTrait<T = f64>],
typ: PolygonType,
) -> Self
pub fn from_polygons( geoms: &[impl PolygonTrait<T = f64>], typ: PolygonType, ) -> Self
Construct a new builder, pre-filling it with the provided geometries
Sourcepub fn from_nullable_polygons(
geoms: &[Option<impl PolygonTrait<T = f64>>],
typ: PolygonType,
) -> Self
pub fn from_nullable_polygons( geoms: &[Option<impl PolygonTrait<T = f64>>], typ: PolygonType, ) -> Self
Construct a new builder, pre-filling it with the provided geometries
Sourcepub fn from_nullable_geometries(
geoms: &[Option<impl GeometryTrait<T = f64>>],
typ: PolygonType,
) -> GeoArrowResult<Self>
pub fn from_nullable_geometries( geoms: &[Option<impl GeometryTrait<T = f64>>], typ: PolygonType, ) -> GeoArrowResult<Self>
Construct a new builder, pre-filling it with the provided geometries
Trait Implementations§
Source§impl Debug for PolygonBuilder
impl Debug for PolygonBuilder
Source§impl GeomProcessor for PolygonBuilder
Available on crate feature geozero only.
impl GeomProcessor for PolygonBuilder
geozero only.Source§fn geometrycollection_begin(&mut self, size: usize, idx: usize) -> Result<()>
fn geometrycollection_begin(&mut self, size: usize, idx: usize) -> Result<()>
GeometryCollection processing Read moreSource§fn geometrycollection_end(&mut self, idx: usize) -> Result<()>
fn geometrycollection_end(&mut self, idx: usize) -> Result<()>
GeometryCollection processingSource§fn xy(&mut self, x: f64, y: f64, idx: usize) -> Result<()>
fn xy(&mut self, x: f64, y: f64, idx: usize) -> Result<()>
Source§fn coordinate(
&mut self,
x: f64,
y: f64,
z: Option<f64>,
m: Option<f64>,
t: Option<f64>,
tm: Option<u64>,
idx: usize,
) -> Result<()>
fn coordinate( &mut self, x: f64, y: f64, z: Option<f64>, m: Option<f64>, t: Option<f64>, tm: Option<u64>, idx: usize, ) -> Result<()>
Source§fn polygon_begin(&mut self, tagged: bool, size: usize, idx: usize) -> Result<()>
fn polygon_begin(&mut self, tagged: bool, size: usize, idx: usize) -> Result<()>
Polygon processing Read moreSource§fn linestring_begin(
&mut self,
tagged: bool,
size: usize,
idx: usize,
) -> Result<()>
fn linestring_begin( &mut self, tagged: bool, size: usize, idx: usize, ) -> Result<()>
LineString processing Read moreSource§fn dimensions(&self) -> CoordDimensions
fn dimensions(&self) -> CoordDimensions
Source§fn srid(&mut self, srid: Option<i32>) -> Result<(), GeozeroError>
fn srid(&mut self, srid: Option<i32>) -> Result<(), GeozeroError>
Source§fn empty_point(&mut self, idx: usize) -> Result<(), GeozeroError>
fn empty_point(&mut self, idx: usize) -> Result<(), GeozeroError>
POINT EMPTY Read moreSource§fn point_begin(&mut self, idx: usize) -> Result<(), GeozeroError>
fn point_begin(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn multipoint_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn multipoint_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn multipoint_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn multipoint_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn linestring_end(
&mut self,
tagged: bool,
idx: usize,
) -> Result<(), GeozeroError>
fn linestring_end( &mut self, tagged: bool, idx: usize, ) -> Result<(), GeozeroError>
LineString processingSource§fn multilinestring_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn multilinestring_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
MultiLineString processing Read moreSource§fn multilinestring_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn multilinestring_end(&mut self, idx: usize) -> Result<(), GeozeroError>
MultiLineString processingSource§fn polygon_end(&mut self, tagged: bool, idx: usize) -> Result<(), GeozeroError>
fn polygon_end(&mut self, tagged: bool, idx: usize) -> Result<(), GeozeroError>
Source§fn multipolygon_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn multipolygon_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
MultiPolygon processing Read moreSource§fn multipolygon_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn multipolygon_end(&mut self, idx: usize) -> Result<(), GeozeroError>
MultiPolygon processingSource§fn circularstring_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn circularstring_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
CircularString processing Read moreSource§fn circularstring_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn circularstring_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn compoundcurve_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn compoundcurve_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn compoundcurve_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn compoundcurve_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn curvepolygon_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn curvepolygon_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn curvepolygon_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn curvepolygon_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn multicurve_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn multicurve_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn multicurve_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn multicurve_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn multisurface_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn multisurface_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn multisurface_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn multisurface_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn triangle_begin(
&mut self,
tagged: bool,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn triangle_begin( &mut self, tagged: bool, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn triangle_end(&mut self, tagged: bool, idx: usize) -> Result<(), GeozeroError>
fn triangle_end(&mut self, tagged: bool, idx: usize) -> Result<(), GeozeroError>
Source§fn polyhedralsurface_begin(
&mut self,
size: usize,
idx: usize,
) -> Result<(), GeozeroError>
fn polyhedralsurface_begin( &mut self, size: usize, idx: usize, ) -> Result<(), GeozeroError>
Source§fn polyhedralsurface_end(&mut self, idx: usize) -> Result<(), GeozeroError>
fn polyhedralsurface_end(&mut self, idx: usize) -> Result<(), GeozeroError>
Source§fn tin_begin(&mut self, size: usize, idx: usize) -> Result<(), GeozeroError>
fn tin_begin(&mut self, size: usize, idx: usize) -> Result<(), GeozeroError>
Source§fn pre_process_xy<F>(self, transform_xy: F) -> WrappedXYProcessor<Self, F>
fn pre_process_xy<F>(self, transform_xy: F) -> WrappedXYProcessor<Self, F>
transform_xy during processing, before GeomProcessor::xy
or GeomProcessor::coordinate is called. Read more