[R-sig-Geo] readRAST6 problem

Agustin Lobo alobolistas at gmail.com
Tue Apr 28 13:18:19 CEST 2009


In my case, I do not see the reason why the current region and the 
raster region should be
different. Everything is within a for() loop, in which I
set the region,
create a MASK,
create a raster with r.mapcalc (hence the same region than the current 
region)
import the raster to R

It's not critical for what I'm doing now (R calculates a textural 
statistics for small irregular windows)
but could be a problem if I had to bring back an R-modified SGDF to 
grass, right?

(btw, I never know if I can/have to CC to grass-stats about these 
issues, there is the cross-posting
problem)

Agus

Roger Bivand wrote:
> 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
>>
>>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: alobolistas.vcf
Type: text/x-vcard
Size: 251 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090428/11e14473/attachment.vcf>


More information about the R-sig-Geo mailing list