pub enum Geometry2D {
LineString(LineString),
MultiLineString(MultiLineString),
Polygon(Polygon),
MultiPolygon(MultiPolygon),
Rect(Rect),
Line(Line),
Collection(Geometries2D),
}Expand description
A 2D Geometry which is independent from resolution.
Variants§
LineString(LineString)
Line string.
MultiLineString(MultiLineString)
Multiple line strings.
Polygon(Polygon)
Polygon.
MultiPolygon(MultiPolygon)
Multiple polygons.
Rect(Rect)
Rectangle.
Line(Line)
Line.
Collection(Geometries2D)
Collection,
Implementations§
Source§impl Geometry2D
impl Geometry2D
Sourcepub fn boolean_op(self, other: Self, op: &BooleanOp) -> MultiPolygon
pub fn boolean_op(self, other: Self, op: &BooleanOp) -> MultiPolygon
Apply boolean operation.
Sourcepub fn to_multi_polygon(&self) -> MultiPolygon
pub fn to_multi_polygon(&self) -> MultiPolygon
Convert geometry to a multi_polygon.
Sourcepub fn is_areal(&self) -> bool
pub fn is_areal(&self) -> bool
Returns true if this geometry fills an area (e.g. like a polygon or circle).
Sourcepub fn with_bounds(self) -> WithBounds2D<Geometry2D>
pub fn with_bounds(self) -> WithBounds2D<Geometry2D>
Return this geometry with calculated bounds.
Trait Implementations§
Source§impl Buffer for Geometry2D
impl Buffer for Geometry2D
type Scalar = f64
Source§fn buffer_with_style(
&self,
style: BufferStyle<Self::Scalar>,
) -> MultiPolygon<Self::Scalar>
fn buffer_with_style( &self, style: BufferStyle<Self::Scalar>, ) -> MultiPolygon<Self::Scalar>
Source§impl CalcBounds2D for Geometry2D
impl CalcBounds2D for Geometry2D
Source§fn calc_bounds_2d(&self) -> Bounds2D
fn calc_bounds_2d(&self) -> Bounds2D
Fetch bounds.
Source§impl Clone for Geometry2D
impl Clone for Geometry2D
Source§fn clone(&self) -> Geometry2D
fn clone(&self) -> Geometry2D
Returns a duplicate 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 Geometry2D
impl Debug for Geometry2D
Source§impl<'_derivative_strum> From<&'_derivative_strum Geometry2D> for &'static str
impl<'_derivative_strum> From<&'_derivative_strum Geometry2D> for &'static str
Source§fn from(x: &'_derivative_strum Geometry2D) -> &'static str
fn from(x: &'_derivative_strum Geometry2D) -> &'static str
Converts to this type from the input type.
Source§impl From<Geometries2D> for Geometry2D
impl From<Geometries2D> for Geometry2D
Source§fn from(value: Geometries2D) -> Self
fn from(value: Geometries2D) -> Self
Converts to this type from the input type.
Source§impl From<Geometry2D> for &'static str
impl From<Geometry2D> for &'static str
Source§fn from(x: Geometry2D) -> &'static str
fn from(x: Geometry2D) -> &'static str
Converts to this type from the input type.
Source§impl From<Geometry2D> for MultiPolygon
impl From<Geometry2D> for MultiPolygon
Source§fn from(geo: Geometry2D) -> Self
fn from(geo: Geometry2D) -> Self
Converts to this type from the input type.
Source§impl From<Geometry2D> for WithBounds2D<Geometry2D>
impl From<Geometry2D> for WithBounds2D<Geometry2D>
Source§fn from(geo: Geometry2D) -> Self
fn from(geo: Geometry2D) -> Self
Converts to this type from the input type.
Source§impl From<Line> for Geometry2D
impl From<Line> for Geometry2D
Source§impl From<LineString> for Geometry2D
impl From<LineString> for Geometry2D
Source§fn from(value: LineString) -> Self
fn from(value: LineString) -> Self
Converts to this type from the input type.
Source§impl From<MultiLineString> for Geometry2D
impl From<MultiLineString> for Geometry2D
Source§fn from(value: MultiLineString) -> Self
fn from(value: MultiLineString) -> Self
Converts to this type from the input type.
Source§impl From<MultiPolygon> for Geometry2D
impl From<MultiPolygon> for Geometry2D
Source§fn from(value: MultiPolygon) -> Self
fn from(value: MultiPolygon) -> Self
Converts to this type from the input type.
Source§impl From<Polygon> for Geometry2D
impl From<Polygon> for Geometry2D
Source§impl From<Rect> for Geometry2D
impl From<Rect> for Geometry2D
Source§impl Mirror2D for Geometry2D
impl Mirror2D for Geometry2D
Source§fn mirror_2d(self, l: &Line) -> Geometries2D
fn mirror_2d(self, l: &Line) -> Geometries2D
Mirror operation.
Source§impl Reflect2D for Geometry2D
impl Reflect2D for Geometry2D
Source§fn reflect_2d(&self, l: &Line) -> Self
fn reflect_2d(&self, l: &Line) -> Self
Mirror a 2D geometry.
Source§impl TotalMemory for Geometry2D
impl TotalMemory for Geometry2D
Source§fn heap_memory(&self) -> usize
fn heap_memory(&self) -> usize
Get amount of heap memory in bytes.
Source§fn total_memory(&self) -> usize
fn total_memory(&self) -> usize
Total amount of memory in bytes.
Source§fn stack_memory(&self) -> usize
fn stack_memory(&self) -> usize
Get amount of stack memory in bytes.
Source§impl Transformed2D for Geometry2D
impl Transformed2D for Geometry2D
Source§fn transformed_2d(&self, mat: &Mat3) -> Self
fn transformed_2d(&self, mat: &Mat3) -> Self
Transform from matrix.
Source§impl VertexCount for Geometry2D
impl VertexCount for Geometry2D
Source§fn vertex_count(&self) -> usize
fn vertex_count(&self) -> usize
Return vertex count.
Auto Trait Implementations§
impl Freeze for Geometry2D
impl RefUnwindSafe for Geometry2D
impl !Send for Geometry2D
impl !Sync for Geometry2D
impl Unpin for Geometry2D
impl UnwindSafe for Geometry2D
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more