[Rspatial-devel] spTransform

Roger Bivand Roger.Bivand at nhh.no
Fri Apr 19 16:58:38 CEST 2013


OK, but I can't release rgdal yet - there is an AddressSanitizer issue 
which means I have to install GCC 4.8 to check, clang wasn't able to. I'll 
say when I'm ready - rgdal will have to depend on the new sp, so that can 
go first, but should be checked to see what happens if old rgdal is 
installed with it.

Roger

On Fri, 19 Apr 2013, Edzer Pebesma wrote:

> spTransform is currently defined, both as S4 and S3 methods, in rgdal. I
> try to export it in spacetime (for ST objects), but this doesn't work
> because rgdal is not imported (I'd like to avoid dependence on rgdal).
>
> My suggestion is to:
>
> add the definition of the S4 generic to sp, and have sp export it, but
> not provide methods for it.
>
> This works, but will lead to all kind of warnings when loading rgdal,
> caused by the S3 methods. So my second suggestion is:
>
> remove all S3 definitions & exports of spTransform from rgdal. After
> that, all three work happily together:
>
>> library(rgdal)
> Loading required package: sp
> rgdal: version: 0.8-6, (SVN revision 453M)
> Geospatial Data Abstraction Library extensions to R successfully loaded
> Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
> Path to GDAL shared files: /usr/share/gdal/1.9
> Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
> Path to PROJ.4 shared files: (autodetected)
>> library(spacetime)
>> showMethods(spTransform)
> Function: spTransform (package sp)
> x="SpatialGridDataFrame", CRSobj="CRS"
> x="SpatialLines", CRSobj="CRS"
> x="SpatialLinesDataFrame", CRSobj="CRS"
> x="SpatialPixelsDataFrame", CRSobj="CRS"
> x="SpatialPoints", CRSobj="CRS"
> x="SpatialPointsDataFrame", CRSobj="CRS"
> x="SpatialPolygons", CRSobj="CRS"
> x="SpatialPolygonsDataFrame", CRSobj="CRS"
> x="ST", CRSobj="CRS"
>
> I committed both to r-forge.
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the Rspatial-devel mailing list