[R-sig-Geo] projection() and proj4string()

Robert J. Hijmans r.hijmans at gmail.com
Sat May 29 19:54:28 CEST 2010


I have implemented Roger's suggestion (in 'raster' version 1.1.5). I.e.

projection(x) <-  value

can now assign a new CRS to objects 'x' of class Spatial* as well as
class Raster*
value can be either a character string or an object of class CRS.

Robert

On Sat, May 29, 2010 at 10:02 AM, Agustin Lobo <alobolistas at gmail.com> wrote:
>
> So, if I correctly understand, projection() can be used to retrieve
> information
> from an sp object but not to assign that info to a sp object:
>> projection(a)
> [1] "+proj=utm +zone=31 +ellps=intl +units=m +no_defs"
>
>> projection(a) <- projection(a)
> Error in checkSlotAssignment(object, name, value) :
>  "crs" is not a slot in class "SpatialPoints"
> Calls: projection<- -> @<- -> slot<- -> checkSlotAssignment
>
>
> Roger Bivand wrote:
>>
>> .../...
>> Probably projection<-() needs the same if() statement as that used in
>> projection(), to distinguish extensions of "BasicRaster" from those of
>> "Spatial", in which case projection<-() and proj4string<-() will both work
>> on objects extending "Spatial" too.
>>
>> Roger
>>
>
> >From a user point of view, this would be certainly useful.
>
> Thanks!
>
> Agus
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/projection-and-proj4string-tp5115767p5116707.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list