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
d <- delaunay(x)
d
plot(v, lwd=2, col=rainbow(15))
lines(x, col="gray", lwd=2)
points(x)
Run the code above in your browser using DataLab