Skip to content

GRASS raster as RasterLayer

2 messages · Johannes Radinger, Rafael Wüest

#
Hello,

I am not sure if a ran into a dead end, but how can I import a GRASS GIS raster (native) into R as a RasterLayer. With the spgrass6 package I am able to import the rasters (readRAST6) into R, but they are in SpatialGridDataFrame format...but I need them for other calculations (dismo-package) as RasterLayers resp. bricks/stacks.
Is there a R function that transforms from SpatialGridDataFrame to RasterLayer? Or do I need to save the Raster in GRASS as ASCII file etc. and read that raster in with the raster package?

Best regards,

Johannes
--
#
Hi,

if you have a SpatialGridDataFrame you can use the raster() command to transform it into a raster.

check ?raster

Rafael
On 15.02.2012, at 10:25, Johannes Radinger wrote:

            
--
Rafael W?est
Swiss Federal Research Institute WSL
Z?rcherstrasse 111
8903 Birmensdorf
Switzerland

+41 44 7392126
rafael.wueest at wsl.ch
http://www.wsl.ch/info/mitarbeitende/wueest