Skip to content
Prev 7501 / 29559 Next

Problem with readRAST6

On Fri, 29 Jan 2010, Rainer M Krug wrote:

            
Well, this does happen. I never knowingly use the plugins for raster or 
vector any more, because I have multiple GDAL and GRASS installations, and 
the cross-dependencies take more time to manage than any accruing benefit. 
Use plugin=TRUE to avoid the sanity check.

If you would like to find the cause, please run debug(readRAST6) first, 
then run the command, and print out the values of gg (returned by 
gmeta6()), and fninfo (returned by GDALinfo). The values of gg$n and 
fninfo[5] are found to differ, but gg$w and fninfo[4] not. It could be 
that fninfo[5] is set wrongly; in GDALinfo, it is:

         ysign <- sign(gt[6])
         offset.y <- ifelse(ysign < 0, gt[4] + ysign * d[1] *
             abs(cellsize[2]), gt[4] + abs(cellsize[2]))

where gt is the vector of values returned by RGDAL_GetGeoTransform from 
the file-specific driver, and d[1] is the number of rows.

If you in addition say debug(GDALinfo), and print the values of gt, we 
could see whether the values seem sane for this driver. They "must" be 
anyway for reading with plugin=TRUE to work, because they set up the 
GridTopology for the object read in; checking with gdalinfo of the same 
raster would also be helpful.

Short answer, use plugin=TRUE if you want to use it.

Hope this helps,

Roger