Re: [R-sig-Geo] Clip SpatialGridDataFrame with SpatialPolygons

2012-12-18 Thread Nathalie Morin
Eurêka ! -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Clip-SpatialGridDataFrame-with-SpatialPolygons-tp7581998p7582001.html Sent from the R-sig-geo mailing list archive at Nabble.com. ___ R-sig-Geo mailing list R-sig-Geo@r-

Re: [R-sig-Geo] Clip SpatialGridDataFrame with SpatialPolygons

2012-12-18 Thread Edzer Pebesma
On 12/18/2012 04:59 PM, Nathalie Morin wrote: > Hello again, > > Actually, I found the answer to my own question : > clip <- D.tls.SPGDF[g,] fullgrid(D.tls.SPGDF) = FALSE clip <- D.tls.SPGDF[g,,drop=TRUE] # and, if you want: fullgrid(clip) = TRUE gridparameters(clip) > > The problem is that t

Re: [R-sig-Geo] Clip SpatialGridDataFrame with SpatialPolygons

2012-12-18 Thread Nathalie Morin
Hello again, Actually, I found the answer to my own question : clip <- D.tls.SPGDF[g,] The problem is that the coordinates and cells dimension remain unchanged after the process !? > summary(clip) Object of class SpatialGridDataFrame Coordinates: minmax [1,] 828049.000 828191

[R-sig-Geo] Clip SpatialGridDataFrame with SpatialPolygons

2012-12-18 Thread Nathalie Morin
Hello! I have already searched the Forum’s archives and sp documentation, but the answer is still unclear to this basic question : how can you clip a SpatialGridDataFrame with a SpatialPolygons and return a new clipped SpatialGridDataFrame (not a vector !). Here is my data as an example :