Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simplify.owin

Approximate a Polygon by a Simpler Polygon


Description

Given a polygonal window, this function finds a simpler polygon that approximates it.

Usage

simplify.owin(W, dmin)

Arguments

W

The polygon which is to be simplied. An object of class "owin".

dmin

Numeric value. The smallest permissible length of an edge.

Details

This function simplifies a polygon W by recursively deleting the shortest edge of W until all remaining edges are longer than the specified minimum length dmin, or until there are only three edges left.

The argument W must be a window (object of class "owin"). It should be of type "polygonal". If W is a rectangle, it is returned without alteration.

The simplification algorithm is not yet implemented for binary masks. If W is a mask, an error is generated.

Value

Another window (object of class "owin") of type "polygonal".

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

plot(letterR, col="red")
  plot(simplify.owin(letterR, 0.3), col="blue", add=TRUE)

  W <- Window(chorley)
  plot(W)
  WS <- simplify.owin(W, 2)
  plot(WS, add=TRUE, border="green")
  points(vertices(WS))

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.