[R-sig-Geo] [R] transform shapefiles in UTM to lat/long

Roger Bivand Roger.Bivand at nhh.no
Tue Mar 21 19:23:23 CET 2006


On Tue, 21 Mar 2006, Fredy O. Mejia wrote:

> Dear all:
> 
> I have a shapefile in UTM coordinate system and I would like to transform it
> to Lat/Log coordinates (WSG84).  The package PBSmapping contains function
> convUL to transform between the two coordinate systems when data is in the
> form of a data frame with attributes specifying the coordinate system.
> However, when shapefiles are imported using function read.shape (package
> maptools), a list instead of a data frame is generated.  I could extract all
> the polygons in the list and transform them, individually, but I hope there
> is an easier way of doing that.  Besides, the shapefile i'm trying to
> convert has two different UTM zones (is from Guatemala, and it covers zones
> 15 and 16).  Any sugestions would be greatly appreciated.

My suggestion would be to read the shapefiles using the readOGR() function 
in the rgdal package, and then use the transform() method in that package 
to change from the appropriate UTM to geographical coordinates. 

Because I think your question involves more than that (I don't understand
how a single shapefile can use two UTM zones), I suggest moving this
thread to the R-sig-geo mailing list, and have cc-ed this reply there.

Please also say which platform and version of R you are using.

> 
> Thanks,
> 
> Fredy
> 

-- 
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