alphahull: alpha-shape calculation

View source: R/alpha_hull.R

alphahullR Documentation

alpha-shape calculation

Description

Calculate a window containing all points of a point pattern. The window is not convex but as close as possible to the points.

Usage

alphahull(X, alpha = NULL)

Arguments

X

a planar point pattern (spatstat.geom::ppp.object).

alpha

a smoothing parameter to delimit concave polygons.

Details

The typical use of this function is to define a narrow window around a point pattern that has been created with a default, rectangle window.

The window is built by the alphahull::ashape() function and then transformed into a spatstat.geom::owin.object. The alpha parameter determines the smallest size of zones excluded from the window. If it is not specified, a first attempt is 1/256 of the diameter of the existing window of X. If the shape cannot be calculated, alpha is doubled and a new attempt is made.

Value

A window, i.e. a spatstat.geom::owin.object.

See Also

spatstat.geom::convexhull

Examples

# Simulate a point pattern
if (require(spatstat.random)) {
  X <- rpoispp(50)
  plot(X)
  # Calculate its border
  X$window <- alphahull(X)
  plot(X)
}

divent documentation built on April 3, 2025, 7:40 p.m.