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

voronoi

voronoi diagram and delauny triangles


Description

Get a voronoi diagram or delauny triangles for points, or nodes of lines or polygons

Usage

## S4 method for signature 'SpatVector'
voronoi(x, bnd=NULL, tolerance=0, as.lines=FALSE) 

## S4 method for signature 'SpatVector'
delauny(x, tolerance=0, as.lines=FALSE)

Arguments

x

SpatVector

bnd

SpatVector to set the outer boundary of the voronoi diagram

tolerance

numeric >= 0, snapping tolerance (0 is no snapping)

as.lines

logical. If TRUE, lines are returned without the outer boundary

Value

SpatVector

Examples

wkt <- c("MULTIPOLYGON ( ((40 40, 20 45, 45 30, 40 40)), 
  ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),(30 20, 20 15, 20 25, 30 20)))", 
  "POLYGON ((0 -5, 10 0, 10 -10, 0 -5))")
x <- vect(wkt)
v <- voronoi(x)
v

plot(v, lwd=2, col=rainbow(15))
lines(x, col="gray", lwd=2)
points(x)

terra

Spatial Data Analysis

v1.2-10
GPL (>= 3)
Authors
Robert J. Hijmans [cre, aut] (<https://orcid.org/0000-0001-5872-2872>), Roger Bivand [ctb] (<https://orcid.org/0000-0003-2392-6140>), Karl Forner [ctb], Jeroen Ooms [ctb] (<https://orcid.org/0000-0002-4035-0289>), Edzer Pebesma [ctb] (<https://orcid.org/0000-0001-8049-7069>)
Initial release
2021-05-12

We don't support your browser anymore

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