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

Roger Bivand Roger.Bivand at nhh.no
Wed Dec 6 21:51:23 CET 2006


On Wed, 6 Dec 2006, Sebastian P. Luque wrote:

> On Wed, 06 Dec 2006 14:00:38 -0600,
> "Sebastian P. Luque" <spluque at gmail.com> wrote:
> 
> > On Wed, 6 Dec 2006 20:28:42 +0100 (CET),
> > Roger Bivand <Roger.Bivand at nhh.no> wrote:
> 
> [...]
> 
> >> 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")
> 
> I searched on the maps and mapdata packages for the missing datum, but
> only found this:
> 
> 
> ,-----[ *help[R](map)* (lines: 54 - 59) ]
> | projection: character string that names a map projection to use. See
> |           'mapproject' (in the 'mapproj' library). The default is to
> |           use a rectangular projection with the aspect ratio chosen so
> |           that longitude and latitude scales are equivalent at the
> |           center of the picture. 
> `-----
> 
> 
> where I think mapproj code has been transferred to rgdal.  How can we
> create a datum from this information?  Thanks once again.

No, the mapproj code base is completely different, has no datum support 
(no datum transformation), the rgdal code is from PROJ.4.

Roger

> 
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list