[R-sig-Geo] Problems with projection using spTransform (rgdal)

Paul Hiemstra p.hiemstra at geo.uu.nl
Tue Aug 21 14:26:33 CEST 2007


Dear list,

When I perform the following transformation and transform back to the 
original CRS, the original coordinates are not returned:

library(gstat)
library(rgdal)
data(meuse)
coordinates(meuse) =~ x + y
proj4string(meuse) = CRS("+init=EPSG:28992")
print(bbox(meuse))
meuse = spTransform(meuse, CRS("+proj=stere +lat_0=90 +lon_0=0.0 
+lat_ts=60.0 +a=6378.388 +b=6356.912 +x_0=0 +y_0=0"))
print(bbox(meuse))
meuse = spTransform(meuse, CRS("+init=EPSG:28992"))
print(bbox(meuse))

The same code using a transformation between EPSG:28992 (Dutch CRS) and 
EPSG:4326 (latlong) works fine.

Does someone have an idea what causes this?

Paul

Info for my system.
 > sessionInfo()
R version 2.5.1 (2007-06-27)
i386-pc-mingw32

locale:
LC_COLLATE=Dutch_Netherlands.1252;LC_CTYPE=Dutch_Netherlands.1252;LC_MONETARY=Dutch_Netherlands.1252;LC_NUMERIC=C;LC_TIME=Dutch_Netherlands.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods" 
[7] "base"    

other attached packages:
   gstat    rgdal       sp
"0.9-39" "0.5-15" "0.9-14"

-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone: 	+31302535773
Fax:	+31302531145
http://intamap.geo.uu.nl/~paul




More information about the R-sig-Geo mailing list