On Wed, 6 Dec 2006 20:28:42 +0100 (CET), Roger Bivand <[EMAIL PROTECTED]> wrote:
[...] > canada <- map("world2Hires", "Canada", fill=TRUE, plot=FALSE) > fill=TRUE retrives polygons, otherwise you get line segments. For this > example it now works. You can also make several retrieved island belong > to the same Polygons object by giving them the same ID. There is an > example on the pal2SpatialPolygons help page. Thanks Roger, I didn't pick up that effect of the 'fill' arg. I noticed also that I needed c("Canada", "Newfoundland"), as the latter island was not included! I'll report this. [...] > In rgdal (the PROJ.4 library is needed): > names <- sapply(slot(canada_sp, "polygons"), function(i) slot(i, "ID")) > canada_spdf <- SpatialPolygonsDataFrame(canada_sp, > data=data.frame(names=names, row.names=names)) > writeOGR(canada_spdf, dsn=".", layer="canada", driver="ESRI Shapefile") > list.files(pattern="canada") Exactly. Thanks a lot. Cheers, -- Seb _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo