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 <alobolis...@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@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > _______________________________________________ R-sig-Geo mailing list R-sig-Geo@stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo