[R-sig-Geo] proj4string-issue - leading spaces

Roger Bivand Roger.Bivand at nhh.no
Fri Jan 11 12:42:58 CET 2013


On Fri, 11 Jan 2013, Edzer Pebesma wrote:

>
>
> On 01/11/2013 12:10 PM, Jon Olav Skoien wrote:
>>
>> Is there a simple way to solve this, not having check and modify the
>> proj4string of all objects? Or could the call to identical in functions
>> like over be replaced by an identicalCRS()-function?
>>
>> identicalCRS = function(x,y) {
>>   identical(CRS(proj4string(x)), CRS(proj4string(y)))
>> }
>
> Great suggestion, Jon; I added this to sp on r-forge.

Not so great, it doesn't address the problem that users with different 
versions of rgdal (and/or with stored objects from older versions of 
rgdal) may have extraneous prepended spaces. The function nees to test for 
NA or not, then length, if lengths equal, OK, test, if differ by one check 
whether space and if so trim, ...

Roger

>

-- 
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 R-sig-Geo mailing list