[−][src]Trait geo::algorithm::concave_hull::ConcaveHull
Returns a polygon which covers a geometry. Unlike convex hulls, which also cover their geometry, a concave hull does so while trying to further minimize its area by constructing edges such that the exterior of the polygon incorporates points that would be interior points in a convex hull.
This implementation is inspired by https://github.com/mapbox/concaveman and also uses ideas from the following paper: www.iis.sinica.edu.tw/page/jise/2012/201205_10.pdf
Examples
use geo::{line_string, polygon}; use geo::algorithm::concave_hull::ConcaveHull; // a square shape let poly = polygon![ (x: 0.0, y: 0.0), (x: 4.0, y: 0.0), (x: 4.0, y: 4.0), (x: 0.0, y: 4.0), ]; // The correct concave hull coordinates let correct_hull = line_string![ (x: 4.0, y: 0.0), (x: 4.0, y: 4.0), (x: 0.0, y: 4.0), (x: 0.0, y: 0.0), (x: 4.0, y: 0.0), ]; let res = poly.concave_hull(2.0); assert_eq!(res.exterior(), &correct_hull);
Associated Types
type Scalar: CoordinateType
Required methods
fn concave_hull(&self, concavity: Self::Scalar) -> Polygon<Self::Scalar>
Implementors
impl<T> ConcaveHull for LineString<T> where
T: Float + RTreeNum + HasKernel,
[src]
T: Float + RTreeNum + HasKernel,
impl<T> ConcaveHull for MultiLineString<T> where
T: Float + RTreeNum + HasKernel,
[src]
T: Float + RTreeNum + HasKernel,
type Scalar = T
fn concave_hull(&self, concavity: T) -> Polygon<T>
[src]
impl<T> ConcaveHull for MultiPoint<T> where
T: Float + RTreeNum + HasKernel,
[src]
T: Float + RTreeNum + HasKernel,
type Scalar = T
fn concave_hull(&self, concavity: T) -> Polygon<T>
[src]
impl<T> ConcaveHull for MultiPolygon<T> where
T: Float + RTreeNum + HasKernel,
[src]
T: Float + RTreeNum + HasKernel,
impl<T> ConcaveHull for Polygon<T> where
T: Float + RTreeNum + HasKernel,
[src]
T: Float + RTreeNum + HasKernel,