polygonise: Convert the Dirichlet tessellation to polygons and clip if so...

polygoniseR Documentation

Convert the Dirichlet tessellation to polygons and clip if so desired.

Description

Convert the Dirichlet tessellation to polygons and clip if so desired.

Usage

polygonise(
  x,
  window = NULL,
  clippy = TRUE,
  crs = sf::st_crs("EPSG:4326"),
  unit,
  ...
)

Arguments

x

Dirichlet tessellation object

window

polygon A polygon to clip the dirichlet tessellation - intersection between boundary polygons and polygon

clippy

Logical Clip to the bounding box or polgon if polyclip = TRUE.

crs

CRS Projection of coordinates default is "EPSG:4326" (lon/lat wgs84)

unit

Character The type of area to return. The default is "geo" and returns the area based on the euclidean distance between geographic coordinates. This will default to the values of the raster and presence coordinate system. Alternatively, meters squared "m", kilometers squared "km", or hectares "ha" can be used.

\dots

Additional arguments for a polygonise function

Examples

library(sf)
coords <- matrix(runif(2000),ncol=2)
tess <- dirTess(coords)
tess.polys <- polygonise(tess)
plot(st_geometry(tess.polys$polygons), col=hcl.colors(100))
points(coords,col='tomato',pch=16, cex=.3)

skiptoniam/qrbp documentation built on May 13, 2023, 2:08 a.m.