Re: [R-sig-Geo] (no subject); Clipping/Subsetting Sp objects (was no subject)

2006-04-07 Thread Tim Keitt
You'll notice that I wasn't volunteering.. :-) I guess my main comment re massive datasets, etc. is that once I learned about the power of generic programming (we've been adapting the Boost Graph Library to work with GIS), I always feel a great sense of waste when I see nice algorithms chained pit

Re: [R-sig-Geo] (no subject); Clipping/Subsetting Sp objects (was no subject)

2006-04-07 Thread Andy Bunn
> -Original Message- > From: Edzer J. Pebesma [mailto:[EMAIL PROTECTED] > Sent: Friday, April 07, 2006 5:30 AM > To: Tim Keitt > Cc: Andy Bunn; r-sig-geo@stat.math.ethz.ch; [EMAIL PROTECTED] > Subject: Re: [R-sig-Geo] (no subject); Clipping/Subsetting Sp objects

Re: [R-sig-Geo] (no subject); Clipping/Subsetting Sp objects (was no subject)

2006-04-07 Thread Roger Bivand
On Fri, 7 Apr 2006, Edzer J. Pebesma wrote: > Andy, Tim, the magic phrases (following your example) are: > > clip.sp = SpatialPolygons(list(Polygons(list(Polygon(clip)), ID="clip"))) > fullgrid(x) = FALSE > x.clip = x[!is.na(overlay(x, clip.sp)),] > image(x.clip,col="blue",add=T) > > the first c

Re: [R-sig-Geo] (no subject); Clipping/Subsetting Sp objects (was no subject)

2006-04-07 Thread Edzer J. Pebesma
Andy, Tim, the magic phrases (following your example) are: clip.sp = SpatialPolygons(list(Polygons(list(Polygon(clip)), ID="clip"))) fullgrid(x) = FALSE x.clip = x[!is.na(overlay(x, clip.sp)),] image(x.clip,col="blue",add=T) the first command creates a SpatialPolygons object from the coordinates.