On Thu, 9 Aug 2007, Felix Andrews wrote:
e.g.
# x is a gpc.poly object
as.Polygons.gpc.poly <- function(x, ID) {
thisPolys <- lapply(get.pts(x), function(p) {
Polygon(rbind(as.matrix(cbind(p$x,p$y)),c(p$x[1],p$y[1])),
hole=p$hole)
})
e.g.
# x is a gpc.poly object
as.Polygons.gpc.poly <- function(x, ID) {
thisPolys <- lapply(get.pts(x), function(p) {
Polygon(rbind(as.matrix(cbind(p$x,p$y)),c(p$x[1],p$y[1])),
hole=p$hole)
})
Polygons(thisPolys, ID)
}
This works exc
Hmm
I'm trying to work with gpclib, converting to and from the sp classes.
I don't know what is/was in the package spgpc, but it is no longer
available:
> install.packages("spgpc", repos=rSpatial)
Warning: unable to access index for repository
http://r-spatial.sourceforge.net/R/bin/windows/contrib