Skip to main content

simplify_polygon

Function simplify_polygon 

Source
pub fn simplify_polygon(
    polygon: &Polygon,
    tolerance: f64,
    method: SimplifyMethod,
) -> Result<Polygon>
Expand description

Simplifies a polygon using the specified algorithm

§Arguments

  • polygon - Input polygon to simplify
  • tolerance - Simplification tolerance
  • method - Simplification algorithm to use

§Returns

Simplified polygon with exterior and interior rings simplified

§Errors

Returns error if:

  • Polygon is invalid
  • Tolerance is negative
  • Simplified polygon would have fewer than 4 points