[−][src]Trait geo::algorithm::area::Area
Signed planar area of a geometry.
Examples
use geo::polygon; use geo::algorithm::area::Area; let mut polygon = polygon![ (x: 0., y: 0.), (x: 5., y: 0.), (x: 5., y: 6.), (x: 0., y: 6.), (x: 0., y: 0.), ]; assert_eq!(polygon.signed_area(), 30.); assert_eq!(polygon.unsigned_area(), 30.); polygon.exterior_mut(|line_string| { line_string.0.reverse(); }); assert_eq!(polygon.signed_area(), -30.); assert_eq!(polygon.unsigned_area(), 30.);
Required methods
fn signed_area(&self) -> T
fn unsigned_area(&self) -> T
Implementors
impl<T> Area<T> for Geometry<T> where
T: Float,
[src]
T: Float,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for GeometryCollection<T> where
T: Float,
[src]
T: Float,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for Line<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for LineString<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for MultiLineString<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for MultiPoint<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for MultiPolygon<T> where
T: Float,
[src]
T: Float,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for Point<T> where
T: CoordinateType,
[src]
T: CoordinateType,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for Polygon<T> where
T: Float,
[src]
T: Float,
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for Rect<T> where
T: CoordinateType,
[src]
T: CoordinateType,
Because a Rect
has no winding order, the area will always be positive.
fn signed_area(&self) -> T
[src]
fn unsigned_area(&self) -> T
[src]
impl<T> Area<T> for Triangle<T> where
T: Float,
[src]
T: Float,