[R-sig-Geo] spTransform problem

Duncan Golicher dgoliche at sclc.ecosur.mx
Thu Nov 16 01:13:08 CET 2006

```Can anyone tell me what I am doing wrong when using spTransform?
I need to transform points in Southern Mexico from UTM NAD27 to Long Lat
WGS84.

Three small functions.

coordinates(points)<-~x+y
points at proj4string<-CRS("+proj=utm +zone=15 +ellps=clrk66 +datum=NAD27
+units=m")
spTransform(points, CRS("+proj=longlat +datum=WGS84"))}

coordinates(points)<-~x+y
points at proj4string<-CRS("+proj=utm +zone=15 +datum=NAD27 +units=m")

coordinates(points)<-~x+y
points at proj4string<-CRS("+proj=utm +zone=15 +datum=NAD27 +units=m")
spTransform(points, CRS("+proj=utm +zone=15 +datum=WGS84 +units=m"))}

When I test them I get strange results.

x<-c(541987,541970)
y<-c(1846598,1846799)

points<-data.frame(x,y)

SpatialPoints:
x        y
[1,] -92.60617 16.70272
[2,] -92.60633 16.70454
Coordinate Reference System (CRS) arguments:  +proj=longlat +datum=WGS84
+ellps=WGS84 +towgs84=0,0,0

SpatialPoints:
x        y
[1,] -92.60617 16.70272
[2,] -92.60633 16.70454
Coordinate Reference System (CRS) arguments:  +proj=longlat +datum=NAD27

The results are the same, even though one function involves a datum
shift and the other doesn't.

The difference between NAD27 and WGS84 in Southern Mexico should be
around 200m N and 20m E. But I get

x         y
1 0.5857494 -112.2658
2 0.5855395 -112.2768

Duncan Golicher
--

Dr Duncan Golicher
Ecologia y Sistematica Terrestre
El Colegio de la Frontera Sur
San Cristobal de Las Casas,
Chiapas, Mexico

Email: dgoliche at sclc.ecosur.mx

Tel: 967 674 9000 ext 1310
Fax: 967 678 2322

United Kingdom Skypein; 020 7870 6251
Skype name: duncangolicher

```