delaunay,GVector-method {fasterRaster} | R Documentation |
Delaunay triangulation for points
Description
This function creates a Delaunay triangulation from a "points" GVector
.
Usage
## S4 method for signature 'GVector'
delaunay(x)
Arguments
x |
A |
Value
A GVector
.
See Also
terra::delaunay()
, module v.delaunay
in GRASS
Examples
if (grassStarted()) {
# Setup
library(sf)
# Example vectors
madDypsis <- fastData("madDypsis") # points
madCoast4 <- fastData("madCoast4") # polygons
# Convert sf vectors to GVectors
dypsis <- fast(madDypsis)
coast4 <- fast(madCoast4)
ant <- coast4[coast4$NAME_4 == "Antanambe"]
# Delaunay triangulation
dypsisDel <- delaunay(dypsis)
plot(dypsisDel)
plot(dypsis, pch = 1, col = "red", add = TRUE)
# Voronoi tessellation
vor <- voronoi(dypsis)
plot(vor)
plot(dypsis, pch = 1, col = "red", add = TRUE)
# Random Voronoi tessellation
rand <- rvoronoi(coast4, size = 100)
plot(rand)
}
[Package fasterRaster version 8.4.0.3 Index]