[R-sig-Geo] a minor bug in rgdal?

epaiv01 martin.ivanov at ifg.uni-tuebingen.de
Sat Dec 8 18:59:13 CET 2012


Dear Prof. Bivand,

I am running R-2.15.2 with rgdal version 0.7-22.
I noticed the following bug: when transforming a SpatialPoints object,
a white space is prepended to the proj4string of the target CRS. For 
example:

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)

proj4string(a)
# " +proj=ob_tran +o_proj=longlat +o_lon_p=-162 +o_lat_p=39.25 
+lon_0=180 +ellps=sphere +no_defs"

As You can see, a white space is prepended to the proj4string, from 
"+proj=ob_tran ..."
it becomes " +proj=ob_tran ...". This leads to errors when one 
interpolates using krige from gstat for example.

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