[R-sig-Geo] spTransform: unable to convert coordinates

Martin Ivanov martin.ivanov at ifg.uni-tuebingen.de
Mon Aug 20 14:14:32 CEST 2012


Dear Prof. Bivand,
It is again me on the coordinate transformation problem. So far the 
transformation to the rotated grid has gone ok, as in the example
crds <- matrix(data=c(9.05, 48.52), ncol=2)
spPoint <- SpatialPoints(coords=crds, proj4string=CRS("+proj=ob_tran 
+o_proj=longlat +o_lon_p=-162 +o_lat_p=39.25 +lon_0=180 +ellps=sphere 
+no_defs"))
a <- spTransform(spPoint, CRS("+proj=longlat +ellps=sphere +no_defs"), 
use_ob_tran=TRUE)

However:
spTransform(a, CRS("+proj=ob_tran +o_proj=longlat +o_lon_p=-162 
+o_lat_p=39.25 +lon_0=180 +ellps=sphere +no_defs") , use_ob_tran=TRUE, 
inv=TRUE)
spTransform(a, CRS("+proj=ob_tran +o_proj=longlat +o_lon_p=-162 
+o_lat_p=39.25 +lon_0=180 +ellps=sphere +no_defs") , 
use_ob_tran=TRUE)@coords*180/pi

You can see that for the inverse transformation back to normal 
coordinates, things are not multiplied by 180/pi. There is a warning, 
though:
In spTransform(a, CRS("+proj=ob_tran +o_proj=longlat +o_lon_p=-162 
+o_lat_p=39.25 +lon_0=180 +ellps=sphere +no_defs"),  :
   project: use_ob_tran set FALSE

Best regards,

-- 
Dr. Martin Ivanov
Eberhard-Karls-Universität Tübingen
Mathematisch-Naturwissenschaftliche Fakultät
Fachbereich Geowissenschaften
Water & Earth System Science (WESS)
Hölderlinstraße 12, 72074 Tübingen, Deutschland
Tel. +4970712974213



More information about the R-sig-Geo mailing list