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 the coordinates and cells dimension remain unchanged > after the process !? > >> summary(clip) > Object of class SpatialGridDataFrame > Coordinates: > min max > [1,] 828049.000 828191.000 > [2,] 101770.000 101915.000 > [3,] 321.632 480.632 > Is projected: TRUE > proj4string : > [+init=epsg:27561 +proj=lcc +lat_1=49.50000000000001 > +lat_0=49.50000000000001 +lon_0=0 > +k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 > +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs] > Grid attributes: > cellcentre.offset cellsize cells.dim > 1 828049.500 1 142 > 2 101770.500 1 145 > 3 322.132 1 159 > Data attributes: > Min. 1st Qu. Median Mean 3rd Qu. Max. NA's > 0.0 0.0 0.0 0.0 0.0 0.6 3161825.0 > > > > -- > View this message in context: > http://r-sig-geo.2731867.n2.nabble.com/Clip-SpatialGridDataFrame-with-SpatialPolygons-tp7581998p7581999.html > Sent from the R-sig-geo mailing list archive at Nabble.com. > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > -- Edzer Pebesma Institute for Geoinformatics (ifgi), University of Münster Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics e.pebe...@wwu.de _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo