[][src]Trait geo::algorithm::area::Area

pub trait Area<T> where
    T: CoordinateType
{ fn area(&self) -> T; }

Calculation of the area.

Required methods

fn area(&self) -> T

Signed area of a geometry.

Examples

use geo::{Coordinate, Point, LineString, Polygon};
use geo::algorithm::area::Area;

let mut polygon = Polygon::new(LineString::from(vec![
    (0., 0.),
    (5., 0.),
    (5., 6.),
    (0., 6.),
    (0., 0.)
]), vec![]);

assert_eq!(polygon.area(), 30.);

polygon.exterior_mut(|line_string| {
    line_string.0.reverse();
});

assert_eq!(polygon.area(), -30.);
Loading content...

Implementors

impl<T> Area<T> for Line<T> where
    T: CoordinateType
[src]

impl<T> Area<T> for MultiPolygon<T> where
    T: Float
[src]

impl<T> Area<T> for Polygon<T> where
    T: Float
[src]

impl<T> Area<T> for Rect<T> where
    T: CoordinateType
[src]

impl<T> Area<T> for Triangle<T> where
    T: Float
[src]

Loading content...