[GRASS-user] GRASS export GeoTiff adventure... continued :-)

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Sun Aug 3 10:29:25 EDT 2008


Dear GRASSers,
how do you really export as GeoTiffs your raster maps to view in OpenEV,

I think I solved my problem by removing color tables (as Markus Metz
suggested), exported groups, nodata=-9999 and, very important, setting
in my loop over all groups a "g.region rast=$i" each time.

Without it I couldn't see anything whenever I have put an out of range
nodata value. I am posting my questions I had before "solving" my
problem anyway. Maybe there is still something interesting to

Thank you, Nikos.

Some info:

uname -a
Linux vertical 2.6.24-19-generic #1 SMP Fri Jul 11 21:01:46 UTC 2008
x86_64 GNU/Linux

gdalinfo --version
GDAL 1.5.2, released 2008/05/29

GRASS 6.4.svn (2008)

For the records: I am not interested to open my images with any other
tool than TheGIMP, QGIS, OpenEV (maybe ImageMagick).

I export the groups (red, green and blue maps for each group) with:
for i in `g.mlist group`; do r.out.gdal $i type=Byte out=$i.tiff; done"

I can see the exported images in QGIS, OpenEV. However, this sets 255 as
"nodata" which is something that I don't want. Whenever I set a nodata
value out of range [1] (for Byte that would be smaller than 0 or bigger
than 255 --- right?) I can't see propely the exported tiffs in either
QGIS or OpenEV. In QGIS nothing appears and in OpenEV the individual
tiff's (loading with openev -h *.tiff) "flash" and dissapear to leave a
black screen.

Is there a way to use r.out.tiff to export groups?

Frank Warmerdam wrote [2] "There is no standard tag in TIFF or GeoTIFF
for describing nodata pixel 
values.  The only approach you might be able to use is to somehow add
alpha channel and mark the nodata regions as alpha=0; however, I'm not 
sure how you would go about that."

Is this related to the "nodata" problem?
If yes, has anybody found a solution to it?
Could the "metaopt=" option of r.out.gdal be useful here?

I can't seem to export raster maps with gdal_translate as described in
Markus' blog [3]
(copy-paste from [3] gdal_translate -of
Gtiff /usr/local/share/grassdata/spearfish/PERMANENT/cellhd/soils

What about this work-around [4] that Maciek postd some time ago? 

[1] http://www.gdal.org/classGDALRasterBand.html



[4] http://www.mail-archive.com/grassuser@grass.itc.it/msg01634.html

More information about the grass-user mailing list