[R-sig-Geo] rgdal pckg: Convert LL to UTM
Roger Bivand
Roger.Bivand at nhh.no
Fri Jul 10 21:16:46 CEST 2009
On Fri, 10 Jul 2009, Steve Hong wrote:
> Dear List,
>
> Thanks again for answering my question. I was able to convert LL to UTM using 'rgdal' package. Below is the code I used.
>
> library(rgdal)
>
> my.data2 <- read.delim("clipboard", header=T)
> my.data <- SpatialPoints(my.data, proj4string=CRS("+proj=longlat +ellps=WGS84"))
> my.data.utm <- spTransform(my.data, CRS("+proj=utm +zone=15 +ellps=WGS84"))
Good. I'd advise in general to say +datum=WGS84 rather than +ellps=WGS84,
but since both the object to be transformed and the target CRS share the
same datum and it is WGS84, no harm is done.
>
> My second questions are:
>
> 1. How can I see the list of projections available in R beside WGS84?
The CRS are provided from the PROJ.4 external library, so either use its
website, or a website giving proj4 representations of the EPSG database,
or use EPSG internally ("+init=epsg:#", for # the code for the values
needed). The websites are:
http://trac.osgeo.org/proj/wiki/GenParms
http://www.remotesensing.org/geotiff/proj_list/
http://spatialreference.org/
You can look at ?make_EPSG (in rgdal) to see how you might access EPSG
within R. See ?projInfo (in rgdal) for listings of available projections,
ellipsoids, and datums in the PROJ.4 library running with rgdal.
> 2. If I want to add/import a projection not available in R, what am I
> supposed to do?
Find the appropriate representation of your projection as understood by
PROJ.4.
Roger
>
> I would appreciate any suggestion with example.
>
> Thank you!!
>
> Steve
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
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