Re: [R-sig-Geo] polygons to grid?

2009-11-21 Thread Robert J. Hijmans
Hi Agus, In this function, and in all other functions in 'raster', the values of a new RasterLayer object are written to disk if they cannot be stored in memory (they are saved in a temporary file that is erased the next time you load the package). To force writing to disk, and to a more permanent

Re: [R-sig-Geo] polygons to grid?

2009-11-21 Thread Robert J. Hijmans
Agus, Please see raster::polygonsToRaster Let 'p' be a SpatialPolygonsDF. Create an appropriate RasterLayer object, for example use the extent of the polygons and set the resolution. r <- raster(extent(p)) res(r) <- 1 # then: r <- polygonsToRaster(p, r) # there are additional arguments to c

Re: [R-sig-Geo] polygons to grid?

2009-11-21 Thread Barry Rowlingson
On Sat, Nov 21, 2009 at 1:20 PM, Agustin Lobo wrote: > Hi? > > Is it possible to perform a vector to raster conversion in R, > from SpatialPolygonsDataFrame to a SpatialGrid (providing the final > resolution? If what you want is a raster grid storing the value of some attribute of polygons sampl

[R-sig-Geo] polygons to grid?

2009-11-21 Thread Agustin Lobo
Hi? Is it possible to perform a vector to raster conversion in R, from SpatialPolygonsDataFrame to a SpatialGrid (providing the final resolution? In particular, is it possible to do it using package raster? (I know this can be done using gdal or grass etc, but I'm trying to find an "only R" sol