[R-sig-Geo] Read and write GRASS rasters without GRASS installed
Roger Bivand
Roger.Bivand at nhh.no
Tue Feb 14 18:15:31 CET 2012
On Tue, 14 Feb 2012, pgalpern wrote:
> Could anyone tell me if it is possible to read and write GRASS rasters
> (compressed) in R without having GRASS installed? raster() will not do this
> directly.
>
> Could readRAST6 in spgrass6 be used to do this? It seems that is should,
> using the useGDAL option. I have been unsuccessful, am I missing something?
No, it doesn't seem that it should. Its documentation explains that it
reads and writes temporary files written and read by GRASS, no more or
less. The useGDAL= argument is used to use a GDAL-supported driver for the
intermediate file, rather tha r.in/our.bin in GRASS and readBin() in R.
You are thinking of the GRASS GDAL raster plugin, which allows other
programs to read GRASS rasters. However, GDAL must be built with it, and
the plugin driver links dynamically to the GRASS installation, so it is
not a stand-alone driver: "For GRASS 5.7 Radim Blazek has moved the driver
to using the GRASS shared libraries directly instead of using libgrass.
Currently (GDAL 1.2.2 and later) ..." - GRASS is now at 6.4.2 and GDAL at
1.9.0, so the format definition shows how up to date the plugin notes are.
So the only sensible route if you do not have GRASS installed is to export
the files to a GDAL raster format and use those with readGDAL() or
raster(), etc.
Hope this clarifies,
Roger
>
> Thank you,
> Paul
>
>
--
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list