Hi Barry,

What do you mean with a broken OO model? 

Best,

Jacob.

--- On Sat, 5/29/10, Barry Rowlingson <b.rowlingson@lancaster.ac.uk> wrote:

From: Barry Rowlingson <b.rowlingson@lancaster.ac.uk>
Subject: Re: [R-sig-Geo] projection() and proj4string()
To: "Agustin Lobo" <alobolistas@gmail.com>
Cc: r-sig-geo@stat.math.ethz.ch
Date: Saturday, May 29, 2010, 7:10 PM

On Sat, May 29, 2010 at 6:02 PM, Agustin Lobo <alobolistas@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

 Read the source. "projection" does a bunch of class tests (sure sign
of a broken OO model), returning x@crs for BasicRaster and
x@proj4string for Spatial classes.

 However, "projection<-" doesn't. It tries to assign to x@crs whatever.

Barry

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo



      
	[[alternative HTML version deleted]]

