Re: [R-sig-Geo] map to shapefile with projection info

2006-12-06 Thread Roger Bivand
On Wed, 6 Dec 2006, Sebastian P. Luque wrote: > On Wed, 06 Dec 2006 14:00:38 -0600, > "Sebastian P. Luque" <[EMAIL PROTECTED]> wrote: > > > On Wed, 6 Dec 2006 20:28:42 +0100 (CET), > > Roger Bivand <[EMAIL PROTECTED]> wrote: > > [...] > > >> names <- sapply(slot(canada_sp, "polygons"), function

Re: [R-sig-Geo] map to shapefile with projection info

2006-12-06 Thread Sebastian P. Luque
On Wed, 06 Dec 2006 14:00:38 -0600, "Sebastian P. Luque" <[EMAIL PROTECTED]> wrote: > On Wed, 6 Dec 2006 20:28:42 +0100 (CET), > Roger Bivand <[EMAIL PROTECTED]> wrote: [...] >> names <- sapply(slot(canada_sp, "polygons"), function(i) slot(i, "ID")) >> canada_spdf <- SpatialPolygonsDataFrame(can

Re: [R-sig-Geo] map to shapefile with projection info

2006-12-06 Thread Sebastian P. Luque
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 belon

Re: [R-sig-Geo] map to shapefile with projection info

2006-12-06 Thread Roger Bivand
On Wed, 6 Dec 2006, Sebastian P. Luque wrote: > Hi, > > Trying to extract a map (package maps) to a shapefile, IIUC the procedure > is to get it into a SpatialPolygonsDataFrame and then use > writePolyShape(). This seems to require an intermediate step through > SpatialPolygons. However, I'm ru

[R-sig-Geo] map to shapefile with projection info

2006-12-06 Thread Sebastian P. Luque
Hi, Trying to extract a map (package maps) to a shapefile, IIUC the procedure is to get it into a SpatialPolygonsDataFrame and then use writePolyShape(). This seems to require an intermediate step through SpatialPolygons. However, I'm running into some problems: R> canada <- map("world2Hires",