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

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

Calculation of the area.

Required Methods

Area of polygon. See: https://en.wikipedia.org/wiki/Polygon

use geo::{Coordinate, Point, LineString, Polygon};
use geo::algorithm::area::Area;
let p = |x, y| Point(Coordinate { x: x, y: y });
let v = Vec::new();
let linestring = LineString(vec![p(0., 0.), p(5., 0.), p(5., 6.), p(0., 6.), p(0., 0.)]);
let poly = Polygon::new(linestring, v);
assert_eq!(poly.area(), 30.);

Implementors