[R-sig-Geo] readRAST6 problem

Roger Bivand Roger.Bivand at nhh.no
Tue Apr 28 12:48:13 CEST 2009


On Tue, 28 Apr 2009, Agustin Lobo wrote:

> Hi!
>
> I'm getting this message at reading a grass raster file:
>
> rastdum <- readRAST6("nomdum",cat=F)
> raster map/current region mismatch detected in components:
>          cols            rows origin.northing  origin.easting
>          TRUE            TRUE           FALSE            TRUE
> set plugin=TRUE to override; continuing with plugin=FALSE
> ERROR 6: SetColorTable() only supported for Byte or UInt16 bands in TIFF 
> format.
> /media/Transcend/Montseny/GrassData//carlos/A_TOTAL/.tmp/caminoccg/nomdum has 
> GDAL driver GTiff
> and has 94 rows and 116 columns
>
> 1. I don't think I have to worry about the ERROR 6:

No, this message is conditional on your GRASS r.out.gdal version, recent 
versions support a flag to turn off colour table export to GTiff.

> 2. But why is it stating a GTiff driver for reading a grass raster? Is there 
> a previous conversion from raster to GTiff?

Yes, as you will see, your working region and the region of the raster 
differ. The plugin exports the raster in its own region, not the current 
region, while r.out.gdal respects the current region. If the two do not 
match, r.out.gdal/readGDAL are used with a temporary file rather than the 
plugin. To extract the raster in its own region, use execGRASS("g.region", 
parameters=list(rast="nomdum")) first, then the plugin region and the 
current region should be the same.

Hope this helps,

Roger

>
> Thanks
>
> Agus
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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