Skip to content
Prev 18382 / 29559 Next

Automatic geographical projection parameters setting

Hello,

Please reply to the list, not only to me.

Example taken from rgdal::spTransform:


 > crds <- matrix(data=c(9.05, 48.52), ncol=2)
 > spPoint <- SpatialPoints(coords=crds,
+                          proj4string=CRS("+proj=longlat +ellps=sphere 
+no_defs"))
 > a <- spTransform(spPoint, CRS(paste("+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)
 > a
SpatialPoints:
      coords.x1 coords.x2
[1,] -5.917698  -1.87195
Coordinate Reference System (CRS) arguments: +proj=ob_tran 
+o_proj=longlat +o_lon_p=-162 +o_lat_p=39.25 +lon_0=180 +ellps=sphere
+no_defs
 >
 > lon_0 <- 180
 > o_lon_p <- -162
 > o_lat_p <- 39.25
 >
 > crs.args <- paste("+o_lon_p=",o_lon_p," +o_lat_p=",o_lat_p," 
+lon_0=",lon_0," +ellps=sphere +no_defs", sep='')
 > b <- spTransform(spPoint, CRS(paste("+proj=ob_tran 
+o_proj=longlat",crs.args)), use_ob_tran=TRUE)
 > b
SpatialPoints:
      coords.x1 coords.x2
[1,] -5.917698  -1.87195
Coordinate Reference System (CRS) arguments: +proj=ob_tran 
+o_proj=longlat +o_lon_p=-162 +o_lat_p=39.25 +lon_0=180 +ellps=sphere
+no_defs


Regards,
Pascal
On 05/29/2013 06:26 PM, Francesco Carotenuto wrote: