[R-sig-Geo] problems loading spproj library for transform()

Roger Bivand Roger.Bivand at nhh.no
Thu May 25 07:16:08 CEST 2006


On Thu, 25 May 2006 karl.sommer at dpi.vic.gov.au wrote:

> Hello list
> 
> I have been trying to do a projection conversion from lat lon to a UTM grid
> 
> I followed an example in the April discussion list provided by Roger Bivand
> and adapted it to my own data.

In situations like this, the output of sessionInfo() usually helps. I 
think you have old copies of one or more of rgdal, sp, or spproj. Because 
all of spproj is included in rgdal, it isn't needed at all. My guess is 
that you can totally remove spproj, but check the versions first. 

Roger

> Everythings seemd to work well up until the transform() method which failed
> to execute.  The failure seems due to a problem
> with loading the "spproj package" but I can't make sense of the error
> messages which are listed below.
> Re-installing spproj did not make a difference.  I am working on a Windows
> system
> 
> Any hints would be appreciated
> 
> Regards
> 
> Karl
> 
> # import of shape file
> wingem38 <- readOGR(dsn = "em38/wing_em38.shp", layer="wing_em38",
> verbose=T)
> 
> read all EPSG definitions into memory
> EPSG <- make_EPSG()
> 
> # extract possible options for UTM zone -54
> EPSG[grep("UTM zone 54S", EPSG$note), 1:2]
> 
> # gives 4 options, select WGS 84 and assign to variable
> utm54S <- CRS("+init=epsg:32754")
> showWKT(CRSargs(utm54S))
> 
> # If shapefiles have a *.prj file already, readOGR() will pick it up.
> # If not, need to assign the input coordinate reference system
> # to the Spatial object(s):
> 
> my_ll <- CRS("+proj=lonlat +datum=WGS84")
> proj4string(wingem38) <- my_ll
> 
> em38utm <- transform(wingem38,  utm54S)
> 
> 
> Loading required package: spproj
> Error in importIntoEnv(impenv, impnames, ns, impvars) :
>       objects 'Sline', 'Sring', 'Srings', 'SpatialRings',
> 'getSRpolygonsSlot', 'getSringsIDSlot', 'getSringsSringsSlot',
> 'getSringCoordsSlot' are not exported by 'namespace:sp'
> r-sig-geo at stat.math.ethz.chError in transform(wingem38, utm54S) : for using
> (coordinate) transform on objects deriving from Spatial, library spproj is
> required
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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 R-sig-Geo mailing list