[GRASS5] r.out.tiff bug with binary maps

Markus Neteler neteler at itc.it
Wed Mar 31 08:58:43 EST 2004


It seems that I have found a bug in r.out.tiff:
Exporting of binary maps seems to be broken.
Can anyone confirm this?

Test: Spearfish data set

g.region -dp
r.mapcalc "testmap=if(fields>1,1,null())"
d.rast testmap
# ... map looks ok

r.out.tiff -tp in=testmap out=testmap
display testmap.tif
# ... contains RGB = 255:0:127 *everywhere*


Same error with:
 r.mapcalc "testmap=if(fields>1,2,null())"
 r.out.tiff -tp in=testmap out=testmap
 display testmap.tif

while
 r.mapcalc "testmap=if(fields>1,1,0)"
 r.out.tiff -tp in=testmap out=testmap
 display testmap.tif

is somewhat ok.

So the NULL support fails for pallete '-p' and binary
maps. The export of more than one category and no data areas:

 r.out.tiff -tp in=fields out=testmap
 display testmap.tif

is correct. The r.out.tiff problem seems to be related to single
value maps with no data area and '-p' flag.

The '-p' flag is important as it is currently the only
way to export GRASS CELL raster maps (range of 0..255) which
allows for import with r.in.gdal as *single* map. Without
'-p' flag the Tiff Photometric Interpretation is set to
'RGB color' and r.in.gdal creates three bands...

No idea, how to fix '-p' for binary maps.

Markus




More information about the grass-dev mailing list