Hi,

how can i convert the delaunay triangulation to spatial polygons?

library(deldir)
library(sp)
x   <- c(2.3,3.0,7.0,1.0,3.0,8.0)
y   <- c(2.3,3.0,2.0,5.0,8.0,9.0)
df_xy <- data.frame(x=x,y=y)
coordinates(df_xy) <- ~x+y
# deluanay triangulation is plotted. That is OK.
z <- deldir(x,y,plot=TRUE,wl='triang',wp="none")

# However, while trying to convert z (deluanay) to SpatialPolygon,
# the output is as the same as dirichlet/voronoi tesselation output,
# even the z is delaunay triangulation.
w <- tile.list(z)
polys <- vector(mode="list", length=length(w))
for (i in seq(along=polys))
{
pcrds <- cbind(w[[i]]$x, w[[i]]$y)
pcrds <- rbind(pcrds, pcrds[1,])
polys[[i]] <- Polygons(list(Polygon(pcrds)), ID=as.character(i))
}
SP <- SpatialPolygons(polys)
plot(SP)
plot(df_xy, add=T, col="RED")

is there any way to convert the delaunay to sp polygon class?

regards,
Volkan Kepoglu.

	[[alternative HTML version deleted]]

